Download presentation
Presentation is loading. Please wait.
Published byJaydon Vallier Modified over 9 years ago
1
CBP 2009Comp 3014 The Nature of Computing 1 Laundry Model Washer Drier Store Basket Wardrobe
2
CBP 2009Comp 3014 The Nature of Computing 2 Process Steps Wash then Dry 1 load takes 2 hours idle running time 9.0010.0011.00 1.Load the washer at 9.00 2.Done at 10, load the drier 3.Drier Done at 11 0.5
3
CBP 2009Comp 3014 The Nature of Computing 3 Sequential Process 3 loads takes 6 hours time 9.00 15.00 11.00 1.Load washer at 9.00 2.Done at 10, load drier 3.Drier Done at 11 4.Reload washer at 11 5.Done at 12, load drier 6.Drier done at 13 7.Reload washer at 13 8.Done at 14, load drier 9.Done at 15 13.00 0.5
4
CBP 2009Comp 3014 The Nature of Computing 4 Overlapping Process 3 loads takes 4 hours time 9.00 15.00 11.00 1.Load washer at 9.00 2.Done at 10, load drier reload washer 3.Both Done at 11. Reload drier reload washer 4.Both done at 12. Reload drier 5.Drier done at 13 13.00 From 10.00 till 11.00 both washer and dryer running concurrently 0.75
5
CBP 2009Comp 3014 The Nature of Computing 5 Washing Pipeline Filling time 9.0011.0013.0015.0017.00 18.00 5 loads in 9 hours 5 Cycles !!! 1.Get washing 2.Wash 3.Dry 4.Store 5.Put away 0.55
6
CBP 2009Comp 3014 The Nature of Computing 6 Washing Pipeline Full time 9.0011.0013.0015.0017.00 Pipe Full gives 1 load per hour 1.0
7
CBP 2009Comp 3014 The Nature of Computing 7 Can we Pipeline SAM ? Data Memory Instruction reg Code Memory ALU r1 r2 r0 X Y W XY W 0 1 7 mar mdr 1.Fetch 2.Dec/ Reg 3.ALU 4.Mem 5.RW
8
CBP 2009Comp 3014 The Nature of Computing 8 Pipelined Sam4 Data Memory 0 1 7 X Y W Y W r1 r2 r0 X Code Memory 1.Fetch2.Dec/ Reg 3.ALU4.Mem5.RW Buffer time
9
CBP 2009Comp 3014 The Nature of Computing 9 5 Stages in Pipeline ALU Mem Reg MemReg add r3,r1,r2 r1,r2 r3 add Let’s take the instruction add r3,r1,r2 and show which stage is needed for each part of the instruction. 1.Fetch 2.Dec/ Reg 3.ALU4.Mem5.RW time
10
CBP 2009Comp 3014 The Nature of Computing 10 ld r0 Memr3 Two Instructions ld r3,[r0+2] Two instructions into the pipeline add r4,r1,r2 ALU add r1,r2 r4 r0 2 time
11
CBP 2009Comp 3014 The Nature of Computing 11 Structural Hazard ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg Here we are being asked to read from memory and write to it simultaneously. Impossible! Write (store) Read (fetch) Solution – Use separate code and data memories add r4,r1,r2 st r0,[5]
12
CBP 2009Comp 3014 The Nature of Computing 12 Hazardous Washing time 9.0011.0013.0015.0017.00 18.00 Washing basket containes both clean and dirty washing!
13
CBP 2009Comp 3014 The Nature of Computing 13 Code and Data Memories ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg
14
CBP 2009Comp 3014 The Nature of Computing 14 add r1,r2 r3 Data Hazard add r3,r1,r2 but need r3 here EARLIER ! add r4,r1,r3 add r1,r3 r4 r3 set here time
15
CBP 2009Comp 3014 The Nature of Computing 15 Data Hazard ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg add r3,r1,r2 add r4,r1,r3 Need value of r3 for second instruction before the first is complete.
16
CBP 2009Comp 3014 The Nature of Computing 16 Pipeline Stalls ALU Mem Reg MemReg ALU Mem Reg MemReg ALU Mem Reg MemReg Mem ALU Reg MemReg Stall ALU Mem Reg MemReg add r3,r1,r2 add r4,r1,r3 Resolve Hazard – Insert delay into second instruction stream. ‘Stall’ Cycles. But this needs extra electronics on the chip. Complex and Costly.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.