Presentation is loading. Please wait.

Presentation is loading. Please wait.

CBP 2009Comp 3014 The Nature of Computing 1 Laundry Model Washer Drier Store Basket Wardrobe.

Similar presentations


Presentation on theme: "CBP 2009Comp 3014 The Nature of Computing 1 Laundry Model Washer Drier Store Basket Wardrobe."— Presentation transcript:

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 Load the washer at Done at 10, load the drier 3.Drier Done at

3 CBP 2009Comp 3014 The Nature of Computing 3 Sequential Process 3 loads takes 6 hours time Load washer at 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

4 CBP 2009Comp 3014 The Nature of Computing 4 Overlapping Process 3 loads takes 4 hours time Load washer at 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 From till both washer and dryer running concurrently 0.75

5 CBP 2009Comp 3014 The Nature of Computing 5 Washing Pipeline Filling time 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 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 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 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 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.


Download ppt "CBP 2009Comp 3014 The Nature of Computing 1 Laundry Model Washer Drier Store Basket Wardrobe."

Similar presentations


Ads by Google