The OR gate
Answers are for parents and teachers.
1
A cupboard lock opens with the red key or the blue key. Name the inputs and the output and write the truth table with rows in counting order.
Inputs: red key turned (A), blue key turned (B). Output: the lock opens (Y). Rows 00, 01, 10, 11 give 0, 1, 1, 1.
2
An OR gate has five inputs. How many rows has its truth table, and how many of them have the output 1?
32 rows (2⁵); 31 rows have the output 1, only 00000 has 0.
3
A pupil says: “When A = 1 and B = 1 an OR gate cancels itself and gives 0.” Correct the sentence.
OR gives 1 when at least one input is 1, and both being 1 is included. So the output is 1; in the formula 1 + 1 = 1.
4
Three switches are side by side: A is closed, B and C are open. Is the lamp lit? Why?
Yes. The path through A is complete, and one complete path is enough.
5
What does this PHP line print? echo 0 | 1, " ", 1 | 1, " ", 0 | 0;
1 1 0, the OR of each pair.