Read this lesson as text
Memory Elements
Discrete Math · Axiom Academy
How digital circuits remember: latches and flip-flops use feedback to store state, forming the foundation of computer memory and sequential logic. Memory in digital circuits emerges from a simple but profound idea: feedback. When we connect the output of logic gates back to their inputs, the circuit can maintain a stable state even after the original input changes. 2. SR Latch: The Basic Memory Cell The SR (Set-Reset) latch is the simplest memory element. It has two inputs: S (Set) to store a 1, and R (Reset) to store a 0. Two cross-coupled NOR gates create the feedback loop. S=1, R=0: Set Q to 1 (store a 1) S=0, R=1: Reset Q to 0 (store a 0) S=0, R=0: Hold current state (memory!) S=1, R=1: Invalid/forbidden state 3. D Flip-Flop: Clocked Memory The D (Data) flip-flop adds a clock signal to control when data is captured. The input D is stored only on the rising edge of the clock, preventing unwanted changes during computation. This is the workhorse of modern digital systems. 4. JK and T Flip-Flops: Versatile Variants Beyond the D flip-flop, two other types offer unique behaviors useful in counters, state machines, and other applications. JK Flip-Flop: General-purpose sequential logic, state machines T Flip-Flop: Binary counters, clock dividers, frequency synthesis D Flip-Flop: Registers, shift registers, data storage
This is the written version of the interactive lesson above. See the full Discrete Math course.