1-out-of-n code
| 1-out-of-n code | |
|---|---|
| Number of digits | n |
| assessable | Yes |
| steadily | Yes |
| Weight | 1 |
| Minimum distance | 2 |
| Maximum distance | 2 |
| Hamming distance | 2 |
| redundancy | |
A 1-out-of-n code , also known as one-hot coding , represents numbers in binary form, usually for use in digital technology or computers.
A decimal digit is represented in the 1-out-of-n code by n bits , with only one bit being set to 1, while the remaining n -1 bits are 0.
The Hamming distance is 2, which is why 1-bit errors are noticed (by determining whether the checksum is exactly 1) but cannot be corrected. 2-bit errors cannot be reliably detected.
The code is very redundant because n bits could code up to different numbers.
The 1-out-of-n code is used in particular in the control of state machines , memory addressing , machine learning as well as in keypads, display panels, machine controls and, earlier, Nixie tubes .
| Example of a 1-out-of-n code with n = 10 | |||
|---|---|---|---|
| Decimal digit |
1-out-of-10 coded |
Binary coded |
|
| 0 | 0000000001 | 0 0 0 0 | |
| 1 | 0000000010 | 0 0 0 1 | |
| 2 | 0000000100 | 0 0 1 0 | |
| 3 | 0000001000 | 0 0 1 1 | |
| 4th | 0000010000 | 0 1 0 0 | |
| 5 | 0000100000 | 0 1 0 1 | |
| 6th | 0001000000 | 0 1 1 0 | |
| 7th | 0010000000 | 0 1 1 1 | |
| 8th | 0100000000 | 1 0 0 0 | |
| 9 | 1000000000 | 1 0 0 1 | |
Other binary codes
literature
David Harris, Sarah Harris: Digital design and computer architecture . 2nd Edition. Morgan Kaufmann, San Francisco 2012, ISBN 978-0-12-394424-5 , pp. 129 .