A railway crossing has 4 railway tracks. If a train comes on at least 1 of the…
2021
A railway crossing has 4 railway tracks. If a train comes on at least 1 of the tracks, the crossing has to be closed. Which gate can be used to implement this?
Answer: C. OR — In digital electronics, logic circuits are analysed using positive (active-high) logic by default: logic 1 represents the asserted/true state of a signal and…
- A.
NAND
- B.
NOR
- C.
OR
- D.
AND
Attempted by 1176 students.
Show answer & explanation
Correct answer: C
In digital electronics, logic circuits are analysed using positive (active-high) logic by default: logic 1 represents the asserted/true state of a signal and logic 0 represents its false/absent state, unless a problem explicitly states an active-low convention. Under this standard convention, an OR gate's output is HIGH (1) if at least one of its inputs is HIGH (1), and LOW (0) only when every input is LOW (0) -- exactly the 'if ANY one condition is true, assert the output' behaviour, expressed as Y = A + B + C + ...
Applying this to the railway crossing:
Model each track as an input variable A, B, C, D, where the variable equals 1 when a train is detected on that track (train present = asserted condition = logic 1) and 0 otherwise.
The requirement is: the crossing must be closed (output Y = 1) if a train is present on at least one of the four tracks.
"At least one input is 1, therefore output is 1" is exactly the truth-table behaviour of the OR gate.
Boolean Expression: Y = A + B + C + D.
Cross-check by testing edge cases and contrasting with the other gates:
No train anywhere (A = B = C = D = 0): the OR gate gives Y = 0, so the crossing stays open -- matching the requirement that it should close only when needed.
NOR gate: would give Y = 0 as soon as any single track has a train (the opposite of what is needed), and Y = 1 only when all tracks are empty. This would only match the requirement under an unstated active-low convention where logic 0 explicitly means "closed" -- which the question does not state, so NOR does not fit here.
AND gate: outputs 1 only when every track has a train simultaneously, so the crossing would stay open even with a train present on just one track -- this fails the "at least one" requirement.
NAND gate: the complement of AND, so it outputs 1 for every combination except one -- when all four tracks are simultaneously occupied. This means it wrongly outputs 1 (implying the crossing should close) even when no train is present anywhere, and wrongly outputs 0 (implying the crossing should open) on the one combination where every track has a train -- neither edge case matches the required behaviour.
Therefore, the correct gate is the OR gate, with Y = A + B + C + D.