Boolean Logic and Logic Gates: Question 7
Syllabus 10.1, 10.2, 10.3
SecureHome fits a two-sensor alarm to a garden shed. A window-vibration sensor produces input W (W = 1 if vibration is detected on the window, 0 otherwise). A door-contact sensor produces input D (D = 1 if the door contact is broken, 0 otherwise). The alarm sounds and output signal A = 1 if either sensor is triggered, or both are triggered together, and A = 0 only when neither sensor is triggered.
(a) State the name of the single logic gate that combines inputs W and D to produce this behaviour. [1]
(b) Complete the truth table for the alarm output A. [2]
| W | D | A |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
(c) One night, a sheet of cardboard leaning against the inside of the shed accidentally covers the window sensor, so it can never report vibration and is stuck permanently at W = 0. Later that night someone forces the shed door open, so D = 1. Using your completed truth table, explain whether the alarm still sounds in this situation. [2]
Show worked solution Hide worked solution
Worked solution
Part (a): Naming the gate
The alarm output A must be 1 whenever at least one of the two sensors is triggered, the window sensor alone, the door sensor alone, or both together. A gate whose output is 1 whenever at least one input is 1 is an OR gate, so A = W OR D.
Part (b): Completing the truth table
An OR gate outputs 0 only for the single row where both inputs are 0, and 1 for every other combination:
| W | D | A |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
- (0, 0): neither sensor is triggered, so A = 0.
- (0, 1): the door sensor is triggered on its own, which is enough, so A = 1.
- (1, 0): the window sensor is triggered on its own, which is enough, so A = 1.
- (1, 1): both sensors are triggered, so A = 1.
Part (c): Applying the truth table to a real case
The situation described is W = 0 (window sensor disabled by the cardboard) and D = 1 (door contact broken). Looking up row (W = 0, D = 1) in the completed truth table gives A = 1.
So the alarm does still sound, even though the window sensor is completely out of action, because OR only needs one of its two inputs to be 1, and the working door sensor is sufficient on its own to trigger the alarm.
Final answers
- (a) OR gate, so A = W OR D
- (b) A values in row order: 0, 1, 1, 1
- (c) The alarm still sounds (A = 1), because D = 1 alone satisfies the OR condition regardless of the disabled window sensor.