midterm review
play

Midterm Review Jason Mars Monday, February 11, 13 ISA - - PowerPoint PPT Presentation

Midterm Review Jason Mars Monday, February 11, 13 ISA - Instruction Length Fixed Length Variable Length 32 bits shift opcode rs rt rd funct amount 32 bits opcode rs rt immediate / offset 32 bits opcode target 32 bits shift


  1. Midterm Review Jason Mars Monday, February 11, 13

  2. ISA - Instruction Length Fixed Length Variable Length 32 bits shift opcode rs rt rd funct amount 32 bits opcode rs rt immediate / offset 32 bits opcode target 32 bits shift opcode rs rt rd funct amount 32 bits opcode target 32 bits opcode rs rt immediate / offset Monday, February 11, 13

  3. ISA 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits shift opcode rs rt rd funct amount 6 bits 5 bits 5 bits 16 bits opcode rs rt immediate / offset 26 bits 6 bits opcode target • Why 5 bits for rs, rt, rd? • What impacts # bits in opcode • Why is it ok to have 16 bits in immediate • What is the di ff erence between immediate and register source • What are the trade-o ff s between fixed length and variable length? • What is a load-store ISA? Monday, February 11, 13

  4. Addressing Modes • Register direct R3 • Immediate (literal) #25 • Direct (absolute) M[10000] • Register indirect M[R3] • Base+Displacement M[R3 + 10000] • Base+Index M[R3 + R4] • Scaled Index M[R3 + R4*d + 10000] • Autoincrement M[R3++] • Autodecrement M[R3 - -] • Memory Indirect M[ M[R3] ] Monday, February 11, 13

  5. ISA - Addressing Modes in MIPS register direct OP rs rd sa funct rt add $1, $2, $3 immediate OP rs rt immediate add $1, $2, #35 We get register indirect and absolute for free, but how? base + displacement rs lw $1, disp($2) register indirect ! disp = 0 immediate absolute rt ! (rs) = 0 (R1 = M[R2 + disp]) Monday, February 11, 13

  6. Memory Organization 0 32 bits of data 4 32 bits of data Registers hold 32 bits of data 8 32 bits of data 12 32 bits of data • What is a word? • What does it mean to be word aligned? • What are the values of the last two bits of a word aligned address? Monday, February 11, 13

  7. Performance Execution Time Y Speedup (X/Y) n = = = Execution Time X Monday, February 11, 13

  8. Performance • Machine A runs program C in 9 seconds, Machine B runs the same program in 6 seconds. What is the speedup we see if we move to Machine B from Machine A? • Machine B gets a new compiler, and can now run the program in 3 seconds. Speedup? Monday, February 11, 13

  9. Performance • Machine A runs program C in 9 seconds, Machine B runs the same program in 6 seconds. What is the speedup we see if we move to Machine B from Machine A? Speedup (X/Y) = • Machine B gets a new compiler, and can now run the program in 3 seconds. Speedup? Monday, February 11, 13

  10. Performance • Machine A runs program C in 9 seconds, Machine B runs the same program in 6 seconds. What is the speedup we see if we move to Machine B from Machine A? X = machine B Speedup (X/Y) = Y = machine A • Machine B gets a new compiler, and can now run the program in 3 seconds. Speedup? Monday, February 11, 13

  11. Performance • Machine A runs program C in 9 seconds, Machine B runs the same program in 6 seconds. What is the speedup we see if we move to Machine B from Machine A? 9 X = machine B Execution Time Y Speedup 1.5x (X/Y) n = = = Execution Time X Y = machine A 6 • Machine B gets a new compiler, and can now run the program in 3 seconds. Speedup? Monday, February 11, 13

  12. Performance • Machine A runs program C in 9 seconds, Machine B runs the same program in 6 seconds. What is the speedup we see if we move to Machine B from Machine A? 9 X = machine B Execution Time Y Speedup 1.5x (X/Y) n = = = Execution Time X Y = machine A 6 • Machine B gets a new compiler, and can now run the program in 3 seconds. Speedup? X = machine B Speedup (X/Y) = Y = machine A Monday, February 11, 13

  13. Performance • Machine A runs program C in 9 seconds, Machine B runs the same program in 6 seconds. What is the speedup we see if we move to Machine B from Machine A? 9 X = machine B Execution Time Y Speedup 1.5x (X/Y) n = = = Execution Time X Y = machine A 6 • Machine B gets a new compiler, and can now run the program in 3 seconds. Speedup? 9 X = machine B Execution Time Y Speedup 3x (X/Y) n = = = Execution Time X Y = machine A 3 Monday, February 11, 13

  14. Performance - Execution Time • Assume that we have an application composed with a total of 500,000 instructions, in which 20% of them are the load/store instructions with an average CPI of 6 cycles, and the rest of the instructions are integer instructions with average CPI of 1 cycle. Execution Time = Instructions Cycles Seconds Program Instruction Cycle Monday, February 11, 13

  15. Performance - Execution Time • Assume that we have an application composed with a total of 500,000 instructions, in which 20% of them are the load/store instructions with an average CPI of 6 cycles, and the rest of the instructions are integer instructions with average CPI of 1 cycle. Execution Time = Instructions Cycles Seconds Program Instruction Cycle 500,000 * Monday, February 11, 13

  16. Performance - Execution Time • Assume that we have an application composed with a total of 500,000 instructions, in which 20% of them are the load/store instructions with an average CPI of 6 cycles, and the rest of the instructions are integer instructions with average CPI of 1 cycle. Execution Time = Instructions Cycles Seconds Program Instruction Cycle 500,000 * (.2 * 6 + .8 * 1) * Monday, February 11, 13

  17. Performance - Execution Time • Assume that we have an application composed with a total of 500,000 instructions, in which 20% of them are the load/store instructions with an average CPI of 6 cycles, and the rest of the instructions are integer instructions with average CPI of 1 cycle. Execution Time = Instructions Cycles Seconds Program Instruction Cycle 500,000 * (.2 * 6 + .8 * 1) * 1 ns = Monday, February 11, 13

  18. Performance - Execution Time • Assume that we have an application composed with a total of 500,000 instructions, in which 20% of them are the load/store instructions with an average CPI of 6 cycles, and the rest of the instructions are integer instructions with average CPI of 1 cycle. Execution Time = Instructions Cycles Seconds Program Instruction Cycle 500,000 * (.2 * 6 + .8 * 1) * 1 ns = 1,000,000 ns Monday, February 11, 13

  19. Amdahl’s Law 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced total execution time = 1 Fraction enhanced Monday, February 11, 13

  20. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? Monday, February 11, 13

  21. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced Monday, February 11, 13

  22. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced Speedup = Monday, February 11, 13

  23. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced 1 Speedup = Monday, February 11, 13

  24. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced 1 Speedup = Monday, February 11, 13

  25. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced 1 Speedup = (1- 0.25) Monday, February 11, 13

  26. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced 1 Speedup = (1- 0.25) + Monday, February 11, 13

  27. Amdahl’s Law: The Super MPEG Decoder • Assume that we have a game spending 25% of it’s time doing MPEG decoding. If we add a hardware MPEG decoder that can speed up the MPEG decoding by 10x. How much does the hardware MPEG decoder help? 1 Speedup = (1- Fraction enhanced )+ Fraction enhanced Speedup enhanced 1 Speedup = (1- 0.25) + Monday, February 11, 13

Recommend


More recommend