← All exercises

Voting Lamp

easy

2-of-3 majority voting for a lamp output.

What it teaches

Majority voting (2-of-3). The lamp turns on when any pair of buttons agrees — list the pairs that satisfy the vote and combine them with OR. Introduces n-of-m logic that recurs in safety and fault-tolerance patterns.

Inputs and outputs

TagTypeDefaultDescription
In_ButtonABOOLFirst push button
In_ButtonBBOOLSecond push button
In_ButtonCBOOLThird push button
Out_LampBOOLLamp drive signal

Required behavior