Combinational logic 2026-10-25
A Boolean circuit whose current output depends only on its current input, with no stored state or feedback dependency. Its delay is bounded by the longest input-to-output path of logic gates. This differs from a synchronous sequential circuit, whose output can depend on state stored at earlier clock edges.
Logic gate 2026-10-25
A physical or idealized component implementing a fixed Boolean function on one or more input bits. For example, an AND gate outputs one exactly when both input bits are one. A Boolean circuit connects logic gates; circuit size counts components and circuit depth measures the longest chain of dependencies.
NAND gate 2026-10-25
A logic gate computing the logical negation of the logical conjunction of its inputs. Thus . It implements a logical disjunction of complemented inputs by De Morgan laws.
NOR gate 2026-10-25
NOT gate 2026-10-24
OR gate 2026-10-25
A logic gate computing inclusive logical disjunction: its output is one exactly when at least one input is one.
For bits , use two negation logic gates and two AND gates:The two unequal bit pairs activate their respective output; the equal pairs activate neither. In particular, a digital comparator never produces .
Split each input into its more and less significant -bit halves: and . Let the two digital comparators produce and . The more significant halves are equal exactly when . The comparator composition is thereforeImplement with a logical disjunction followed by a negation, then use two AND gates and two more logical disjunction logic gates. If , the difference has magnitude at least , whereas ; hence the more significant comparison decides the result. If , the lower comparison decides it. This proves correctness in every case using a constant number of extra logic gates.
Apply comparator composition recursively in a balanced binary tree, with one-bit digital comparators at its leaves. For a power of two , the circuit size and circuit depth satisfyThere are leaves and internal nodes, so the circuit size is and the combinational delay is . Here each fixed-fan-in logic gate has bounded delay. For arbitrary , pad both inputs with leading zero bits to the next power of two, which is less than ; this preserves their unsigned interpretation and both bounds.
Use a hierarchical leading-zero counter. A block of bits returns a zero flag and low count bits : its count leading zeros result is the concatenation . Thus means that the block is entirely zero and ; otherwise and is its leading-zero count. A one-bit block needs just and no low count bits.
For a block of bits, run two such Boolean circuits on the upper and lower halves in parallel. Write their flags as and their low count bits as . SetThe last expression is a two-input multiplexer. When the upper half is nonzero, its count is already the answer and . When only the upper half is zero, supplies the contribution while the multiplexers supply the lower half's count. When both halves are zero, the answer is , representing . This special encoding avoids an adder on the critical path.
Each node adds constant circuit depth, even though it uses logic gates for its parallel multiplexers. HenceIndeed the internal-node work is bounded by a constant times , and the leaves add . Delay is and size is , counting fixed-fan-in logic gates and the usual wire fan-out model.
Use a synchronous sequential circuit with four Moore machine states. is ready, is the one-cycle pulse state, is disabled with no qualifying final zero, and is disabled after one sampled zero. Reset into , so an initial sampled high generates a pulse immediately. The complete transition/output table is:
| State | Code | Next if | Next if | |
|---|---|---|---|---|
A particularly small implementation uses two D flip-flops with the next-state equationsBoth D flip-flops share the clock; their outputs feed the displayed logic gates. The output depends only on the stored state, not combinationally on the external input. At each edge, evaluate the right-hand sides using the old state and the sampled input, then update both flip-flops together. The resulting applies throughout the following clock period.
From , a high enters . The next edge always leaves , so the pulse lasts exactly one period. In the disabled states, a high leads to and erases progress towards rearming. A zero enters , and a second successive zero enters . A later high can then enter . This proves both the two-zero requirement and the startup exception. For example, sampled inputs yield outputs .
Original Moore-state design and clocked example for the two-zero rearming pulse detector. State and output are shown after each sampling edge.
Details. The construction is a synchronous pulse detector with two-zero rearming. Assume meets setup/hold requirements at the sampling edges. A genuinely asynchronous input would first require synchronization, with its associated latency; that is separate from this sampled-input specification.

