πΎ Flip-flops: 1 bit of memory
SR latch
The simplest memory: two NOR gates feeding each other. Set (S) stores 1, Reset (R) stores 0, and when both are 0 the loop keeps whatever it last stored.
Hold: Q keeps its value β this is memory
| S | R | Q next |
|---|---|---|
| 0 | 0 | Q (hold) |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 1 | 1 | β invalid |
- CPU registers & caches: the fastest memory in a computer is made of flip-flops (SRAM uses 6 transistors per bit).
- Counters: digital clocks and stopwatches, step counters, the odometer in a car, a microwaveβs timer.
- Frequency dividers: a quartz watch crystal ticks 32,768 times a second β 15 T flip-flops halve it down to exactly 1 tick per second (2ΒΉβ΅ = 32,768).
- Debouncing buttons and remembering that a button was pressed (e.g. a lift call button stays lit).
- Shift registers: send data one bit at a time β USB, LED strips, keyboard scanning.