Physics › Electronics › Combinational logic
Combinational logic
Six gates are required: NOT, AND, OR, NAND, NOR and EOR. Since an output depends only on the present inputs, each one fits in a truth table. A digital signal crosses a long line because a repeater reads each pulse as 0 or 1 and issues a clean new one. EOR with AND is the half-adder.
Choose your exam board to show the notes and questions relevant to your specification. You can change this setting at any time, and content for other boards remains available.
Digital signal processing, part 1 of 2. Part 2 is Flip-flops, counters and clocks.
Builds on The ideal op-amp and the comparator and Summing and difference amplifiers.
IN THIS TOPIC
- Explain why digital signals resist noise, and what regeneration does that amplification cannot.
- Write the truth table of each of the six gates without hesitation.
- Turn a Boolean expression, or a specification in words, into a gate circuit, the half-adder included.
COMMON MISCONCEPTION
Digital signals survive long distances because they are transmitted at higher power.
Transmitted power is beside the point, and digital links usually use less of it. Two levels with a threshold between them leave a margin for noise, and a repeater regenerates each pulse as a new clean one, throwing the accumulated noise away.
Why two levels resist noise
An analogue signal carries its information in its exact shape, and that is its weakness. Every metre of cable adds a little random noise, and once noise is mixed in no circuit can tell it from signal. Amplifying a tired analogue signal amplifies the noise with it, so each leg of a long link leaves the signal permanently worse.
A digital signal gives up the shape entirely. Only two levels mean anything, logic 0 near 0 V and logic 1 near the supply voltage, and the receiver makes one crude test: is the level above the threshold or below it? Noise that would wreck an analogue waveform leaves a 1 still recognisably a 1. There is a genuine margin for error, and small noise sits inside it.
Describe the drawing
Three traces one above the other. The sent signal is a crisp eight-bit square wave; the received signal is smaller, sagging and rippling with noise, with amber dots marking the instant each bit is sampled against a dashed threshold; the regenerated signal below is a full-height square wave carrying exactly the original bits, the noise thrown away rather than amplified.
Better still, a digital signal can be regenerated. A repeater partway along the route reads each incoming pulse as 0 or 1, then issues a brand-new, full-height pulse at the nominal levels. It does not amplify the old signal; it replaces it, and the noise collected so far is discarded. While every sample still falls on the correct side of the threshold the message crosses a continent unchanged; if noise or timing error exceeds the margin before the next repeater, bits are misread, which is why repeaters are spaced to stay well inside it.
The six gates
The circuits that act on logic levels are gates. A gate's output depends only on its present inputs, so the whole behaviour fits in a truth table, one row per input combination. The simplest is NOT, one input, one output, always the opposite: input 0 gives 1, input 1 gives 0. The remaining five take two inputs, so their tables have four rows:
| A | B | AND | OR | NAND | NOR | EOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
Three of these are worth learning as sentences. AND outputs 1 only when both inputs are 1. OR outputs 1 when at least one input is 1. EOR, exclusive-OR, outputs 1 when the inputs differ, and that last row is the one that separates it from OR. NAND and NOR are simply AND and OR with the answer inverted, drawn with a small circle on the output, and each of them alone can be wired up to build every other gate.
Combinational design is reading Boolean sentences in both directions. A specification in words becomes an expression, the expression becomes gates. The habit worth building is to write the full truth table, every input combination in binary counting order, because it brings out the cases you did not think about.
WORKED EXAMPLE
Reading a Boolean sentence
A machine may run (Q = 1) only when the guard is closed (G = 1) and either the two-hand switch is pressed (T = 1) or a supervisor override is on (S = 1). Write the expression, name the gates, and evaluate Q for G = 1, T = 0, S = 1.
The sentence translates directly: Q = G AND (T OR S). One OR gate feeds one AND gate.
With T = 0 and S = 1 the OR gives 1; with G = 1 the AND gives Q = 1, and the machine may run.
Check the effect of the guard input in the table. Whenever G = 0 the AND cannot output 1, whatever the other switches are set to. The expression enforces the safety rule structurally.
The half-adder
Binary arithmetic in one column is small enough to build by inspection. Adding bits A and B gives 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10, which is the number two, written as sum 0 carry 1. Compare the two output columns. The sum is 1 exactly when the inputs differ, and the carry is 1 exactly when both inputs are 1. Those are tables you already know.
So a half-adder is one EOR gate for the sum and one AND gate for the carry, wired to the same pair of inputs. It is the standard exam example of combinational design, a truth table recognised as a pair of known gates. Chain half-adders with provision for an incoming carry and you have the adder at the heart of every processor.
GUIDED PRACTICE
One plus one, in gates
Trace the half-adder for A = 1, B = 1, then for A = 1, B = 0, and read each result as a binary number.
Show the working
A = 1, B = 1: the inputs match, so EOR gives S = 0; both are 1, so AND gives C = 1. Read carry then sum, the answer is 10, the number two.
A = 1, B = 0: the inputs differ, so S = 1; AND gives C = 0. The answer is 01, the number one.
Both agree with ordinary arithmetic: the gate pair performs binary addition in one column.
Memory, and counting by halving has moved to the next part of this lesson.
Counters that stop where you want them to has moved to the next part of this lesson.
The astable, which supplies the clock has moved to the next part of this lesson.
ASSESSMENT FOCUS
- The regeneration argument is a contrast, so give both halves. An amplifier boosts signal and accumulated noise together; a regenerator reads each pulse as 0 or 1 and issues a new clean pulse, discarding the noise.
- Write truth tables with the inputs counting in binary order, 00, 01, 10, 11. Give every row: a missing row leaves the gate's output undefined for that input combination.
- Define EOR in one sentence: output 1 when the inputs differ. The row that catches people is 1, 1, where OR gives 1 and EOR gives 0.
- Half-adder answers must name both gates and both outputs. Sum from EOR, carry from AND, one pair of shared inputs.
CHECK YOURSELF
A logic system uses 0 V for logic 0 and 5.0 V for logic 1, with a decision threshold at 2.5 V. Write the EOR truth table, and give the half-adder's sum and carry for A = 1, B = 1. Then, for a machine that may run (Q = 1) only when a guard is closed (G = 1) and either a start switch (T = 1) or an override (S = 1) is on, write the Boolean expression and evaluate Q for G = 1, T = 0, S = 1. Finally, a logic-1 pulse sent at 4.6 V arrives with 1.9 V of noise subtracted from it: give the received voltage and say whether it is still read as 1.
Show a hint
EOR is 1 when the inputs differ, and the half-adder is one EOR and one AND on the same inputs. Read the sentence straight into gates. Compare the arriving voltage with the 2.5 V threshold.
Show the answer
EOR outputs 1 only when the inputs differ: 0,0 give 0; 0,1 give 1; 1,0 give 1; 1,1 give 0. For A = 1, B = 1 the half-adder gives sum = A EOR B = 0 and carry = A AND B = 1, the binary answer 10, which is two.
The sentence is Q = G AND (T OR S): one OR gate feeding one AND gate.
With T = 0 and S = 1 the OR gives 1; with G = 1 the AND then gives Q = 1, so the machine may run.
The pulse arrives at 4.6 − 1.9 = 2.7 V, still above the 2.5 V threshold, so it is read correctly as 1. The margin absorbed the noise, which is the whole reason for working in two levels.
A logic gate's output depends only on its present inputs, so its whole behaviour fits in a truth table.
EOR answers 1 when the inputs differ, and EOR with AND is the half-adder; NAND and NOR are AND and OR with the answer flipped.
WORKBOOK
Printable practice for this topic: original exam-style questions with room to work, and a fully worked answer book. Free to use; please do not redistribute or sell.
Or read them with their mark schemes on the combinational logic questions page.
USED LATER IN
CHECK YOUR PROGRESS
Rate how confident you feel with each objective for this lesson. Ratings are saved in this browser, on this device, unless you sign in.
- Explain why digital signals resist noise, and what regeneration does that amplification cannot.
- Write the truth table of each of the six gates without hesitation.
- Turn a Boolean expression, or a specification in words, into a gate circuit, the half-adder included.
Open the full revision checklist to track your progress across the whole unit.
