Two-out-of-five code
Encyclopedia
In telecommunication
, a two-out-of-five code is an m of n code that provides exactly ten possible combinations, and thus is popular for representing decimal digits using five bits. There are ways to assign weights to each bit such that the set bits sum to the desired value, with an exception for zero.
According to Federal Standard 1037C
:
The weights give a unique encoding for most digits, but allow two encodings for 3: 0+3 or 10010 and 1+2 or 01100. The former is used to encode the digit 3, and the latter is used to represent the otherwise unrepresentable zero.
The IBM 7070
, IBM 7072, and IBM 7074 computers used this code to represent each of the ten decimal digits in a machine word, although they numbered the bit positions 0-1-2-3-4, rather than with weights. Each word also had a sign flag, encoded using a two-out-of-three code, that could be A Alphanumeric, − Minus, or + Plus. When copied to a digit, the three bits were placed in bit positions 0-3-4. (Thus producing the numeric values 3, 6 and 9, respectively.)
A variant is the U.S. Post Office
POSTNET
barcode
, used to represent the ZIP+4 code
for automated mail sorting and routing equipment. This uses two tall bars as "ones" and three short bars as "zeros". Here, the weights assigned to the bit positions are 7-4-2-1-0. Again, zero is encoded specially, using the 7+4 combination (binary 11000) that would naturally encode 11. This method was also used in North American telephone Multi-frequency
and crossbar switch
ing systems.http://simplethinking.com/photo/phone/vintage/xbr%20relays.shtml
The following table represents decimal
digits from 0 to 9 in various two-out-of-five code systems:
The limit on the number of bits set is similar to, but strictly stronger than, a parity check. Not only are all single-bit errors guaranteed to be detected, but also any case where all errors are of a single type (0→1 or 1→0).
Telecommunication
Telecommunication is the transmission of information over significant distances to communicate. In earlier times, telecommunications involved the use of visual signals, such as beacons, smoke signals, semaphore telegraphs, signal flags, and optical heliographs, or audio messages via coded...
, a two-out-of-five code is an m of n code that provides exactly ten possible combinations, and thus is popular for representing decimal digits using five bits. There are ways to assign weights to each bit such that the set bits sum to the desired value, with an exception for zero.
According to Federal Standard 1037C
Federal Standard 1037C
Federal Standard 1037C, titled Telecommunications: Glossary of Telecommunication Terms is a United States Federal Standard, issued by the General Services Administration pursuant to the Federal Property and Administrative Services Act of 1949, as amended....
:
- each decimal digitNumerical digitA digit is a symbol used in combinations to represent numbers in positional numeral systems. The name "digit" comes from the fact that the 10 digits of the hands correspond to the 10 symbols of the common base 10 number system, i.e...
is represented by a binary numeral consisting of five bits of which two are of one kind, called "ones," and three are of the other kind, called "zeros", and - the usual weights assigned to the bit positions are 0-1-2-3-6. However, in this scheme, zero0 (number)0 is both a numberand the numerical digit used to represent that number in numerals.It fulfills a central role in mathematics as the additive identity of the integers, real numbers, and many other algebraic structures. As a digit, 0 is used as a placeholder in place value systems...
is encoded as "binary" 01100; strictly speaking the 0-1-2-3-6 previously claimed is just a mnemonicMnemonicA mnemonic , or mnemonic device, is any learning technique that aids memory. To improve long term memory, mnemonic systems are used to make memorization easier. Commonly encountered mnemonics are often verbal, such as a very short poem or a special word used to help a person remember something,...
device.
The weights give a unique encoding for most digits, but allow two encodings for 3: 0+3 or 10010 and 1+2 or 01100. The former is used to encode the digit 3, and the latter is used to represent the otherwise unrepresentable zero.
The IBM 7070
IBM 7070
IBM 7070 was a decimal architecture intermediate data processing system that was introduced by IBM in June 1960. It was part of the IBM 700/7000 series, and was based on discrete transistors rather than the vacuum tubes of the 1950s. It was the company's first transistorized stored-program...
, IBM 7072, and IBM 7074 computers used this code to represent each of the ten decimal digits in a machine word, although they numbered the bit positions 0-1-2-3-4, rather than with weights. Each word also had a sign flag, encoded using a two-out-of-three code, that could be A Alphanumeric, − Minus, or + Plus. When copied to a digit, the three bits were placed in bit positions 0-3-4. (Thus producing the numeric values 3, 6 and 9, respectively.)
A variant is the U.S. Post Office
United States Postal Service
The United States Postal Service is an independent agency of the United States government responsible for providing postal service in the United States...
POSTNET
POSTNET
POSTNET is a barcode symbology that was used by the United States Postal Service to assist in directing mail. The ZIP Code or ZIP+4 code is encoded in half- and full-height bars...
barcode
Barcode
A barcode is an optical machine-readable representation of data, which shows data about the object to which it attaches. Originally barcodes represented data by varying the widths and spacings of parallel lines, and may be referred to as linear or 1 dimensional . Later they evolved into rectangles,...
, used to represent the ZIP+4 code
ZIP Code
ZIP codes are a system of postal codes used by the United States Postal Service since 1963. The term ZIP, an acronym for Zone Improvement Plan, is properly written in capital letters and was chosen to suggest that the mail travels more efficiently, and therefore more quickly, when senders use the...
for automated mail sorting and routing equipment. This uses two tall bars as "ones" and three short bars as "zeros". Here, the weights assigned to the bit positions are 7-4-2-1-0. Again, zero is encoded specially, using the 7+4 combination (binary 11000) that would naturally encode 11. This method was also used in North American telephone Multi-frequency
Multi-frequency
In telephony, multi-frequency signaling is an outdated, in-band signaling technique. Numbers were represented in a two-out-of-five code for transmission from a multi-frequency sender, to be received by a multi-frequency receiver in a distant telephone exchange...
and crossbar switch
Crossbar switch
In electronics, a crossbar switch is a switch connecting multiple inputs to multiple outputs in a matrix manner....
ing systems.http://simplethinking.com/photo/phone/vintage/xbr%20relays.shtml
The following table represents decimal
Decimal
The decimal numeral system has ten as its base. It is the numerical base most widely used by modern civilizations....
digits from 0 to 9 in various two-out-of-five code systems:
Digit | Telecommunication 01236 |
POSTNET |
---|---|---|
1 | 11000 | 00011 |
2 | 10100 | 00101 |
3 | 10010 | 00110 |
4 | 01010 | 01001 |
5 | 00110 | 01010 |
6 | 10001 | 01100 |
7 | 01001 | 10001 |
8 | 00101 | 10010 |
9 | 00011 | 10100 |
0 | 01100 | 11000 |
A | 1––10 | IBM 707x Sign flags |
− | 1––01 | |
+ | 0––11 | |
Digit | 01234 IBM 707x |
The limit on the number of bits set is similar to, but strictly stronger than, a parity check. Not only are all single-bit errors guaranteed to be detected, but also any case where all errors are of a single type (0→1 or 1→0).