Due Tuesday, December 5 at 9:29 AM
By the time you have completed this work, you should be able to:
There is only a single (but large!) task for this lab: to design a register file. The register file is a processor component which contains programmer-accessible registers. To this end, the register file has the following sorts of inputs:
Given the above inputs, the register file will potentially write to a register, and then output the value in the specified register.
Specifically for this task, you will design a register file which holds two registers named reg0
and reg1
.
Each one of these registers is two bits large.
For comparison, the register file in ARM holds 16 registers, and each is 32 bits large.
This register file takes the following inputs:
Input Name | Input Description |
---|---|
R |
Specifies which register to read from or write to.
If 0 , then reg0 should be used.
If 1 , then reg1 should be used.
|
WE |
Short for “Write Enable”.
If 1 , then we will write to a register.
If 0 , then we will not write to a register.
|
I0 |
Bit 0 of a two-bit value to write to the register specified by R .
If WE = 0 , this is effectively ignored.
|
I1 |
Bit 1 of a two-bit value to write to the register specified by R .
If WE = 0 , this is effectively ignored.
|
CLK |
Input from the clock. |
The register file returns the following two outputs:
Output Name | Output Description |
---|---|
U0 |
Bit 0 of the register which was read.
This output will be ignored if WE = 1 .
|
U1 |
Bit 1 of the register which was read.
This output will be ignored if WE = 1 .
|
To complete this task, you may use only the following components, in unlimited supply:
AND
, OR
, XOR
, and NOT
gates.S0
and two single-bit input operands A
and B
, and return a single-bit output Z
.
They should be drawn using the symbol below, provided by Wikipedia:D
and a clock input C
.
They produce single-bit outputs Q
and !Q
, which represent the value stored in the latch along with its negation, respectively.
They should be drawn using the symbol below, originally from this source.:2 * 2 = 4
D flip-flops.
WE = 1
, you don't need to worry about what U0
and U1
output, though you will need to perform the register write.
R
effectively selects which register to use.
You will almost assurredly need multiplexers to handle this logic correctly.
You may need multiplexers on both inputs and outputs.
You may either submit your picture / scan on Canvas (for Lab 10), or submit it directly to me in class on Thursday, November 30.
If you submit it online, name it register_file.jpg
, being sure that it's a jpeg
image.
If you collaborated with anyone, write it in the margins of the image.