Starting from:
$30

$24

Lab 9: Building a Register File Solution

Submission timestamps will be checked and enforced strictly by the CourseWeb; late submissions will not be accepted. Check the due date of this lab on the CourseWeb. Remember that, per the course syllabus, if you are not marked by your recitation instructor as having attended a recitation, your score will be cut in half.







A Register File




A register le is a subcircuit that lets the surrounding circuitry read from one or two registers, which are chosen dynamically. A register le also lets the surrounding circuitry optionally write to one register, which is also chosen dynamically. In this lab, you will build a register le that has two read ports and one write port. That means that your register le circuit should let outside circuitry read two registers at a time while also supporting writing to one register at a time. You should support eight registers total. Each register must hold 32 bits of data. Use Logisim’s built-in register component.




The Figure below shows a symbolic representation of what your register le subcircuit should looks like. The slash indicates that an input/output contains more than one bit of data.




RegWrite













Read


register 1
Read


Read
data 1


register 2


Write
Read
register
data 2



Write

data Register










clock




Read register 1 speci es which register should be read from. That register’s data should be presented on the Read data 1 output.




Read register 2 speci es which register should be read from. That register’s data should be presented on the Read data 2 output.




Write register speci es which register should be written to.




Write data is the data that will be written to the register speci ed by Write register. On a falling clock edge, the data will be written to the speci ed register.




RegWrite, if true (1), will cause the Write data to be written to the register speci ed by Write register, otherwise, Write data will be ignored and no register will be written to.




Clock conveys the clock signal.




Before starting, ask yourself the following questions:










CS/COE 0447 | Computer Organization and Assembly Language Page 1
Lab 9: Building a Register File










How can we tell how many bits will be outputted on Read data 1 and on Read data 2?



How can we tell how many bits specify Read register 1 and Read register 2?



How can we tell how many bits specify Write register?



How can we tell how many bits specify Write data?



How can we tell how many bits specify RegWrite?



Why is RegWrite necessary?



Why does the circuit not have RegRead input?



Why does the register le have a clock input? Why doesn’t it use its own clock instead of requireing a clock from outside circuitry?



To assist you, here are some tips about sizing di erent bit widths:




Since the registers are 32 bits wide, and since Read data 1 will output the entire contents of a register, Read data 1 will be a 32 bits wide. By the same reasoning, Read data 2 will also be a 32 bits wide.



Since you need 8 registers, then 3 bits are needed to \name" each register. The register having the name 000 is the register 0, 001 is the register 1, 010 is the register 2, and so on. Read register 1 and Read register 2 are therefore each 3 bits wide.



Write register describes which register of the eight registers is being written to. Therefore, Write register is 3 bits wide.



Write data speci es the data that will be written into a register. Since the registers are 32 bits, Write data will be 32 bits.



RegWrite says whether or not a register write should actually be performed (yes or no). Therefore, RegWrite is 1 bit wide.



Here are some general tips to help you implement the register le:




The data that should be written to a register must be able to be \given" to any of the 8 registers in the register le (i.e., your circuit must be able to write to any register).




Registers can be made read-only (disabled) by setting one of their pins appropriately. This can let you control which register, if any, is written to. Take a look at the Library Reference for more information.




Consider where you might need multiplexers.




Recall that, given multiple inputs, a multiplexer lets you select from exactly one of them. Remember that the number of inputs from which a multiplexer chooses can be con gured by changing its \select bits" property, and that the \data bits" property controls how many bits are on each of its inputs.




A decoder has multliple output wires, but only one of those output wires is true at any given time. It is easy to control which output is true. Decoders are found under the plexers category.




You can poke a register and give it a value. This will let you give each register a di erent value to make sure that the circuitry reads from the correct register (according to Read register 1 and Read register 2).




Diagrams below show circuit diagram of a register le discussed in class (32 32-bit registers le).




Use these diagram to help you build your register le.







CS/COE 0447 | Computer Organization and Assembly Language Page 2
Lab 9: Building a Register File













Write
























32 32−bit




















































D Flip Flops


































































Write Data








0
















































Register 0








1
















































Enable


Register Number


5−to−32
:
























































decoder
:




















Write Data






30














































Register 1






31














































Enable






















































































































:




















:








































Write Data




























































Register 30
























































Enable




































































































































Write Data




























































Register 31




























Register data


























Enable







































































































clock







Read register




number 1




























Read register




number 2







5








32




Register 0






Register 1


M






32






:
:
u


Register 30


x








Register 31






5








32






32
M
32






u




:




32
x


























Read data 1































Read data 2















Submission




Submit the le lab09.circ via CourseWeb before the due date stated on the CourseWeb.

































CS/COE 0447 | Computer Organization and Assembly Language Page 3

More products