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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Step 1: Introduction

 The execution of a program, denoted as "P1," which operates under a specific hardware instruction set architecture (ISA). The program's behavior is determined by a sequence of instructions stored in an Instruction Memory (IM). Our objective is to create an execution table that illustrates the step-by-step execution of this program and, ultimately, determine the final values of registers R2, R3, and R4 when the program concludes.

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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education