The SR latch is the basic memory cell. Two NOR gates are cross-coupled: each gate's output is one of the other gate's inputs. That feedback loop holds a bit, and the two inputs let you change it.
- S = 0, R = 0: hold. Q keeps its value.
- S = 1, R = 0: set. Q becomes 1.
- S = 0, R = 1: reset. Q becomes 0.
- S = 1, R = 1: forbidden. Both outputs are forced to 0.
The two outputs are Q and its complement . In the gates, Q = and = .
Why the loop holds: a NOR outputs 1 only when all its inputs are 0. With S = R = 0 and Q = 1, the lower gate sees Q = 1 and outputs = 0; the upper gate then sees two 0s and outputs Q = 1. The value props itself up. Start from Q = 0 and the same reasoning keeps it at 0.
There is no clock. The latch responds as soon as S or R changes, so it is level sensitive. Adding an enable gives the gated sr latch, and steering logic in front gives the gated d latch.
To predict Q at any moment, find the most recent set or reset. Everything since then was a hold.