Beruflich Dokumente
Kultur Dokumente
; D0 = a
; D4 = b
; D4 = a + b
; D1 = d
; D1 = a + d
; D4 = (a + b) / (a + d)
; D2 = e
; D2 = (a * e)
; D2 = ( (a + b) / (a + d) ) * (a * e)
1/5
Problem 2)
a) Provide micro-instructions in the form of detailed flowchart for the execution of the
following instructions.
b) Show the flow of the micro-instructions within the GPR architecture by highlighting
the system buses and the registers used.
i)
ii)
iii)
iv)
Answer 2)
For each of the above, for part b), draw the CPU consisting of all the registers (for
example MAR, MBR, PC, IR, Address and Data Registers, ALU) and Memory, and show
each of the micro-instruction as in part a).
i)
move X, D0
Machine Instruction:
0011 0000 0011 1000
Address of X
a)
Micro-steps are:
MAR <-- PC
MBR <-- M[MAR]
IR <-- MBR
|
decode
|
PC <-- PC + 2
MAR <-- PC
MBR <-- M[MAR]
MAR MBR
MBR M[MAR]
D0 MBR
PC <-- PC + 2
ii)
; fetch
move D0, X
Machine Instruction:
0011 1110 0000 0000
Address of X
2/5
a)
Micro-steps are:
MAR <-- PC
MBR <-- M[MAR]
IR <-- MBR
|
decode
|
PC <-- PC + 2
MAR <-- PC
MBR M[MAR]
MAR MBR
MBR D0
M[MAR] MBR
PC <-- PC + 2
; fetch
a)
MAR <-- PC
MBR <-- M[MAR]
IR <-- MBR
|
interpret
|
fetch
decode
TRUE
|
PC <-- PC + 2
MAR <-- PC
MBR <-- M[MAR] ; get displacement
PC <-- PC + MBR ; execute
FALSE
|
PC <- PC + 4
Problem 3)
Given the following assembly program P for GPR Processor:
1. Move X, R1
2. Move Y, R2
3. Add R1, R2
4. Move Z, R3
5. Mul R2, R3
6. Move X, R1
7. Add R1, R3
8. Move R3, L
a) What is this program doing?
b) Draw flowcharts showing the micro-step execution for each of the instructions 1,
3, 5 and 8.
c) Calculate the execution times of instructions 1, 3, 5 and 8 assuming:
Micro-step
Register Transfer
4/5
Decoding
Add Execution
Multiply Execution
Memory Access
2
2
5
10
5/5