$\require{cancel}$
Introduction to Memory
- This is B.8, you should read it.
- This is called sequential logic
- The output depends on the state of the circuit and the input.
- This is different from the combinational logic we have been studying.
- There the input completely determines the output.
- The basic unit is the flip-flop.
- A flip-flop is a memory element where the output is equal to the value of the stored state.
- This state is only changed on a clock edge.
- The basic flip-flop is the RS flip-flop
- Two inputs,
- R - reset
- S - set.
- These are probably just push buttons, not long term data lines.
- Two outputs Q and $\overline{Q}$
- Built from two nor gates.
-
- Note, this is not a circuit you can "reason out".
- The D flip-fop is more common.
- Two inputs
- Same outputs.
- When C changes from low to high, the value of D is stored in the circuit.
- You can buy D Flip-Flops here for example.
- Registers
- The most basic register is a collection of flip-flops.
- They have input like
- An n bit data line.
- A clock line
- An enable line
- The output is a n-bit data line.
- The operation is
- Place the data on the data line and allow it to stabilize.
- Raise the enable line
- Raise the clock line
- Keep all raised until the store completes.
-
- You can purchase registers.
- And they can be much more complex, with more tasks.
- The register file
- Look at Any CPU diagram
- Input
- Read Register 1
- Read Register 2
- Write Register
- Data Write
- Output:
- Control: RegWrite - actually write data to the register.
- Let's come up with an instruction that will use each of these.
- Read Register1 and ReadRegister2 select data to put on the corresponding output lines.
- Since there are 32 registers, we need 5 bits. But we knew this.
- ReadData 1 and 2 are 32 bit lines as they hold data.
- Write Register is again a 5 bit line as it is a register address.
- WriteData is a 32 bit line as it holds data.
- RegWrite is a single bit, which is lit when all is ready to write to a register.
- A digital file of these circuits.