Consider the following assembly code: Description Read data from memory and store in R1. Memory address is calculated by adding 45 to the content of R2 Instruction LD R1, 45(R2) ADD R7, R1, R5 Add contents of R1 and R5 and store to R7 XOR R2, R7, R7 Logical Ex-OR between contents of R7 with R7 and store result in R2 BEZ R2, Target LD R3, 50(R4) Jump to Target if R7 is Zero Read data from memory and store in R3. Memory address is calculated by adding 50 to the content of R4 Read data from memory and store in R5. Memory address is calculated by adding 45 to the content of R6 LD R5, 45(R6) ADD R10, R5, R3 Add contents of R5 to R3 and store in R2 Target: AND R2, R3, R5 Logical AND between contents of R3 & R5. Store result to R2 ADD R10, R8, R2 Add contents of R2 and R8 and store to R10 END Use five-stage pipeline containing Fetch, Decode, Memory read, Execute, Write-back units, show the execution of above instructions. Dat dependencies and control hazards, if detected must be resolved by delaying the pipeline as required. Assume that a multi-port RAM is used wit the CPU running at 1GHZ and each section requires 3 clock cycles. Calculate the execution time.

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
Consider the following assembly code:
Instruction
Description
LD R1, 45(R2)
Read data from memory and store in R1. Memory address is calculated by adding 45 to the content of R2
ADD R7, R1, R5
Add contents of R1 and R5 and store to R7
XOR R2, R7, R7
Logical Ex-OR between contents of R7 with R7 and store result in R2
Jump to Target if R7 is Zero
Read data from memory and store in R3. Memory address is calculated by adding 50 to the content of R4
Read data from memory and store in R5. Memory address is calculated by adding 45 to the content of R6
BEZ R2, Target
LD R3, 50(R4)
LD R5, 45(R6)
ADD R10, R5, R3
Add contents of R5 to R3 and store in R2
Target: AND R2, R3, R5
Logical AND between contents of R3 & R5. Store result to R2
ADD R10, R8, R2
Add contents of R2 and R8 and store to R10
END
Use five-stage pipeline containing Fetch, Decode, Memory read, Execute, Write-back units, show the execution of above instructions. Data
dependencies and control hazards, if detected must be resolved by delaying the pipeline as required. Assume that a multi-port RAM is used with
the CPU running at 1GHZ and each section requires 3 clock cycles. Calculate the execution time.
Transcribed Image Text:Consider the following assembly code: Instruction Description LD R1, 45(R2) Read data from memory and store in R1. Memory address is calculated by adding 45 to the content of R2 ADD R7, R1, R5 Add contents of R1 and R5 and store to R7 XOR R2, R7, R7 Logical Ex-OR between contents of R7 with R7 and store result in R2 Jump to Target if R7 is Zero Read data from memory and store in R3. Memory address is calculated by adding 50 to the content of R4 Read data from memory and store in R5. Memory address is calculated by adding 45 to the content of R6 BEZ R2, Target LD R3, 50(R4) LD R5, 45(R6) ADD R10, R5, R3 Add contents of R5 to R3 and store in R2 Target: AND R2, R3, R5 Logical AND between contents of R3 & R5. Store result to R2 ADD R10, R8, R2 Add contents of R2 and R8 and store to R10 END Use five-stage pipeline containing Fetch, Decode, Memory read, Execute, Write-back units, show the execution of above instructions. Data dependencies and control hazards, if detected must be resolved by delaying the pipeline as required. Assume that a multi-port RAM is used with the CPU running at 1GHZ and each section requires 3 clock cycles. Calculate the execution time.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

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