Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

One-Hot and Binary Encoding

309 views
Skip to first unread message

Oh Sheau Pyng

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to
hi,
I have come across these two term One-Hot encoding and Binary Encode
for FSM, but I don't ready understand what do they mean. Can anyone pls
explained what is the meaning of One Hot and Binary Encoding, or kindy
point me to some books, website any other source that I can get the
answer.

thanks
Sheau Pyng


Stefan Doll

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to
Hi Sheau,

> I have come across these two term One-Hot encoding and Binary Encode
> for FSM, but I don't ready understand what do they mean.

It's just the method you use to represent states with bits.
Let's say you have a state machine with five states s0, s1, .., s4
The binary encoding could be:

s0: 000
s1: 001
s2: 010
s3: 011
s4: 100

(Just the binary number of the state)

For one-hot you have exactly one FF at '1' for each state eg:

s0: 00001
s1: 00010
s2: 00100
s3: 01000
s4: 10000


Apparently there is a certain likelyhood that one-hot produces less
output logic than binary encoding, so maybe some designers use it to
get faster clock to output timing without much effort.
It's not necessarily the case, though: if output 'y' has to be '1'
in state s2 and s3, the output logic for binary encoding is smaller
than for one-hot (a wire vs an OR gate).

In priciple it's possible to reduce the amount of transition and output
logic by choosing the state encoding carefully (e.g. encoding s3 as
"010" and s2 as "011" might have an advantage in some particular
state machine - maybe y2 needs to be '1' in s1 and s2). I would think
the effect is very minor in comparison with architecture-level
decisions, though.

I'd be interested to hear why designers prefer to use one method or the
other.

Cheers


Stefan


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Georg Diebel

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to
Oh Sheau Pyng wrote:
>
> hi,

> I have come across these two term One-Hot encoding and Binary Encode
> for FSM, but I don't ready understand what do they mean. Can anyone pls
> explained what is the meaning of One Hot and Binary Encoding, or kindy
> point me to some books, website any other source that I can get the
> answer.
>

One hot encoding: one and only one bit of the state vector is '1':
Example (four states): "0001", "0010", "0100", "1000"

Binary encoding: the states are represented by binary numbers.
Example (five states): "000", "001", "010", "011", "100".

One hot has larger state vectors (may be a problem if you have many
states) but the conditions for the branches are obviously very easy to
decode. It is well suited for LUT-based architectures where you don't
want to spend many lookup-tables only to check if a certain state is
active.

Hth,

Georg

--
All opinions expressed are mine, not my employers'.

Georg Diebel, Inst. for Integrated Circuits, Technical University of
Munich
Mailto:G_Di...@lis.e-technik.tu-muenchen.de
Phone: 0049-89-289-28578
Homepage: http://www.lis.e-technik.tu-muenchen.de/people/gd.html

0 new messages