Autumn 2025 — Fully Solved Answer all three. Reveal after attempting.
Q1 (CO1) — Moore & IAS 1a State Moore’s law and summarize its consequences.
Show solution Moore’s Law (Gordon Moore, 1965): the number of transistors on a chip doubles approximately every two years. Consequences: cost of logic/memory falls; shorter path ⇒ higher speed; computers become smaller and more convenient. → cheaper, faster, smaller.
1b Calculate the IAS main memory size in bits, bytes, and words.
Show solution 4096 words × 40 bits , address = 12 bits , rows = 2 12 bits = 40 × 2 12 = 163,840 bits bytes = 163,840 8 = 20,480 bytes words = 2 12 = 4096 words \begin{aligned} 4096 \text{ words} \times 40 \text{ bits}&, \quad \text{address} = 12 \text{ bits}, \quad \text{rows} = 2^{12} \\ \text{bits} &= 40 \times 2^{12} = 163{,}840 \text{ bits} \\ \text{bytes} &= \frac{163{,}840}{8} = 20{,}480 \text{ bytes} \\ \text{words} &= 2^{12} = 4096 \text{ words} \end{aligned} 4096 words × 40 bits bits bytes words , address = 12 bits , rows = 2 12 = 40 × 2 12 = 163 , 840 bits = 8 163 , 840 = 20 , 480 bytes = 2 12 = 4096 words 163,840 bits = 20,480 bytes = 4096 words.
1c big Add M(08A)+M(08B), subtract the sum from M(08C), write to M(08D). Assembly + machine code.
Show solution Result: M(08D) = M(08C) − M(08A) − M(08B) — load the positive term first.
Assembly Opcode Address LOAD M(08C) 0000 0001 0000 1000 1100 SUB M(08A) 0000 0110 0000 1000 1010 SUB M(08B) 0000 0110 0000 1000 1011 STOR M(08D) 0010 0001 0000 1000 1101
Q2 (CO3) — Amdahl & CPI 2a State Amdahl’s Law and derive the Speedup_overall equation.
Show solution Let F F F = fraction of time enhanced, S S S = speedup of that fraction.
New time = ( 1 − F ) ⋅ T old + F ⋅ T old S = T old [ ( 1 − F ) + F S ] Speedup overall = T old T new = 1 ( 1 − F ) + F S \begin{aligned} \text{New time} &= (1 - F) \cdot T_{\text{old}} + \frac{F \cdot T_{\text{old}}}{S} = T_{\text{old}} \left[ (1 - F) + \frac{F}{S} \right] \\ \text{Speedup}_{\text{overall}} &= \frac{T_{\text{old}}}{T_{\text{new}}} = \frac{1}{(1 - F) + \frac{F}{S}} \end{aligned} New time Speedup overall = ( 1 − F ) ⋅ T old + S F ⋅ T old = T old [ ( 1 − F ) + S F ] = T new T old = ( 1 − F ) + S F 1 Speedup overall = 1 ( 1 − F ) + F S \text{Speedup}_{\text{overall}} = \frac{1}{(1 - F) + \frac{F}{S}} Speedup overall = ( 1 − F ) + S F 1 .
2b big Program = 120 s, multiplication = 90 s. How much must multiplication speed up to run the program 3× faster?
Show solution Target time = 120 3 = 40 s Unaffected = 120 − 90 = 30 s 40 = 30 + 90 S ⇒ 90 S = 10 ⇒ S = 9 \begin{aligned} \text{Target time} &= \frac{120}{3} = 40 \text{ s} \\ \text{Unaffected} &= 120 - 90 = 30 \text{ s} \\ 40 = 30 + \frac{90}{S} \;&\Rightarrow\; \frac{90}{S} = 10 \;\Rightarrow\; S = 9 \end{aligned} Target time Unaffected 40 = 30 + S 90 = 3 120 = 40 s = 120 − 90 = 30 s ⇒ S 90 = 10 ⇒ S = 9 Speed up multiplication by 9×.
2c big CPI A/B/C/D = 1/2/3/4. Seq1 = 4/3/2/1, Seq2 = 3/1/1/3. More instructions? Faster? CPI of each?
Show solution IC 1 = 10 , IC 2 = 8 Cycles 1 = 4 + 6 + 6 + 4 = 20 Cycles 2 = 3 + 2 + 3 + 12 = 20 CPI 1 = 20 10 = 2.0 CPI 2 = 20 8 = 2.5 \begin{aligned} \text{IC}_1 &= 10, \quad \text{IC}_2 = 8 \\ \text{Cycles}_1 &= 4 + 6 + 6 + 4 = 20 &\qquad \text{Cycles}_2 &= 3 + 2 + 3 + 12 = 20 \\ \text{CPI}_1 &= \tfrac{20}{10} = 2.0 &\qquad \text{CPI}_2 &= \tfrac{20}{8} = 2.5 \end{aligned} IC 1 Cycles 1 CPI 1 = 10 , IC 2 = 8 = 4 + 6 + 6 + 4 = 20 = 10 20 = 2.0 Cycles 2 CPI 2 = 3 + 2 + 3 + 12 = 20 = 8 20 = 2.5 Seq1 has more instructions (10 vs 8); both take 20 cycles ⇒ equally fast; CPI1 = 2.0, CPI2 = 2.5.
Q3 (CO2) — MIPS 3a Draw all MIPS instruction formats.
Show solution op 6 bits rs 5 bits rt 5 bits rd 5 bits shamt 5 bits funct 6 bits R-format op 6 bits rs 5 bits rt 5 bits immediate/offset 16 bits I-format op 6 bits address 26 bits J-format Three formats, each 32 bits.
3b big Encode: lw $s0,32($s1); add $s0,$s0,$s2; sw $s0,36($s1). (lw=100011, sw=101011)
Show solution lw $s0,32($s1) : 100011 10001 10000 0000000000100000
add $s0,$s0,$s2 : 000000 10000 10010 10000 00000 100000
sw $s0,36($s1) : 101011 10001 10000 0000000000100100 $s0=16=10000, $s1=17=10001, $s2=18=10010; 32=100000, 36=100100 (16-bit).
3c Address of the last byte and last word in MIPS-32.
Show solution Last byte = 2 32 − 1 2^{32} - 1 2 32 − 1 ; last word = 2 32 − 4 2^{32} - 4 2 32 − 4 .