

## Exercise
- Experiment with these in Logisim
- How can you get it to store a 1 in the latch?
- How can you get it to store a 0 in the latch?


## D Flip Flop
- A (falling edge-triggered) **D flip flop** can be implemented with two D latches in series
- This configuration creates a **delay** so that the output is only changed on the **falling edge** of the clock

- a rising edge-triggered flip flop can be constructed similarly
## Registers
- A **register** is a multi-bit memory component
- Registers are commonly implemented with an array of D flip flops
## Register Files
- A **register file** consists of an array of registers that can be read and written to

## Register Files
- **Reading** is implemented with multiplexers

## Register Files
- **Writing** is implemented with a decoder

## Decoder
- A **decoder** is another common circuit that has $n$ inputs and $2^n$ outputs
-
Only one output is a 1 at any given time (one for each possible combination of inputs)
-
If the input encodes the number 7, then the output bit for 7 is asserted and all others are zeros
## Decoder Truth Table
- Below is a 3-bit decoder truth table

## Exercise: Build a register File in Logisim
- 32 bits
- at least 4 registers



