Computer Organization and Architecture Assignment - 2: 1 Knreddy
Computer Organization and Architecture Assignment - 2: 1 Knreddy
3. An instruction at address 021 in the basic computer has I = 0, an operation code of the
AND instruction, and an address part equal to 083 (all numbers are in hexadecimal). The
memory word at address 083 contains the operand B8F2 and the content of AC is A937.
Go over the instruction cycle and determine the contents of the following registers at the
end of the execute phase: PC, AR, DR, AC, and IR. Repeat the problem six more times
starting with an operation code of another memory-reference instruction.
4. The content of PC in the basic computer is 3AF (all numbers are in hexadecimal). The
content of AC is 7EC3. The content of memory at address 3AF is 932E. The content of
memory at address 32E is 09AC. The content of memory at address 9AC is 8B9F.
a. What is the instruction that will be fetched and executed next?
b. Show the binary operation that will be performed in the AC when the instruction is
executed.
c. Give the contents of registers PC, AR, DR, AC, and IR in hexadecimal and the values
of E, I, and the sequence counter SC in binary at the end of the instruction cycle.
3AF 932E
32E 09AC
9AC 8B9F
AC = 7EC3
(a) 9 = (1001)
1 001
I=1 ADD
b) AC = 7EC3 (ADD)
DR = 8B9F
0A62 E=1
5. Convert the following numerical arithmetic expression into reverse Polish notation and
show the stack operations for evaluating the numerical result.
(3 + 4)*[10*(2 + 6) + 8]
6
2 2 8 8
STACK
4 10 10 10 10 80 80 88
3 3 7 7 7 7 7 7 7 7 616
OPERATION
PUSH(10)
PUSH(4)
PUSH(2)
PUSH(6)
PUSH(8)
PUSH(3)
MUL
MUL
ADD
ADD
ADD
6. The memory unit of a computer has 256K words of 32 bits each. The computer has an
instruction format with four fields: an operation code field, a mode field to specify one of
seven addressing modes, a register address field to specify one of 60 processor registers,
and a memory address. Specify the instruction format and the number of bits in each field
if the in instruction is in one memory word.
5 3 6 18 = 32
Address = 18 bits
Mode = 3 bits
Register = 6 bits
27 bits
op code 5 bits
32 bits
8. An instruction is stored at location 300 with its address field at location 301. The address
field has the value 400. A processor register R1 contains the number 200. Evaluate the
effective address if the addressing mode of the instruction is (a) direct; (b) immediate;
(c) relative; (d) register indirect; (e) index with R1 as the index register.
(a)direct addressing:
Direct addressing means that the address field contains the address of
memory location the instruction is supposed to work with (where an
operand "resides").
Effective address would therefore be 400.