Explain the difference between a latch, a gated latch and a flip flop

a) (5 marks) Explain the difference between a latch, a gated latch and a flip flop. b) (5 marks) A gated SR latch has the following schematic diagram CLK a) Draw a timing diagram showing the Q and Q outputs for the following sequence of inputs: CLK R Assume that the initial state of the outputs is Q 0 and Q 1 c) (5 marks) Draw a schematic diagram for a rising edge-triggered master-slave D flip- flop built using two gated RS latches and any other necessary logic gates. Hint: the other necessary logic gates will likely be 3 inverters. d) (5 marks) The D input of a D flip flop has minimum set-up and hold time constraints with respect to its active clock edge. When connecting asynchronous signals to a D 2 of 5 flip flop these constraints will not always be met. Why is this a problem and what can be done about it? e) (5 marks) Draw a schematic diagram of a 3-bit synchronous binary counter with a synchronous reset but no enable input. The circuit should have a clock input “clk” reset input “rst”, and a 3 bit output q2, q1 & q0. The counter should be positive edge-triggered and built entirely from D flip-flops and logic gates. Assume that your flip flops have a synchronous reset input.

The correct answer and explanation is:

a) Difference between Latch, Gated Latch, and Flip Flop

Latch: A latch is a level-sensitive memory element that stores data based on the level of its control signal. It is transparent, meaning that when the control signal (often called “enable” or “clock”) is active, the output reflects the input. When the control signal is inactive, the latch “latches” or retains its previous state.

Gated Latch: A gated latch is a type of latch that includes an additional control signal (e.g., “gate” or “enable”) to control whether the input is passed to the output. Unlike a basic latch that only depends on the level of the input, the gated latch can be enabled or disabled based on the gate signal, making it more controlled.

Flip Flop: A flip flop is an edge-sensitive memory element. Unlike a latch, a flip flop changes its state on specific transitions of the clock signal (rising or falling edge). Flip flops are used for synchronization in digital circuits, as they only respond to the clock edge, making them less susceptible to noise and glitches than latches.

b) Timing Diagram of Gated SR Latch

For the timing diagram with a Gated SR latch:

  • Initial state: Q = 0 and Q’ = 1.
  • When CLK = 1 and R = 1, Q will be reset to 0.
  • When CLK = 1 and S = 1, Q will be set to 1.
  • When CLK = 0, the latch will maintain its current state regardless of the S and R inputs.

Explanation of the behavior:

  1. When the clock is high (CLK = 1), the outputs of the latch follow the inputs.
  2. When the clock is low (CLK = 0), the latch retains its previous state (Q and Q’ will stay the same).

c) Schematic Diagram for Rising Edge-Triggered Master-Slave D Flip-Flop

A rising edge-triggered master-slave D flip-flop can be built using two gated SR latches. Here’s the construction:

  1. Master Latch: The master latch is connected to the D input and the clock (CLK) through an inverter. It stores the value of D on the rising edge of the clock.
  2. Slave Latch: The slave latch is connected to the output of the master latch. The slave latch receives the inverted clock (CLK’), and it stores the output of the master latch only on the rising edge of the clock.

Components:

  • Two SR latches.
  • Three inverters (one to invert the clock for the slave and one for the master).
  • The D input is connected to the input of the master latch.

Explanation:

  • On the rising edge of the clock, the master latch stores the value of the D input, while the slave latch changes its output only after the clock transition, ensuring edge-triggered behavior.

d) Minimum Set-up and Hold Time Constraints

Problem with Asynchronous Inputs: Asynchronous signals, which are not synchronized with the clock, may violate the setup and hold time constraints of a D flip-flop. If the input signal changes too close to the clock edge, it might cause the flip-flop to register an incorrect state.

Solution:

  • To avoid this, a synchronizer circuit can be used. This typically involves using a series of flip-flops to synchronize the asynchronous signal with the clock before it reaches the D flip-flop.
  • Another approach is to use a clocked input buffer or a clock domain crossing circuit to ensure that the signal remains stable during the setup and hold time window.

e) 3-Bit Synchronous Binary Counter with Synchronous Reset

A 3-bit synchronous binary counter can be constructed using D flip-flops as follows:

  1. Inputs: Clock input (clk), Reset input (rst).
  2. Outputs: q2, q1, q0 (3-bit output).

Circuit Design:

  • Use 3 D flip-flops, one for each bit of the counter (q2, q1, q0).
  • The output of each flip-flop is connected to the D input of the next flip-flop to create the counting sequence.
  • The reset input is connected to the synchronous reset of each flip-flop to reset the counter to zero.
  • The clock signal is shared among all the flip-flops.

Explanation:

  • On the rising edge of the clock, the flip-flops update their states in a binary counting sequence.
  • The reset input forces all flip-flops to zero when activated, and the counter begins counting from zero again.
Scroll to Top