What is One-Hot?


Each state in a state machine needs to be encoded by a unique bit pattern. A one-hot encoding uses as many bits to encode a particular state as there are possible states for the machine. Only one bit is "hot" (1) for each of these encodings; the others are cold (0). For example, suppose a machine has four states. With the one-hot method, the encoding of these states will be: 0001, 0010, 0100 and 1000.

In contrast, the conventional binary method allows encoding in fewer bits. For example, the same states could be encoded as 00, 01, 10 and 11. Although at first glance, binary might seem better, but its drawback is that the hardware has to look at all the bits to figure out what the state is. The hardware to do that is often much bigger than the hardware (flip-flops) that store the bits. The one-hot method has the advantage that there is a one-to-one mapping between bits and states, often resulting in increased speed. VITO uses the one-hot method to simplify its operation. Read more about one-hot encoding