CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Sequential Logic

D Latch: Asynchronous Preset and Clear Inputs

MediumLogic CircuitBuild

Standard logic families like the 74xx series require reliable initialization states upon power-up or during system reset. Asynchronous preset and clear signals override the normal data path to force the latch into a known state instantly.

Construct a D latch with active-low preset (PRE_bar) and clear (CLR_bar) inputs. When both asynchronous controls are high, the circuit operates as a standard transparent latch controlled by EN and D. When PRE_bar is low, the output Q is forced to 1. When CLR_bar is low, the output Q is forced to 0. These overrides must function regardless of the state of EN or D.

| PRE_bar | CLR_bar | EN | D | Q | Q_bar | |-----------|-----------|------|-----|-----|---------| | 0 | 1 | X | X | 1 | 0 | | 1 | 0 | X | X | 0 | 1 | | 1 | 1 | 1 | 0 | 0 | 1 | | 1 | 1 | 1 | 1 | 1 | 0 | | 1 | 1 | 0 | X | Q | Q_bar |

Constraints

  • Implement using only basic logic gates (NAND, NOR, AND, OR, NOT).
  • Do not use pre-built latch or flip-flop primitives.
  • The preset and clear functions must be strictly asynchronous.

Topics

LatchesSequential LogicAsynchronous Control

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • 3-bit Ripple Counter from Toggle Flip-FlopsEasy
  • D Latch from a 2:1 MUXEasy
  • 2-bit Ring CounterEasy
  • T Flip-Flop from a D Flip-FlopEasy
  • Handshake Deadlock Due to Early ResetHard
  • Reconvergence of Individually Synchronized BitsHard
  • Debug: Asynchronous Clear GlitchHard
  • Clock Gate Enable Crossing DomainsHard

Browse all problems · Learning tracks