What a logic gate is

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

What a logic gate is

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A logic gate takes binary inputs and gives how many outputs?
A Two outputs
B One output
2. Which values can the input or output of a logic gate have?
A Only 0 or 1
B Any number from 0 to 9
3. Which statement describes a logic gate?
A A program that changes its rule each time it runs
B An electronic component that follows a fixed rule
4. The same inputs are given to a gate twice. What happens to the output?
A It is the same both times
B It may be different each time
5. How many inputs can a gate in the IGCSE 0478 course have?
A One or two
B Always exactly four

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1X = NOT A AA gate gives a single output, not two. It also takes only one or two inputs, not three.
2X = A AND B BGate inputs and outputs can only be binary values 0 or 1, so 2 and 3 are not valid.
3A logic gate takes binary inputs, which can only be 0 or 1, and gives one output that is also 0 or 1. C1 OR 0 = 1
4A gate follows a fixed rule, so the same inputs always give the same output. DA gate with two inputs A and B and one output X. The output is 1 only when both inputs are 1.
5A = 2, B = 1, X = 3 EA = 1, B = 0, X = 1
6A, B, C -> gate -> X, Y FA gate with one input A and one output X. The output is always the opposite binary value of the input.

Definitions

logic gate

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
X = A ___ B
2.
X = ___ A
3.
Inputs: A = 1, B = 0 Gate: AND Output: X = _
4.
A gate input can only be 0 or _
5.
Inputs: A and B Output: _ X = A OR B

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A GATE AND
B INPUT A = 1
C INPUT B = 0
D OUTPUT X = 2
Question 2
A GATE NOT
B INPUT A = 7
C OUTPUT X = 0
Question 3
A GATE OR
B INPUT A = 0
C INPUT B = yes
D OUTPUT X = 1
Question 4
A GATE NOT
B INPUT A = 0
C OUTPUT X = 1, Y = 0
Question 5
A PROCESSOR HAS ONE GATE
B EACH GATE: 1 OR 2 INPUTS
C EACH GATE: 1 OUTPUT

Answer Key

What a logic gate is
Section A: Quick Questions
Q1
B — One output
Q2
A — Only 0 or 1
Q3
B — An electronic component that follows a fixed rule
Q4
A — It is the same both times
Q5
A — One or two
Section B: Match the Pairs
Q1
X = NOT A → A gate with one input A and one output X. The output is always the opposite binary value of the input.
Q2
X = A AND B → A gate with two inputs A and B and one output X. The output is 1 only when both inputs are 1.
Q3
A logic gate takes binary inputs, which can only be 0 or 1, and gives one output that is also 0 or 1. → A = 1, B = 0, X = 1
Q4
A gate follows a fixed rule, so the same inputs always give the same output. → 1 OR 0 = 1
Q5
A = 2, B = 1, X = 3 → Gate inputs and outputs can only be binary values 0 or 1, so 2 and 3 are not valid.
Q6
A, B, C -> gate -> X, Y → A gate gives a single output, not two. It also takes only one or two inputs, not three.
Section C: Definitions
Q1
logic gate — An electronic component that takes one or two binary inputs (0 or 1) and gives one binary output (0 or 1) by a fixed rule. Processors are built from many gates.
Section D: Fill in the Blanks
Q1
X = A AND B
Q2
X = NOT A
Q3
Inputs: A = 1, B = 0 Gate: AND Output: X = 0
Q4
A gate input can only be 0 or 1
Q5
Inputs: A and B Output: X X = A OR B
Section E: Spot the Error
Q1
D — A logic gate's output can only be binary, 0 or 1. The value 2 is not allowed, so the line should be OUTPUT X = 0.
Q2
B — Gate inputs are binary, so they can only be 0 or 1. The line should be INPUT A = 1.
Q3
C — A gate input must be the binary digit 0 or 1, not a word. The line should be INPUT B = 1.
Q4
C — A logic gate produces a single output. It cannot give two outputs, so the line should be OUTPUT X = 1.
Q5
A — A processor is built from many logic gates working together, not just one. The line should say PROCESSOR HAS MANY GATES.