Combinational logic (A-level only)

AQA·Physics·3.13.5.1

Logic gate types

A logic gate takes one or more binary inputs and produces a binary output. Each input and output can have one of two values: $$0$$ or $$1$$. The type of gate determines which output is produced for a given set of inputs.

A truth table shows the output for every possible combination of inputs. A NOT gate has one input and reverses it: an input of $$0$$ gives an output of $$1$$, while an input of $$1$$ gives an output of $$0$$.

Two-input logic gates

  • AND gives $$1$$ only when both inputs are $$1$$.
  • OR gives $$1$$ when either input is $$1$$, including when both are $$1$$.
  • NAND gives the inverse of the AND output: it gives $$0$$ only when both inputs are $$1$$.
  • NOR gives the inverse of the OR output: it gives $$1$$ only when both inputs are $$0$$.
  • Exclusive OR, written EOR or XOR, gives $$1$$ when the inputs differ and $$0$$ when they are the same.

The table shows all four possible combinations for two inputs, $$A$$ and $$B$$.

Input A

Input 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

Notice the difference between OR and EOR when both inputs are $$1$$: OR gives $$1$$, but EOR gives $$0$$ because the inputs are the same.

Logic gate symbols

Circuit diagrams use different outlines to identify gate types. An AND gate has a flat input side and a rounded output side. An OR gate has a curved input side and sides that meet at a pointed output. An EOR gate resembles an OR gate but has an extra curved line on the input side.

A small inversion circle at the output indicates that the output is reversed. A NOT gate is drawn as a triangle with an inversion circle at its output. Similarly, a NAND symbol is an AND symbol with an output inversion circle, and a NOR symbol is an OR symbol with an output inversion circle.

Analysis of combinational logic circuits

A combinational logic circuit connects logic gates so that its output is determined by its present input values. To analyse the circuit, follow each connection from the inputs to the final output, finding what each gate produces along the way.

The same analysis can use binary values or a Boolean expression. The binary values are $$0$$ and $$1$$. In an expression:

  • $$\overline{A}$$ means NOT $$A$$: it changes $$0$$ to $$1$$ and $$1$$ to $$0$$.
  • $$A \cdot B$$ means $$A$$ AND $$B$$: it is $$1$$ only when both inputs are $$1$$.
  • $$A+B$$ means $$A$$ OR $$B$$: it is $$1$$ when either input or both inputs are $$1$$.

The plus sign means logical OR, not ordinary addition: for example, $$1+1=1$$ in Boolean logic. Brackets and overbars show which operations are grouped. In $$\overline{A+B}$$, the overbar applies to the result of the whole OR operation, not just to $$A$$.

Following signals through a circuit

Consider a circuit with two inputs, $$A$$ and $$B$$. Input $$A$$ passes through a NOT gate. Its output and $$B$$ then enter an AND gate. Finally, the AND output and the original $$A$$ enter an OR gate.

Following those connections gives the final output $$Y$$:

Y=(A‾⋅B)+AY=(\overline{A}\cdot B)+A

The expression records the gate operations in order: first find $$\overline{A}$$, then AND it with $$B$$, and finally OR that result with $$A$$. For instance, when $$A=0$$ and $$B=1$$, the NOT output is $$1$$, the AND output is $$1$$, and the final OR output is $$1$$.

Constructing the circuit’s truth table

A truth table lists every possible combination of input values and the corresponding final output. Intermediate columns make it easier to follow the gates. Here, $$C=\overline{A}$$ and $$D=C\cdot B$$, so $$Y=D+A$$.

Inputs A, B

NOT output C

AND output D

Final output Y

0, 0

1

0

0

0, 1

1

1

1

1, 0

0

0

1

1, 1

0

0

1

A truth table can also be constructed directly from a Boolean expression. Substitute each input combination into the expression, evaluate its grouped operations, and record the final value for each row.

Constructing logic circuits from truth tables

A truth table shows the output a circuit must produce for every combination of its inputs. To construct a circuit, focus on the rows where the required output is $$1$$. Build a condition that is true for each of those rows, then combine the conditions so that the circuit outputs $$1$$ when any of them is true.

Constructing a condition for each row

For a particular row, every input must have the value shown in that row. Write an input directly if it must be $$1$$, and invert it if it must be $$0$$. Join these requirements with AND.

For example, if input $$A$$ must be $$0$$ and input $$B$$ must be $$1$$, the row condition is $$\overline{A}B$$. The bar means NOT, and writing the terms together means AND. This condition is $$1$$ only when $$A=0$$ and $$B=1$$.

Combining the row conditions

Consider a circuit with inputs $$A$$ and $$B$$ and the following required output $$Y$$:

A

B

Y

0

0

0

0

1

1

1

0

1

1

1

0

The output must be $$1$$ for two input combinations. Their conditions are $$\overline{A}B$$ for $$A=0, B=1$$ and $$A\overline{B}$$ for $$A=1, B=0$$. Joining them with OR, written as $$+$$, gives:

Y=A‾B+AB‾Y = \overline{A}B + A\overline{B}

The output is therefore $$1$$ if either row condition is true. If a truth table has no rows requiring an output of $$1$$, the required output is always $$0$$.

Implementing and checking the circuit

For the expression above, use NOT gates to provide $$\overline{A}$$ and $$\overline{B}$$. Feed $$\overline{A}$$ and $$B$$ into one AND gate, and $$A$$ and $$\overline{B}$$ into another. Connect the two AND outputs to an OR gate; its output is $$Y$$.

Check the circuit by evaluating it for every input combination. In the table’s order, the circuit gives outputs $$0, 1, 1, 0$$, matching the required outputs. Checking only the rows where the output should be $$1$$ is not enough: the circuit must also produce $$0$$ on the other rows.

Different combinations of gates can produce the same outputs for every input combination. A circuit that matches the truth table is therefore valid, but it is not necessarily the only valid circuit.

Combinational logic (A-level only) | AQA A-level Physics (7408) Revision Notes | KnowledgeSet