PPT Slide
7 – Sequential Logic Examples
Encodings for combination lock
Encode state table
- state can be: S1, S2, S3, OPEN, or ERR
- needs at least 3 bits to encode: 000, 001, 010, 011, 100
- and as many as 5: 00001, 00010, 00100, 01000, 10000
- choose 4 bits: 0001, 0010, 0100, 1000, 0000
- output mux can be: C1, C2, or C3
- needs 2 to 3 bits to encode
- choose 3 bits: 001, 010, 100
- output open/closed can be: open or closed
- needs 1 or 2 bits to encode
- choose 1 bit: 1, 0
mux is identical to last 3 bits of stateopen/closed is identical to first bit of state
therefore, we do not even need to implement FFs to hold state, just use outputs