Before anything else, let us re-earn the four symbols we will use over and over, in plain words:
The single cost fact we lean on everywhere:
Every register-file numeric question falls into one of these boxes. The job of this page is to hit every row.
| # |
Case class |
What makes it tricky |
Example that hits it |
| A |
N is an exact power of 2 |
clean log2 |
Ex 1 |
| B |
N is not a power of 2 |
must round up (ceiling) |
Ex 2 |
| C |
Degenerate: N=1 |
log21=0 address bits |
Ex 3 |
| D |
Total stored state |
N⋅n, ports don't count |
Ex 4 |
| E |
Superscalar port scaling |
(R+W)2 area ratio |
Ex 5 |
| F |
Limiting case: many ports |
how fast cost blows up |
Ex 6 |
| G |
Read-during-write timing |
old vs new value, no arithmetic trap |
Ex 7 |
| H |
Real-world word problem |
translate English → N,k,R,W |
Ex 8 |
| I |
Exam twist: instruction encoding budget |
mixing k with opcode bits |
Ex 9 |
| J |
R0 degenerate storage |
one register stores nothing |
Ex 10 |
Prerequisite building blocks live in Multiplexers and Decoders and Datapath and ALU; the timing row leans on Pipeline Hazards.
Recall Which matrix cell is each trap?
- 40 registers → address bits? ::: Cell B (ceiling): ⌈log240⌉=6.
- Does a 3rd read port change total stored bits? ::: No — Cell D: state is N⋅n only.
- 4-issue vs 1-issue area factor? ::: Cell F: 16×, from (12/3)2.
- Same-cycle read of a register being written? ::: Cell G: policy-dependent; forwarding gives new value.
- Why does 64 registers hurt opcode space? ::: Cell I: k rises to 6, three fields cost 18 bits, leaving fewer opcode bits.
Address bits to select 1 of 40 registers?
⌈log240⌉=6 bits.
Do read/write ports change the total stored bits of a register file?
No; stored bits =N⋅n only. Ports affect area and speed.
Area factor going from a 1-issue (R=2,W=1) to a 4-issue (R=8,W=4) file?
(12/3)2=16× larger.
How many storage flip-flops in a 32×32-bit RISC-V file, given R0 is hardwired?
31×32=992 (R0 stores nothing).
Opcode bits left in a 32-bit word after three 5-bit register fields?
32−15=17 bits.