Consider a HW ISA program P1 with the following Instruction Memory IM: a. fill in the execution table for program P1 using the IM. Use the same notational conventions used in the example execution table for P0 below. Any numbers beginning with 0x will be interpreted as hexidecimal; any numbers not beginning with 0x will be interpreted as decimal. b. Show the final values of the registers R2, R3, and R4 when the program execution halts. Again, any numbers beginning with 0x will be interpreted as hexidecimal; any numbers not beginning with 0x will be interpreted as decimal.

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter6: System Integration And Performance
Section: Chapter Questions
Problem 2PE
icon
Related questions
Topic Video
Question

Consider a HW ISA program P1 with the following Instruction Memory IM:

a. fill in the execution table for program P1 using the IM. Use the same notational conventions used in the example execution table for P0 below. Any numbers beginning with 0x will be interpreted as hexidecimal; any numbers not beginning with 0x will be interpreted as decimal.

b. Show the final values of the registers R2, R3, and R4 when the program execution halts. Again, any numbers beginning with 0x will be interpreted as hexidecimal; any numbers not beginning with 0x will be interpreted as decimal.

Execution table
PC Instruction
ΟΧΟ
BEQ R2, R3, 3
0x2
ADD R2, R1, R2
0x4
SUB R3, R1, R3
0x6
JMP 0
ΟΧΟ
BEQ R2, R3, 3
0x2 ADD R2, R1, R2
0x4 SUB R3, R1, R3
0x6
JMP 0
0x0
BEQ R2, R3, 3 PC
0x8
HALT
State Changes
PC
PC+2 = 0+2 = 2 (because 3 = R[2] != R[3] = 7)
R[2] R[2]+R[1] = 3+1 = 4; PC ← PC+2=2+2 = 4
PC+2 = 4+2 = 6
R[3] R[3]-R[1] = 7-1 = 6; PC
PC 2*0 = 0
←
←
PC PC+2 = 0+2 = 2 (because 4 = R[2] != R[3] = 6)
R[2] ← R[2]+R[1] = 4+1 = 5; PC ← PC+2 = 2+2 = 4
R[3] R[3]-R[1] = 6-1 = 5; PC - PC+2 = 4+2 = 6
PC 2*0 = 0
←
←
←
←
PC+2+(2*3) = 0+2+6 = 8 (because 5 = R[2] :
==
program stops executing
R[3] = 5)
Transcribed Image Text:Execution table PC Instruction ΟΧΟ BEQ R2, R3, 3 0x2 ADD R2, R1, R2 0x4 SUB R3, R1, R3 0x6 JMP 0 ΟΧΟ BEQ R2, R3, 3 0x2 ADD R2, R1, R2 0x4 SUB R3, R1, R3 0x6 JMP 0 0x0 BEQ R2, R3, 3 PC 0x8 HALT State Changes PC PC+2 = 0+2 = 2 (because 3 = R[2] != R[3] = 7) R[2] R[2]+R[1] = 3+1 = 4; PC ← PC+2=2+2 = 4 PC+2 = 4+2 = 6 R[3] R[3]-R[1] = 7-1 = 6; PC PC 2*0 = 0 ← ← PC PC+2 = 0+2 = 2 (because 4 = R[2] != R[3] = 6) R[2] ← R[2]+R[1] = 4+1 = 5; PC ← PC+2 = 2+2 = 4 R[3] R[3]-R[1] = 6-1 = 5; PC - PC+2 = 4+2 = 6 PC 2*0 = 0 ← ← ← ← PC+2+(2*3) = 0+2+6 = 8 (because 5 = R[2] : == program stops executing R[3] = 5)
IM
Address
Contents
0x0-0x1
ADD RO, RO, R2
0x2-0x3
ADD R1, R1, R3
0x4-0x5
ADD R3, R3, R4
0x6-0x7
BEQ R3, R4, 3
0x8-0x9
ADD R2, R4, R2
OXA-0XB
SUB R4, R1, R4
OXC-0XD
JMP 3
OXE-OXF HALT
Transcribed Image Text:IM Address Contents 0x0-0x1 ADD RO, RO, R2 0x2-0x3 ADD R1, R1, R3 0x4-0x5 ADD R3, R3, R4 0x6-0x7 BEQ R3, R4, 3 0x8-0x9 ADD R2, R4, R2 OXA-0XB SUB R4, R1, R4 OXC-0XD JMP 3 OXE-OXF HALT
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning