# 1-of-N Coding System

Jump to navigation
Jump to search

A 1-of-N Coding System is a constant-weight coding that is a binary system.

**AKA:**One-Hot Coding.- …

**Example(s):**

Binary | Gray code | One-hot/1-of-N |
---|---|---|

000 | 000 | 00000001 |

001 | 001 | 00000010 |

010 | 011 | 00000100 |

011 | 010 | 00001000 |

100 | 110 | 00010000 |

101 | 111 | 00100000 |

110 | 101 | 01000000 |

111 | 100 | 10000000 |

**Counter-Example(s):****See:**Address Decoder, Dual Rail Encoding, Biphase Mark Code, Pulse-Position Modulation.

## References

### 2015

- (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/One-hot Retrieved:2015-2-18.
- In digital circuits,
**one-hot**refers to a group of bits among which the legal combinations of values are only those with a single high (1) bit and all the others low (0).A similar implementation in which all bits are '1' except one '0' is sometimes called one-cold.

- In digital circuits,

- (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/Constant-weight_code#1_of_N_codes Retrieved:2015-2-18.
- A special case of constant weight codes are the one-of-N codes, that encode [math]\displaystyle{ log_2 N }[/math] bits in a code-word of [math]\displaystyle{ N }[/math] bits. The one-of-two code uses the code words 01 and 10 to encode the bits '0' and '1'. A one-of-four code can use the words 0001, 0010, 0100, 1000 in order to encode two bits 00, 01, 10, and 11. An example is dual rail encoding, and chain link used in delay insensitive circuits. For these codes, [math]\displaystyle{ n=N,~ d=2,~ w=1 }[/math] and [math]\displaystyle{ A(n, d, w) = n }[/math].
Some of the more notable uses of one-hot codes include

biphase mark code uses a 1 of 2 code;

pulse-position modulation uses a 1 of n code;

address decoder,

etc.

- A special case of constant weight codes are the one-of-N codes, that encode [math]\displaystyle{ log_2 N }[/math] bits in a code-word of [math]\displaystyle{ N }[/math] bits. The one-of-two code uses the code words 01 and 10 to encode the bits '0' and '1'. A one-of-four code can use the words 0001, 0010, 0100, 1000 in order to encode two bits 00, 01, 10, and 11. An example is dual rail encoding, and chain link used in delay insensitive circuits. For these codes, [math]\displaystyle{ n=N,~ d=2,~ w=1 }[/math] and [math]\displaystyle{ A(n, d, w) = n }[/math].

### 2014

- (Wikipedia, 2014) ⇒ http://en.wikipedia.org/wiki/Multinomial_distribution Retrieved:2014-10-29.
- … Note that, in some fields, such as natural language processing, the categorical and multinomial distributions are conflated, and it is common to speak of a "multinomial distribution" when a categorical distribution is actually meant. This stems from the fact that it is sometimes convenient to express the outcome of a categorical distribution as a "1-of-K" vector (a vector with one element containing a 1 and all other elements containing a 0) rather than as an integer in the range [math]\displaystyle{ 1 \dots K }[/math]; in this form, a categorical distribution is equivalent to a multinomial distribution over a single trial.

### 2013

- (Mikolov et al., 2013b) ⇒ Tomáš Mikolov, Wen-tau Yih, and Geoffrey Zweig. (2013). “Linguistic Regularities in Continuous Space Word Representations..” In: HLT-NAACL.
- QUOTE: The probabilistic feedforward neural network language model has been proposed in (Bengio et al., 2003a). It consists of input, projection, hidden and output layers. At the input layer, N previous words are encoded using 1-of-V coding, where V is size of the vocabulary.