C8 Computer organization · Practice
CISC and RISC
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Check
A program executes 1 billion instructions at an average CPI of 1.2 on a 4 GHz processor. How long does it take?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
Check
Design A runs 1 billion instructions at CPI 1.4. Design B needs 1.4 times as many instructions at CPI 1.2. Both run at the same clock.
(a)
What is B's run time as a fraction of A's?
(b)
What CPI would B need to tie A?
Check
In a RISC-V program, a fraction 0.6 of instructions compress to 2 bytes and the rest stay 4 bytes. What's the average instruction size?
Check
A loop of 600 x86 instructions, 1.1 micro-operations each, is limited by decoding at 5 instructions per cycle. A micro-operation cache delivers 8 per cycle. How many cycles per iteration does the cache save?
Check
Memory holds a at 0x1000, b at 0x1004 and c at 0x1008 (the starter stores them). Compute a = b + c with loads and a store, as a RISC machine must.
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
Model code size. A program has n = 2500 instructions; their kinds and proportions are: arithmetic 45% (compressible 70% of the time), loads and stores 30% (compressible 60%), branches and jumps 15% (compressible 50%), other 10% (never). Compute size_rv32 (bytes, all 4-byte), size_rvc (bytes, compressed where possible, using the expected counts) and saving (the fractional reduction).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
How long do 2 billion instructions at CPI 1.2 take at 2.5 GHz?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
Check
If a fraction 0.55 of 4-byte instructions compress to 2 bytes, by what fraction does the program shrink?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C8