C8 · Problem set 7
Problem set 7: building the processor
These problems use lessons 35 to 37: the single-cycle datapath and its timing, the control unit, and the multi-cycle processor. Times are in picoseconds, and instruction words are given in hex.
Check
A single-cycle processor has = 30, memories of 150, a register-file read of 120, an ALU of 180, a multiplexer of 25 and a register-file setup of 40 ps.
(a)
What is the clock period?
Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.
(b)
What is the clock frequency?
Check
A 400 ps multiplier is added beside the 120 ps ALU of a 750 ps single-cycle processor, on the critical path. 3% of instructions multiply.
(a)
What is the new clock period?
Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.
(b)
By what factor does every program slow down, multiplies or not?
Check
An instruction word is 00A12423.
(a)
What is funct3 (bits 14:12)?
(b)
What is rs1 (bits 19:15)?
Check
An I-type instruction is C0028293.
(a)
What immediate does the immediate generator produce?
(b)
What is its opcode?
Check
A store instruction is FE742E23.
(a)
What is its offset? (S-type: bits 31:25 are imm[11:5], bits 11:7 are imm[4:0].)
(b)
Which register does it store (rs2)?
Check
li t0, DEADBEEF becomes lui t0, hi then addi t0, t0, lo, where addi sign-extends lo.
(a)
What is hi?
(b)
What is lo, as a signed number?
Check
A jal ra, −64 sits at address 1024.
(a)
What does ra receive?
(b)
Where does execution continue?
Check
A program is 25% loads, 8% stores, 20% branches and 4% jumps; the rest are R-type and I-type arithmetic. On the multi-cycle processor, loads take 5 cycles, branches 3 and the rest 4, at 250 ps a cycle.
(a)
What is the CPI?
(b)
What is the time per instruction?
Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.
Check
A multi-cycle datapath has = 30, multiplexers of 25, an ALU of 260, a memory of 250 and a setup of 40 ps.
(a)
What is the clock period?
Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.
(b)
How long does a branch take?
Check
A loop body of 1 loads, 4 R-type instructions and a branch runs 100 times. The multi-cycle clock is 320 ps; the single-cycle clock is 700 ps.
(a)
How long does the multi-cycle processor take?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(b)
And the single-cycle processor?
Check
A single-cycle processor runs at 750 ps; a multi-cycle design for the same instructions averages a CPI of 3.9.
(a)
Below what clock period would the multi-cycle design be faster?
Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.
(b)
Below what period would even its 5-cycle loads be no slower?
Check
A microprogrammed control unit has 512 micro-instructions of 32 bits.
(a)
How big is its control store?
(b)
How many bits does its micro-PC need?
Check
A multi-cycle control state machine has 12 states.
(a)
How many state flip-flops with binary encoding?
(b)
With one-hot?
Check
A beq at 512 with offset −12 compares two registers; Zero = 1.
(a)
What is the next PC?
(b)
What target did the branch adder compute, either way?
Check
A main decoder is built as a ROM addressed by the 7-bit opcode, with 32 output signals; an ALU decoder as a ROM addressed by ALUOp (2 bits), funct3 and funct7's bit 5, with 8 outputs.
(a)
How many bits does the main decoder ROM hold?
(b)
And the ALU decoder ROM?
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
15 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.