

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth analysis of pipelining and the hazards associated with it in computer architecture. Topics covered include the benefits of pipelining, pipeline stages, structural hazards, control hazards, and data hazards. The document also discusses solutions to these hazards and the importance of effective cpi (cycles per instruction).
Typology: Slides
1 / 33
This page cannot be seen from the preview
Don't miss anything!


























Control Signals for existing Datapath
M U X P C ADD Registers ADD ADD Sign Extend 4 Instruction Memory Address Instruction Read Reg Read Reg Write Reg Write Data Read Data Read Data2 MU X Data Memory Address Write Data Read Data M U X IF: Instruction Fetch ID: Instruction Decode/ register file read EX: Execute/address calculation MEM: Memory Access^ WB: Write back 16 32 Shift left 2 Zero
M U X P C ADD Registers ADD ADD Sign Extend 4 Instruction Memory Address Instruction Read Reg Read Reg Write Reg Write Data Read Data Read Data2 MU X Data Memory Address Write Data Read Data M U X 16 32 Shift left 2 Zero IF/ID ID/EX EX/MEM MEM/WB
Start: Fetch 10
10 lw r1, r2(35) 14 addI r2, r2, 3 20 sub r3, r4, r 24 beq r6, r7, 100 30 ori r8, r9, 17 34 add r10, r11, r 100 and r13, r14, 15
Fetch 14, Decode 10
10 lw r1, r2(35) 14 addI r2, r2, 3 20 sub r3, r4, r 24 beq r6, r7, 100 30 ori r8, r9, 17 34 add r10, r11, r 100 and r13, r14, 15 lw r1, r2(35)
Fetch 24, Decode 20, Exec 14, Mem 10
10 lw r1, r2(35) 14 addI r2, r2, 3 20 sub r3, r4, r 24 beq r6, r7, 100 30 ori r8, r9, 17 34 add r10, r11, r 100 and r13, r14, 15 lw r sub r3, r4, r5^ addI r2, r2, 3
Fetch 30, Dcd 24, Ex 20, Mem 14, WB 10
10 lw r1, r2(35) 14 addI r2, r2, 3 20 sub r3, r4, r 24 beq r6, r7, 100 30 ori r8, r9, 17 34 add r10, r11, r 100 and r13, r14, 15 lw r beq r6, r7 100 sub r3^ addI r
Clock Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Cycle 6 Cycle 7 1st lw Ifetch Reg/Dec Exec Mem Wr 2nd lw Ifetch Reg/Dec Exec Mem Wr 3rd lw Ifetch Reg/Dec Exec Mem Wr
Cycle 1 Cycle 2 Cycle 3 Cycle 4 R-type Ifetch Reg/Dec Exec Wr
Load Ifetch Reg/Dec Exec Mem Wr
R-type Ifetch Reg/Dec Exec Wr
IR <- Mem[PC]; PC <– PC+4; A <- R[rs]; B<– R[rt] S <– A + B; R[rd] <– M; S <– A + SX; M <– Mem[S] R[rd] <– M; S <– A or ZX; R[rt] <– M; S <– A + SX; Mem[S] <- B if Cond PC < PC+SX; M <– S
M <– S
Mem Structural Hazard and Solution
Load Instr 1 Instr 2 Instr 3 Instr 4
Mem Reg Mem Reg ALU Mem Reg Mem Reg ALU Mem Reg Mem Reg ALU Reg Mem Reg ALU Mem Reg Mem Reg