The register file has 2 read ports and 1 write port because each R-format instruction requires to read 2 data words from the register file and write 1 data word into the register file like |
sub $a0, $t1, $t0 # $a0 = $t1 - $t0The register file outputs the contents of the registers corresponding to the
Read register
inputs on the outputs; no other control inputs are needed.
In contrast, a register write must be indicated by the write control signal.
The inputs carrying the register number to the register file are all 5 bits wide to specify one of 32 registers (32=25 ), whereas the lines carrying data values are 32 bits wide.
|
Writes are edge-triggered, so that all the write inputs must be valid at the clock edge. |