Skip to main content

Logic circuit for a two-floor elevator

·1 min

What is the minimum number of ways to test a two-floor elevator with two buttons? One button is for floor 1 and the other button is for floor 2. We can assume that if both buttons are pressed simultaneously, the elevator will ignore the current floor button and go to the other floor. If we create a truth table we will see that there are 8 possible outcomes.

Current FloorFloor 1 ButtonFloor 2 ButtonNext Floor
0000
0011
0100
0111
1001
1011
1100
1110

Then we can create a Karnaugh map to express the next floor (N) variable in terms of the current floor (C) and the first and second floor buttons (F1 and F2).

F1'F2'F1'F2F1F2F1F2'
C'0110
C1100

This shows that the formula is N = C'F2 + CF1'.

F2CF1CN = C'F2 + CF1'