Cambridge IGCSE Computer Science (0478) · lesson 34 of 35 · 30 min
Logic Gates
Logic gates are the fundamental building blocks of digital circuits. Each gate takes one or more binary inputs (0 or 1) and produces a binary output based on a Boolean function.
Truth Tables
Truth table for AND, OR, NOT, XOR
Combining Gates
Truth table for (A AND B) OR (NOT C)
What is the output of A AND B when A=1 and B=0?
- 1
- 0
- Undefined
- 2
Answer: 1
AND requires both inputs to be 1; since B=0, output is 0.
Which gate outputs 1 only when its inputs are different?
- AND
- OR
- XOR
- NAND
Answer: XOR
XOR (exclusive OR) outputs 1 when inputs differ.
How many rows does a truth table with 3 inputs have?
- 6
- 8
- 9
- 3
Answer: 8
2³ = 8 possible combinations of 3 binary inputs.
Previous lesson: File handling and exception handling
Back to Cambridge IGCSE Computer Science (0478)
Next lesson: Boolean expressions and simplification