Answer the following based on the image below; What does this code do with R2 and R3 to compute R4? Answer with one simple line of valid C code of the form: R4 = exp;, where exp is a simple C expression using the the variables R2 and R3. exp must not include C statements like loops or conditionals.

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
Question

Answer the following based on the image below; What does this code do with R2 and R3 to compute R4? Answer with one simple line of valid C code of the form: R4 = exp;, where exp is a simple C expression using the the variables R2 and R3. exp must not include C statements like loops or conditionals.

PC
2-
Instruction
Memory
Read
Address
+
[15:12]
[11:8]
Inst 16 [7:4]
[3:0]
1
0
16
Control
Unit
Read Addr 1
Write Enable
Read Addr 2
Mem
Write Addr
Reg Write
Write Data
4
Register File
Read
Data 1
Read
Data 2
Shift left by 1
16
16
Sign extend 16
HW microarchitecture datapath
0
1
+
Branch
ALU
Control
ALU
zero flag
16
0
1
Mem Store
Address
Write Enable
Data Memory
Write
Data
Read
Data
0 1
Transcribed Image Text:PC 2- Instruction Memory Read Address + [15:12] [11:8] Inst 16 [7:4] [3:0] 1 0 16 Control Unit Read Addr 1 Write Enable Read Addr 2 Mem Write Addr Reg Write Write Data 4 Register File Read Data 1 Read Data 2 Shift left by 1 16 16 Sign extend 16 HW microarchitecture datapath 0 1 + Branch ALU Control ALU zero flag 16 0 1 Mem Store Address Write Enable Data Memory Write Data Read Data 0 1
Execute this code,
assuming R2 holds 5 and R3 holds 3.
Indicate the final register values when the
code reaches HALT.
0: AND R2, R2, R4
2:
AND R3, R3, R5
BEQ R5, RO, 3
SUB R5, R1, R5
ADD R4, R4, R4
JMP 2
HALT # Stops execution.
R3:
4:
6:
8:
A:
C:
R2:
R4:
R5:
Transcribed Image Text:Execute this code, assuming R2 holds 5 and R3 holds 3. Indicate the final register values when the code reaches HALT. 0: AND R2, R2, R4 2: AND R3, R3, R5 BEQ R5, RO, 3 SUB R5, R1, R5 ADD R4, R4, R4 JMP 2 HALT # Stops execution. R3: 4: 6: 8: A: C: R2: R4: R5:
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Datatypes
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
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