I need help with this work Show how the following values would be stored by machines with 32-bit words
I need help with this work
Show how the following values would be stored by machines with 32-bit words, using little endian and then big endian format. Assume each value starts at address 1016. Draw a diagram of memory for each, placing the appropriate values in the correct (and labeled) memory locations.
456789A116
0000058A16
1414888816
2- Convert the following expressions from infix to reverse Polish (postfix) notation.
X x Y + W x Z + V x U
W x X + W x (U x V + Z)
(W x (X + Y x (U x V)))/(U x (X + Y))
3-Convert the following expressions from reverse Polish notation to infix notation.
W X Y Z – + x
U V W X Y Z + x + x +
X Y Z + V W – x Z + +
4-Suppose we have the instruction Load 500. Given that memory and register R1 contain the values below:
5- The memory unit of a computer has 256K words of 32 bits each. The computer has an instruction format with 4 fields: an opcode field; a mode field to specify 1 of 7 addressing modes; a register address field to specify 1 of 60 registers; and a memory address field. Assume an instruction is 32 bits long. Answer the following:
- How large must the mode field be?
- How large must the register field be?
- How large must the address field be?
- How large is the opcode field?
20-Suppose we have the instruction Load 500. Given that memory and register R1 contain the values below:
Memory
| 100 | 600 | ||
| … | R1 | 200 | |
| 400 | 300 | ||
| … | |||
| 500 | 100 | ||
| … | |||
| 600 | 500 | ||
| … | |||
| 700 | 800 |
Assuming R1 is implied in the indexed addressing mode, determine the actual value loaded into the accumulator and fill in the table below:
| Mode | Value Loaded into AC |
| Immediate | |
| Direct | |
| Indirect | |
| Indexed |
Part I.
Create an eight-bit word and then perform three of the shifting operations on it.
(For ease of reading, I suggest that the word be broken into two 4-bit pieces separated by a blank space (i.e. xxxx xxxx)
The possible shifting operations include:
- Logical Shift Right
- Logical Shift Left
- Rotate Right
- Rotate Left
- Arithmetic Shift Right
- Arithmetic Shift Left
Each operation should be performed independently on the original 8-bit word.
Part II
Evaluate a short algebraic expression using code with three-operand instructions. The expression should have a minimum of three operands and 2 operators. Operands may be alpha or numeric.
You may only use registers A through F, plus X and T.
Registers A through F may not be changed, i.e. their values are fixed.
Register T may be used as a temporary register, and Register X must contain the final answer.
Show the postfix for the expression, and then use a stack to evaluate the expression.
As an example, consider +B + C * D
The three-operand instructions would be:
ADD X, A, B
MUL T, C, D
ADD X, X, T
The Postfix would be AB+CD*+
The stack would be:
PUSH / A onto the stack
PUSH / B onto the stack
ADD /pop A & B, add them, and push the answer back on the stack
PUSH /C
PUSH / D
MUL /pop C & D, multiply them, and push the answer back on the stack
ADD / pop X & T, add them, and push the answer back on the stack
POP / X off the stack
It is important to note that operational hierarchy dictates that
- we first perform all arithmetic inside inner parentheses;
- then inside outer parentheses;
- then do multiplication and division operations before addition and subtraction operations.
Part III
| Memory | Memory | ||
| Address | Content | ||
| 1000 | 1200 | ||
| Register | Content | ||
| 1100 | 400 | R1 | 200 |
| 1200 | 1000 | ||
| 1300 | 1100 | ||
| 1400 | 1300 |
Assuming R1 is implied in the indexed addressing mode, determine the actual value loaded into the accumulator and fill in the table below:
| Mode | Value Loaded into AC |
| Immediate | |
| Direct | |
| Indirect | |
| Indexed |

