The Wayback Machine - https://web.archive.org/web/20240529105223/https://www.geeksforgeeks.org/latches-in-digital-logic/
Open In App

Latches in Digital Logic

Last Updated : 20 May, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Latch is a digital circuit which converts its output according to its inputs instantly. To implement latches, we use different logic gates. In this article, we will see the definition of latches, latch types like SR, gated SR, D, gated D, JK and T with its truth table and diagrams and advantages and disadvantages of latch.

What are Latches?

Latches are digital circuits that store a single bit of information and hold its value until it is updated by new input signals. They are used in digital systems as temporary storage elements to store binary information. Latches can be implemented using various digital logic gates, such as AND, OR, NOT, NAND, and NOR gates.

Latches are widely used in digital systems for various applications, including data storage, control circuits, and flip-flop circuits. They are often used in combination with other digital circuits to implement sequential circuits, such as state machines and memory elements.

Latches Definition

Latches are basic storage elements that operate with signal levels (rather than signal transitions). Latches controlled by a clock transition are flip-flops. Latches are level-sensitive devices. Latches are useful for the design of the asynchronous sequential circuit. Latches are sequential circuit with two stable states. These are sensitive to the input voltage applied and does not depend on the clock pulse. Flip flops that do not use clock pulse are referred to as latch.

Types of Latches in Digital Electronics

In digital electronics different types of latches are:

  • SR Latches
  • Gated SR Latches
  • D Latches
  • Gated D Latches
  • JK Latches
  • T Laches

SR Latch

S-R latches i.e., Set-Reset latches are the simplest form of latches and are implemented using two inputs: S (Set) and R (Reset). The S input sets the output to 1, while the R input resets the output to 0. When both S and R inputs are at 1, the latch is said to be in an “undefined” state. They are also known as preset and clear states. The SR latch forms the basic building blocks of all other types of flip-flops.

Truth Table of SR Latch

The below table represents the truth table of SR latch.

S

R

Q

Q’

0

0

Latch

Latch

0

1

0

1

1

0

1

0

1

1

0

0

Logic Diagram of SR Latch

SR Latch is a logic circuit with: 

  • 2 cross-coupled NOR gate or 2 cross-coupled NAND gate. 
  • 2 input S for SET and R for RESET
  • 2 output Q, Q’. 

The below logic diagram represents the SR latch using NAND gate.
 

SR latch using NAND gate

The below logic diagram represents SR latch using NOR Gate.

 SR latch using NOR Gate.

Different Cases of SR Latch

The different cases of SR latch are discussed below.

Case 1: S’ = R’ = 1 (S = R = 0)

If Q = 1, Q and R’ inputs for 2nd NAND gate are both 1. 

If Q = 0, Q and R’ inputs for 2nd NAND gate are 0 and 1 respectively. 

Case 1: S' = R' = 1 (S = R = 0)
Case 2: S’ = 0, R’ = 1 (S = 1, R = 0)

  • As S’ = 0, the output of 1st NAND gate, Q = 1 (SET state).
  • In second NAND gate, as Q and R’ inputs are 1, Q’=0. 

Case 2: S' = 0, R' = 1 (S = 1, R = 0)

Case 3: S’ = 1, R’ = 0 (S = 0, R = 1)

  • As R’=0, the output of 2nd NAND gate, Q’ = 1.
  • In first NAND gate, as Q and S’ inputs are 1, Q = 0 (RESET state). 

Case 3: S' = 1, R' = 0 (S = 0, R = 1)
Case 4: S’ = R’ = 0 (S = R = 1)  

When S = R = 1, both Q and Q’ becomes 1 which is not allowed. So, the input condition is prohibited. 

Gated SR Latch

A Gated SR latch is a SR latch with enable input which works when enable is 1 and retain the previous state when enable is 0. 

Truth Table of Gated SR Latch

The below table represents the truth table of Gated SR latch.

Enable

S

R

Qn+1

0

X

X

Qn

1

0

0

Qn

1

0

1

0

1

1

0

1

1

1

1

X

Logic Diagram of Gated SR Latch

The below logic diagram represents the gated SR latch.

Logic Diagram of Gated SR Latch

Logic Diagram of Gated SR Latch

D Latch

D latches are also known as transparent latches and are implemented using two inputs: D (Data) and a clock signal. The output of the latch follows the input at the D terminal as long as the clock signal is high. When the clock signal goes low, the output of the latch is stored and held until the next rising edge of the clock.

Truth Table of D Latch

The below table represents the truth table of D latch.

E

D

Q

Q’

0

0

Latch

Latch

0

1

Latch

Latch

1

0

0

1

1

1

1

0

Logic Diagram of D Latch

The below logic diagram represents the D latch.

Logic Diagram of D Latch

Logic Diagram of D Latch

Gated D Latch

D latch is similar to SR latch with some modifications made. Here, the inputs are complements of each other. The D latch stands for “data latch” as this latch stores single bit temporarily.

Truth Table of Gated D Latch

The below table represents the truth table of Gated D latch.

Enable D Qn Qn+1 STATE
1 0 x 0 RESET
1 1 x 1 SET
0 x x Q(n) No Change

Characteristics Equation: Qn+1 = EN.D + EN’.Qn 

Logic Diagram of Gated D Latch

The below logic diagram represents the gated D latch.

Logic Diagram of Gated D Latch

JK Latch

JK latch has two inputs J and K. The output gets toggled when the J and K inputs are high. JK latch is just like SR latch, but it eliminates the undefined state of SR latch.

Truth Table of JK Latch

The below table represents the truth table of JK latch.

J

K

Qn+1

Comment

0

0

Q

No change

0

1

0

Reset

1

0

1

Set

1

1

Q’

Toggle

Logic Diagram of JK Latch

The below logic diagram represents the JK latch.

Logic-Diagram-of-JK-Latch

Logic Diagram of JK Latch

T Latch

When the JK inputs of JK latch are shorted we get the T latch. In T latch the outputs are toggled when the inputs are high.

Logic Diagram of T Latch

The below logic diagram represents the T latch.

Logic-Diagram-of-T-Latch

Logic Diagram of T Latch

Advantages of Latches

Some of the advantages of latches are listed below.

  1. Easy to Implement: Latches are simple digital circuits that can be easily implemented using basic digital logic gates.
  2. Low Power Consumption: Latches consume less power compared to other sequential circuits such as flip-flops.
  3. High Speed: Latches can operate at high speeds, making them suitable for use in high-speed digital systems.
  4. Low Cost: Latches are inexpensive to manufacture and can be used in low-cost digital systems.
  5. Versatility: Latches can be used for various applications, such as data storage, control circuits, and flip-flop circuits.

Disadvantages of Latches

Some of the disadvantages of latches are listed below.

  1. No Clock: Latches do not have a clock signal to synchronize their operations, making their behavior unpredictable.
  2. Unstable State: Latches can sometimes enter into an unstable state when both inputs are at 1. This can result in unexpected behavior in the digital system.
  3. Complex Timing: The timing of latches can be complex and difficult to specify, making them less suitable for real-time control applications.

Conclusion

We can conclude that latches are the mostly used in digital circuits for various purposes. Latches changes its output quickly with respect to new input. Different kinds of latches include SR latch, gated latch, D latch, gated D latch, JK latch and T latch.

Reference

Here are a few books that you can refer to for further information on latches:

  1. “Digital Design: Principles and Practices” by John F. Wakerly
  2. “Digital Systems Design using VHDL” by Charles H. Roth and Lizy Kurian John
  3. “Digital Circuit Analysis and Design” by Victor P. Nelson and H. Troy Nagle
  4. “Digital Design and Computer Architecture” by David Harris and Sarah Harris
  5. “Fundamentals of Digital Logic with Verilog Design” by Stephen Brown and Zvonko Vranesic

These books provide a comprehensive overview of digital logic, including latches, and cover various topics, such as design and implementation, simulation, and verification of digital circuits.

DIGITAL ELECTRONICS – Atul P. Godse, Mrs. Deepali A. Godse

Latches – FAQs

What are the Types of Latches?

The types of latches include SR, gated SR, D, gated D, JK and T.

Where are Latches Used?

Latches are used in clocks as storage units.

How Many Bits Can a Latch Store?

A latch can store one-bit data.

Does Latch Have Memory?

Yes, latch is memory element with 1-bit storage.



Previous Article
Next Article

Similar Reads

Difference between Programmable Logic Array and Programming Array Logic
Programmable Logic Array (PLA) and Programming Array Logic (PAL) are the categories of programming logic devices. In PLA or Programmable Logic Array, there are massive functions can be implemented. Whereas in PAL or Programmable Array Logic, there is finite functions can be implemented. The distinction between PLA and PAL is that, PAL have programm
2 min read
Half Subtractor in Digital Logic
A half subtractor is a digital logic circuit that performs binary subtraction of two single-bit binary numbers. It has two inputs, A and B, and two outputs, DIFFERENCE and BORROW. The DIFFERENCE output is the difference between the two input bits, while the BORROW output indicates whether borrowing was necessary during the subtraction. The half sub
3 min read
Half Adder in Digital Logic
Introduction: A half adder is a digital logic circuit that performs binary addition of two single-bit binary numbers. It has two inputs, A and B, and two outputs, SUM and CARRY. The SUM output is the least significant bit (LSB) of the result, while the CARRY output is the most significant bit (MSB) of the result, indicating whether there was a carr
4 min read
Full Adder in Digital Logic
Full Adder is the adder that adds three inputs and produces two outputs. The first two inputs are A and B and the third input is an input carry as C-IN. The output carry is designated as C-OUT and the normal output is designated as S which is SUM. The C-OUT is also known as the majority 1's detector, whose output goes high when more than one input
4 min read
Full Subtractor in Digital Logic
A full subtractor is a combinational circuit that performs subtraction of two bits, one is minuend and other is subtrahend, taking into account borrow of the previous adjacent lower minuend bit. This circuit has three inputs and two outputs. The three inputs A, B and Bin, denote the minuend, subtrahend, and previous borrow, respectively. The two ou
3 min read
Encoder in Digital Logic
An encoder is a digital circuit that converts a set of binary inputs into a unique binary code. The binary code represents the position of the input and is used to identify the specific input that is active. Encoders are commonly used in digital systems to convert a parallel set of inputs into a serial code. The basic principle of an encoder is to
6 min read
BCD Adder in Digital Logic
BCD stands for binary coded decimal. It is used to perform the addition of BCD numbers. A BCD digit can have any of ten possible four-bit representations. Suppose, we have two 4-bit numbers A and B. The value of A and B can vary from 0(0000 in binary) to 9(1001 in binary) because we are considering decimal numbers. The output will vary from 0 to 18
2 min read
Magnitude Comparator in Digital Logic
A magnitude digital Comparator is a combinational circuit that compares two digital or binary numbers in order to find out whether one binary number is equal, less than, or greater than the other binary number. We logically design a circuit for which we will have two inputs one for A and the other for B and have three output terminals, one for A
6 min read
Shift Registers in Digital Logic
Pre-Requisite: Flip-Flops Flip flops can be used to store a single bit of binary data (1 or 0). However, in order to store multiple bits of data, we need multiple flip-flops. N flip flops are to be connected in order to store n bits of data. A Register is a device that is used to store such information. It is a group of flip-flops connected in seri
8 min read
Consensus Theorem in Digital Logic
Prerequisite - Properties of Boolean algebra, Minimization of Boolean Functions Redundancy theorem is used as a Boolean algebra trick in Digital Electronics. It is also known as Consensus Theorem: AB + A'C + BC = AB + A'C The consensus or resolvent of the terms AB and A'C is BC. It is the conjunction of all the unique literals of the terms, excludi
3 min read
Article Tags :