1. The Building Blocks: Basic Logic Gates
At the heart of every computer are millions of tiny electronic switches called logic gates. These are the fundamental building blocks of all digital circuits. A logic gate takes one or more binary inputs (represented as 0 for 'off' or 'low voltage', and 1 for 'on' or 'high voltage') and produces a single binary output. There are three fundamental gates you must know: AND, OR, and NOT. Each performs a simple logical function.
X = A AND B (Notation: A . B)
X = A OR B (Notation: A + B)
X = NOT A (Notation: ¬A or Ā)
Key term
Common pitfall
Worked example 13 marks
An AND gate has two inputs, A and B. Draw the symbol for the AND gate and complete its truth table. The output is labelled X.
- 1
Step 1: Draw the standard symbol for an AND gate. It looks like the letter 'D' with two input lines (A, B) on the flat side and one output line (X) on the curved side.
- 2
Step 2: Create a truth table with columns for A, B, and X. Since there are two inputs, there will be 2^2 = 4 rows for all possible input combinations.
- 3
Step 3: List the input combinations: 0 0, 0 1, 1 0, 1 1.
- 4
Step 4: For each row, calculate the output X. The rule for an AND gate is: the output is 1 ONLY IF both input A AND input B are 1. Otherwise, the output is 0.
- 5
Step 5: Complete the table: A=0, B=0 -> X=0; A=0, B=1 -> X=0; A=1, B=0 -> X=0; A=1, B=1 -> X=1.
Recap
- A logic gate is a component that controls the flow of electricity based on logical rules.
- The AND gate outputs 1 only if all its inputs are 1.
- The OR gate outputs 1 if at least one of its inputs is 1.
- The NOT gate is an inverter; it flips the input value (0 becomes 1, 1 becomes 0).
Quick check
- Draw the standard logic gate symbol for a two-input OR gate.1 mark
- What is the output of a NOT gate if the input is 1?1 mark