Latch

From Free net encyclopedia

A latch is a type of door or window lock (device). A latching relay is a relay with two stable positions.

A latch is an electronic circuit used to store information in asynchronous sequential logic systems. One latch can store one bit of information. Latches often occur in multiples, some of which have special names, such as the 'quad latch' (which can store four bits) and the 'octal latch' (eight bits). Latches are devices which have no clock input and change output state only in response to data input, while flip-flops have data inputs but change output state only in response to a clock input.

Contents

SR latch

Image:SR-NOR-latch.pngThe logically simplest latch is the SR latch, where S and R stand for 'set' and 'reset'. The latch is constructed from a pair of cross-coupled NOR (negative OR) logic gates. The stored bit is present on the output marked Q.

Normally, in storage mode, the S and R inputs are both low, and feedback maintains the Q and Q outputs in a constant state, with Q the complement of Q. If S (set) is pulsed high while R is held low, then the Q output is forced high, and stays high when S returns low. On the other hand, if R is pulsed high while S is held low, then the Q output is forced low, and stays low when R returns low. The output of the latch cannot be predicted if S and R are brought high at the same time, so this condition must be avoided.

SR latch truth table
SRQQnextComment
0000Maintain
0011Maintain
0100Reset
0110Reset
1001Set
1011Set
110-Not allowed
111-Not allowed

SR latch

Image:Sr-latch.pngAnother simple latch is the SR latch, where S and R stand for 'not set' and 'not reset'. This is constructed from a pair of cross-coupled NAND (negative AND) logic gates. NAND gates tend to be more compact than NOR gates in integrated circuits, so this variety is more common, despite the notational inconvenience of its active-low inputs.

Operation is similar to that of the SR latch, except that the S and R inputs are now active-low instead of active-high.

SR latch truth table
SRSRQQnextComment
001100Maintain
001111Maintain
011000Reset
011010Reset
100101Set
100111Set
11000-Not allowed
11001-Not allowed

Gated D Latch

A gated D latch is a latch constructed from an SR latch, two additional AND gates, a NOT gate, and two inputs, data (<math>D</math>) and gate (<math>G</math>). The S input is set to D AND G, while the R input is set to <math>\bar D</math> AND G. When G is set to low (0), output does not change (in other words, Qnext equals Q). When G is set to high (1), output (Q) is equal to D.

Gated D latch truth table
GDQQnextComment
0000No change
0011No change
0100No change
0111No change
1000Set data
1010Set data
1101Set data
1111Set data

See also

it:Latch nl:Latch zh:锁存器