Week 11 · Unit 2 Topic 4: the OR gate: parallel switches, symbol, number of forms, truth table, Boolean formula · 3 lessons
3
AND or OR? Telling the two gates apart
ICT Secondary 3 Term 1, Unit 2, Topic 4: pp. 40–47
GoalCompare AND and OR, count their 1s, and decide which gate fits a rule.
New words
all inputs 1 · the only way to get 1 from an AND gateat least one input 1 · enough to get 1 from an OR gatesignal word · a word in a rule that shows the gate: and, both, all for AND; or, either, any for ORexactly one · one input is 1 and the other is 0; this is neither AND nor OR (Week 14)
Explanation
Put the two truth tables side by side. AND gives 1 only when every input is 1. OR gives 1 when at least one input is 1. For two inputs AND has one row with the output 1 (the row 11) and three rows with 0, while OR has three rows with 1 and only one row with 0 (the row 00). For three inputs AND has one row with 1 out of eight, and OR has seven. For four inputs the numbers are 1 and 15. To choose a gate for a rule, look for the signal word. The words and, both and all point to AND. The words or, either and any point to OR. Take care: in everyday speech “or” sometimes means exactly one, as in “tea or coffee”, where nobody takes both. That rule is neither AND nor OR, and Week 14 gives it a name. A Venn picture helps: the lamp of an OR gate is lit in every part that belongs to A, to B or to both. The lamp of an AND gate is lit only in the part where the two circles overlap.
A
B
A∧B
A∨B
0
0
0
0
0
1
0
1
1
0
0
1
1
1
1
1
Worked examples
The four states of two inputs. The OR lamp is lit in three of them, the AND lamp in one.
Rule
Gate
The vault opens if the key is turned and the code is right.
AND
The sprinkler starts if the timer says so or the button is pressed.
OR
The ride starts if the rider is tall enough and the belt is fastened.
AND
The hall lights come on if the front sensor or the back sensor sees movement.
OR
Four invented rules and their gates. The signal word is in the rule.
Inputs
Rows
Rows with 1 in AND
Rows with 1 in OR
2
4
1
3
3
8
1
7
4
16
1
15
How many rows give 1 as the number of inputs grows.
Class activity
Write four rules from a school day (invent them, with no real names). For each rule underline the signal word and say AND or OR. Then rewrite one AND rule so that it becomes an OR rule, and say how the number of lit rows changes.
Practice
1
How many rows of a three-input OR gate have the output 1?
Seven of the eight rows.
2
Which gate has only one row with the output 1 among its four rows?
The AND gate.
3
A gate has the output 0 only for the row 00. Which gate is it?
The OR gate.
4
In “the alarm sounds if the door or the window opens”, which word shows the gate?