Presentation is loading. Please wait.

Presentation is loading. Please wait.

4/20/20051 Branch prediction Predict taken Predict not taken Taken Not taken.

Similar presentations


Presentation on theme: "4/20/20051 Branch prediction Predict taken Predict not taken Taken Not taken."— Presentation transcript:

1 4/20/20051 Branch prediction Predict taken Predict not taken Taken Not taken

2 4/20/20052 Branch Prediction for (i=0; i<5; i++) { for (j=i+1; (j<5) && (i+j < 7); j++) { sum += i*j; } Inner Loop Similar for outer loop 012345 0CCCCM 1CCCM 2CCM 3M 4C 5

3 4/20/20053 How is cache implemented 0 1 2 3 … 0x400800ab 0x400800ac Word view Valid Block

4 4/20/20054 Block address  Suppose address space is 32 bits  Block size is 16 Bytes  How many bits in the block address?  How many blocks in MM?  Suppose cache size is 32KB  How many blocks in cache? …

5 4/20/20055 Set associative Set size is 4KB 32KB cache How many sets can cache hold? 0x11af11bf : 0001 0001 1010 1111 0001 0001 1011 1111 BYTE ADDR SET ADDR 01234567

6 4/20/20056 Cache misses Cold start miss Conflict miss Capacity miss

7 4/20/20057 Tomasulo’s algorithm 1. add $R0, $R1, $R2 2. add $R1, $R0, $R2 3. add $R2, $R1, $R0 4. add $R0, $R1, $R2 5. add $R1, $R0, $R2 6. add $R2, $R1, $R0 3 reservation stations (rs0, rs1, rs2) 4 cycles to add cycle$R0$R1$R2 1 rs0, $R1, $R2 2 rs1, rs0, $R2 3 rs0, $R1, $R2rs1, rs0, $R2rs2, rs0, rs1 4 --- 5 rs0, rs1, rs2 rs1, data, $R2rs2, data, rs1


Download ppt "4/20/20051 Branch prediction Predict taken Predict not taken Taken Not taken."

Similar presentations


Ads by Google