Docsity

Homework 3 - Computer Architecture | CS 401, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
CS 401
COMPUTER ARCHITECTURE
Department of Computer Science
Homework #3
Due: 3/19/08
1). Indicate the type of data hazards (RAW, WAR, and WAW) that exist between the
following instructions.
i1 Add R1, R2, R3 -- R1 = R2 + R3
i2 Add R4, R1, R4 -- R4 = R1 + R4
i3 Add R3, R1, R2 -- R3 = R1 + R2
i4 Add R1, R1, R4 -- R1 = R1 + R4
2) Draw a chart to show how the following instructions are executed using Tomasulo's
method. The instruction pipeline has five stages, IF, ID, OF, EX, and WB, and each stage
takes 1 clock cycle. The system has one adder and two reservation stations.
add R1, R3, R4
add R3, R1, R2
add R3, R2, R3
3) Use scoreboard method. The instruction pipeline has four stages, IF&ID, OF, EX, and WB
as in the text book. Each stage takes 1 clock cycle, except for the EX stage of the
multiplication, which takes 3 cycles. The system has one adder and two multipliers.
mul R5, R1, R2,
mul R2, R2, R5
add R2, R3, R4

Partial preview of the text

Download Homework 3 - Computer Architecture | CS 401 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CS 401

COMPUTER ARCHITECTURE

Department of Computer Science

Homework

Due: 3/19/

1). Indicate the type of data hazards (RAW, WAR, and WAW) that exist between the following instructions.

i 1 Add R 1 , R 2 , R 3 -- R 1 = R 2 + R 3 i 2 Add R 4 , R 1 , R 4 -- R 4 = R 1 + R 4 i 3 Add R 3 , R 1 , R 2 -- R 3 = R 1 + R 2 i 4 Add R 1 , R 1 , R 4 -- R 1 = R 1 + R 4

2) Draw a chart to show how the following instructions are executed using Tomasulo's method. The instruction pipeline has five stages, IF, ID, OF, EX, and WB, and each stage takes 1 clock cycle. The system has one adder and two reservation stations.

add R1, R3, R add R3, R1, R add R3, R2, R

3) Use scoreboard method. The instruction pipeline has four stages, IF&ID, OF, EX, and WB as in the text book. Each stage takes 1 clock cycle, except for the EX stage of the multiplication, which takes 3 cycles. The system has one adder and two multipliers.

mul R5, R1, R2, mul R2, R2, R add R2, R3, R