You are designing an elevator controller for a building with 25 floors. The controller has two inputs: UP and DOWN. It produces an output indicating the floor that the elevator is on. There is no floor 13. What is the minimum number of bits of state in the controller?
Answer: The system has at least five bits of state to represent the 24 floors that the elevator might be on.
Can someone explain how this comes to be?