Understand and define the functions of: NOT, AND, OR, NAND, NOR and XOR (EOR) gates

Resources | Subject Notes | Computer Science

Logic Gates and Logic Circuits - A-Level Computer Science

Logic Gates and Logic Circuits

3.2 Logic Gates

This section details the fundamental logic gates used in digital circuits. Logic gates perform Boolean logic operations on one or more binary inputs to produce a single binary output.

NOT Gate

The NOT gate is a unary gate, meaning it has only one input. It inverts the input signal. If the input is 1 (high), the output is 0 (low), and vice versa.

Symbol:

Suggested diagram: A NOT gate symbol with an input and an output, and an inversion bubble on the output.

Truth Table:

Input (A) Output (Q)
0 1
1 0

Boolean Expression: $Q = \overline{A}$

AND Gate

The AND gate takes two or more inputs. Its output is 1 (high) only if all inputs are 1 (high). If any input is 0 (low), the output is 0 (low).

Symbol:

Suggested diagram: An AND gate symbol with two inputs and one output.

Truth Table:

Input A Input B Output (Q)
0 0 0
0 1 0
1 0 0
1 1 1

Boolean Expression: $Q = A \cdot B$ or $Q = A \land B$

OR Gate

The OR gate takes two or more inputs. Its output is 1 (high) if at least one input is 1 (high). The output is 0 (low) only if all inputs are 0 (low).

Symbol:

Suggested diagram: An OR gate symbol with two inputs and one output.

Truth Table:

Input A Input B Output (Q)
0 0 0
0 1 1
1 0 1
1 1 1

Boolean Expression: $Q = A + B$ or $Q = A \lor B$

NAND Gate

The NAND gate is the inverse of the AND gate. It takes two or more inputs and produces a 0 (low) output only if all inputs are 1 (high). Otherwise, the output is 1 (high).

Symbol:

Suggested diagram: A NAND gate symbol with two inputs and one output.

Truth Table:

Input A Input B Output (Q)
0 0 1
0 1 1
1 0 1
1 1 0

Boolean Expression: $Q = \overline{A \cdot B}$

NOR Gate

The NOR gate is the inverse of the OR gate. It takes two or more inputs and produces a 1 (high) output only if all inputs are 0 (low). Otherwise, the output is 0 (low).

Symbol:

Suggested diagram: A NOR gate symbol with two inputs and one output.

Truth Table:

Input A Input B Output (Q)
0 0 1
0 1 0
1 0 0
1 1 0

Boolean Expression: $Q = \overline{A + B}$ or $Q = A \overline{B}$

XOR Gate (Exclusive OR)

The XOR gate takes two inputs. Its output is 1 (high) if the inputs are different (one is 0 and the other is 1). The output is 0 (low) if the inputs are the same (both 0 or both 1).

Symbol:

Suggested diagram: An XOR gate symbol with two inputs and one output.

Truth Table:

Input A Input B Output (Q)
0 0 0
0 1 1
1 0 1
1 1 0

Boolean Expression: $Q = A \oplus B$ or $Q = A \land \overline{B}$ or $Q = \overline{A \land B}$

Logic Circuits

Logic gates are combined to create more complex logic circuits that perform various functions, such as arithmetic operations, memory operations, and control functions.

Examples of logic circuits include:

  • Half Adder: Adds two single-bit binary numbers.
  • Full Adder: Adds two single-bit binary numbers and a carry-in bit.
  • Multiplexer (MUX): Selects one of several input signals and forwards the selected signal to a single output line.
  • Decoder: Converts a binary code into a unique output signal.