Memory Elements
- Since we are moving quickly towards an implementation, I would like to look at memory elements.
- You should read B.1 - B.3.
- We should be mostly done with this. We will not cover PLAs, but you should give this section a read.
- I will skip B.4 Verilog
- We will come back to B.5 and B.6 as needed.
- We have Discussed B.7
- This is B.8
- The basic unit of CPU memory is a flip-flop
- A flip-flop stores a single bit.
- Flip-flops are sometimes referred to as latches as well,
but we will use that term differently later.
- There different types of flip-flops, but we will look at two.
- Flip-flops are built from transistors.
- RS Flip-Flop
- Two nor gates
- Two inputs
- Two outputs
- If the S input is raised, the value of the flip-flop is set.
- If the R input is raised, the value of the flip-flop is reset.
- Undefined if both are raised at the same time.
- The output is the value and not the value. (Q and Q )
-
- More complex flip-flops provide further functionality.
- The D flip-flop
- Has two inputs
- A data line D
- A clock line C
- has two outputs
- When the clock changes from low to high, the value on D will be stored in the flip-flop
-
- In TKgate the D flip-flop has two additional ports
- A clear-not, clears the flip-flop when the data is 0
- Enable-not, enables the flip-flop when the data is 0
-
- All are here
- A register, then is just a collection of flip-flops.
A
- it should have a Clock and Data input line
- And possibly an output line
- Also clear and enable.
-
- How should the MIPS register file work?
- Build one