1. Logic Gates and Truth Tables
At the heart of every computer are millions of tiny electronic switches called logic gates. These gates process binary information, which only has two states: 1 (True, or ON) and 0 (False, or OFF). A logic gate takes one or more binary inputs and produces a single binary output based on a specific rule. We use a truth table to show every possible combination of inputs and the resulting output for a gate. The three most fundamental gates are NOT, AND, and OR.
X = NOT A (also written as X = Ā)
X = A AND B (also written as X = A.B)
X = A OR B (also written as X = A + B)
Key term
Examiner insight
Fun fact
Worked example 16 marks
Complete the truth tables for a NOT gate, a 2-input AND gate, and a 2-input OR gate.
- 1
Step 1: For the NOT gate, the output is the opposite of the single input. If A is 0, X is 1. If A is 1, X is 0.
- 2
NOT Gate Truth Table:
A X 0 1 1 0 - 3
Step 2: For the AND gate, the output is 1 only if BOTH inputs A AND B are 1. Otherwise, the output is 0.
- 4
AND Gate Truth Table:
A B X 0 0 0 0 1 0 1 0 0 1 1 1 - 5
Step 3: For the OR gate, the output is 1 if EITHER input A OR B (or both) is 1. It is only 0 if both inputs are 0.
- 6
OR Gate Truth Table:
A B X 0 0 0 0 1 1 1 0 1 1 1 1
Recap
- Logic gates are the basic building blocks of digital circuits.
- A NOT gate inverts its single input.
- An AND gate outputs 1 only when all its inputs are 1.
- An OR gate outputs 1 if at least one of its inputs is 1.
- A truth table lists all possible input-output combinations.
- Binary values are 1 (True/ON) and 0 (False/OFF).
Quick check
- What is the output of a 2-input AND gate if the inputs are 1 and 0?1 mark
- Draw the standard logic symbol for a 2-input OR gate.1 mark