Chapter 5
1. Assume you have a byte-addressable machine that uses 32-bit integers and you are storing the hex value 3456 at address 0.
◆a) Show how this is stored on a big endian machine.
b) Show how this is stored on a little endian machine.
c) If you wanted to increase the hex value to 123456, which byte assignment would be more efficient, big or little endian? Explain your answer.
2. Fill in the following table to show how the given integers are represented, assuming 16-bits are used to store values and the machine uses two's complement notation.
Integer Binary Hex 4-Byte Big Endian (hex value as seen in memory) 4- Byte Little Endian (hex value as seen in memory)
28
2216
-18675
-12
31456
3. Convert the following expressions from infix to reverse Polish (postfix) notation.
a) X × X + Y + W × Z + V × U
b) W × X + X + W × (U × V + Z)
c) (W × (X + Y × (U × V)))/(U × (X + Y))