GoalUse OR and NOT gates, and combine two gates to make a logic circuit.
New words
OR gate · a gate whose output is 1 when at least one input is 1NOT gate · a gate with one input whose output is the opposite (also called an inverter)logic circuit · several gates joined so that the output of one is the input of anotherBoolean logic · rules that work with true and false values using AND, OR and NOT
Explanation
An OR gate has two inputs. It gives 1 if A is 1, or B is 1, or both are 1. It gives 0 only when both are 0. A NOT gate has just one input. It always gives the opposite: NOT 1 is 0 and NOT 0 is 1. You can join gates to make a logic circuit, with the output of one gate going into another. Then you work out the first gate and use its answer in the second gate. Boolean logic with AND, OR and NOT is behind every decision that a processor makes.
A
B
A or B
not A
1
1
1
0
1
0
1
0
0
1
1
1
0
0
0
1
Worked examples
A: alarm time
B: timer ended
Z: phone rings
0
0
0
0
1
1
1
0
1
1
1
1
A phone rings its alarm if the alarm time arrives (A) OR the timer ends (B). Either one is enough, and both together are fine.
A: daylight
Z: lamp on
1
0
0
1
A night light has a light sensor. In daylight the sensor input is 1. The lamp should be off in daylight and on in the dark, so it uses a NOT gate.
A
B
C
A OR B
Z = (A OR B) AND C
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
1
1
1
1
1
0
0
1
0
1
0
1
1
1
1
1
0
1
0
1
1
1
1
1
Here is a circuit with two gates. First the OR gate works out (A OR B). Then the AND gate combines this answer with C. A study lamp comes on if somebody is in the room (A) OR the button is pressed (B), AND the room is dark (C).
Class activity
Circuit by hand (no computer): copy the three-input table above, but leave the last two columns empty. Shuffle eight cards labelled with the eight rows. Your partner reads out the A, B and C values and you write the answer of the OR gate first and then the answer of the AND gate. Then change the circuit to (A AND B) OR C and work out the new column. Compare how the two circuits differ. If you have a computer or tablet, an adult can help you build the table in a spreadsheet.
Practice
1
A hall lamp comes on if the hall switch (A) OR the landing switch (B) is on. Cover the table at the top of the lesson and complete this truth table.
A
B
Z
0
0
?
0
1
?
1
0
?
1
1
?
0 OR 0 = 0, 0 OR 1 = 1, 1 OR 0 = 1, 1 OR 1 = 1. The lamp is off only when both switches are off.
2
A NOT gate has the input 0. What is the output? What is the output if the input is 1?
NOT 0 = 1 and NOT 1 = 0. A NOT gate always gives the opposite.
3
A fan comes on if the window is shut (A) OR the room is hot (B), AND it is NOT night (C = 1 means night). Work out Z = (A OR B) AND (NOT C) when A = 0, B = 1 and C = 1. Then for A = 1, B = 1 and C = 0.
A
B
C
A OR B
NOT C
Z
0
1
1
?
?
?
1
1
0
?
?
?
First case: A OR B = 1 and NOT C = 0, then 1 AND 0 = 0, so Z = 0 (it is night, so the fan stays off). Second case: A OR B = 1 and NOT C = 1, then 1 AND 1 = 1, so Z = 1.
4
A playground gate opens if the supervisor’s switch is on (A) AND a visitor is NOT carrying a bike (B = 1 means carrying one). Which two gates are used? Explain.
One NOT gate turns B into NOT B, then an AND gate combines A with NOT B. So the gate opens only if the switch is on and the visitor has no bike.