Register File Block Diagram:

Most register files have at least two read/output ports and one write/input port to accommodate sending two values to the ALU and receiving one result.

To control a read port we need to be able to specify a register number for the register to be read. The width/number of bits read equals the number of bits per register.

To control a write port we need to be able to specify a register number for the register to be written, the data to be written (equal to the number of bits in a register), and a write-enable signal. The write-enable signal indicates if we are writing a register, i.e., indicates if we should ignore the write register # and data.

A register-file block-diagram assuming:

One-bit (ith bit) Slice of a Register File Implementation Using D-Flip Flops:

For example, a complete (not just a one-bit slice) register file that has: