HDL & Verification
What is a characteristic of one-hot encoding for state machine states?
- AIt encodes states in binary to minimize flip-flops
- BAll flip-flops are always 1
- CIt uses one flip-flop per state with exactly one set at a time, so next-state and output logic tend to be simple and fast
Show answer and explanation
Answer: C. It uses one flip-flop per state with exactly one set at a time, so next-state and output logic tend to be simple and fast
One-hot encoding represents, say, four states as 0001, 0010, 0100 and 1000, assigning one flip-flop to each state. It needs more flip-flops, but checking whether the machine is in a state means looking at a single bit, so next-state and output logic is shallow and fast. It is common on flip-flop-rich FPGAs, while binary encoding is used when flip-flop count must be minimized.
- A. That is binary encoding.
- B. Exactly one is 1 at any time.
- C. Correct. It is popular on flip-flop-rich FPGAs.