BCD ("Binary-Coded Decimal"), also called alphanumeric BCD, alphameric BCD, BCD Interchange Code, or BCDIC, is a family of representations of numerals, uppercase Latin letters, and some special and control characters as six-bit character codes.
Unlike later encodings such as ASCII, BCD codes were not standardized. Different computer manufacturers, and even different product lines from the same manufacturer, often had their own variants, and sometimes included unique characters. Other six-bit encodings with completely different mappings, such as some FIELDATA variants or Transcode, are sometimes incorrectly termed BCD.
Many variants of BCD encode the characters '0' through '9' as the corresponding binary values.
|BCD Interchange Codes|
|Classification||6-bit alphanumeric basic Latin encodings|
Technically, binary-coded decimal describes the encoding of decimal numbers where each decimal digit is represented by a fixed number of bits, usually four.
With the introduction of the IBM card in 1928, IBM created a code capable of representing alphanumeric information, later adopted by other manufacturers. This code represents the numbers 0-9 by a single punch, and uses multiple punches for upper-case letters and special characters. A letter has two punches (zone [12,11,0] + digit [1–9]); most special characters have two or three punches (zone [12,11,0,or none] + digit [2–7] + 8).
The BCD code is the adaptation of the punched card code to a six-bit binary code by encoding the digit rows (nine rows, plus unpunched) into the low four bits, and the zone rows (three rows, plus unpunched) into the high two bits. The digit zero (a single punch in row 0) is usually handled specially in some way, and the digit code was extended to values 10 through 15 by combining a digit in the range 2–7 with a punch in row 8. IBM applied the terms binary-coded decimal and BCD to the variations of BCD alphamerics used in most early IBM computers, including the IBM 1620, IBM 1400 series, and non-Decimal Architecture members of the IBM 700/7000 series.
IBM later created the 8-bit Extended Binary Coded Decimal Interchange Code (EBCDIC) based on BCDIC.
The Recordmark or Record mark character (represented as ‡) is a character used to mark the end of a record. The BCD code for this character is 328 in some BCD variants. The closest Unicode equivalent is U+29E7 ⧧ THERMODYNAMIC, but that is not found in many fonts, so U+2021 ‡ DOUBLE DAGGER is often used instead. Functionally this corresponds to the EBCDIC IRS character (ASCII RS), X'1E'.
The Groupmark or Group mark character (represented as ) is a character used to indicate the start or finish of a group of related fields. The BCD code for this character is 778 in some BCD variants. The groupmark was proposed for Unicode standardization in 2015, and was assigned to value U+2BD2 ⯒ GROUP MARK. Functionally this corresponds to the EBCDIC IGS character (ASCII GS), X'1D'. It is now in Unicode 10.0 at this position, but only the Symbola and Unifont fonts support it.
There are many different versions of the six-bit BCD code. There are three major categories of difference:
In "Spanish speaking countries", the character "Ñ" did not exist in the original system, therefore "@" was chosen by most manufacturers: Bull, NCR, and Control Data, but there was an inconsistency when merging databases to 7-bit ASCII code, for in that coding system the "/" character was chosen, resulting in two different codes for the same character.
The following charts show the numeric values of BCD characters in hexadecimal (base-16) notation, as that most clearly reflects the structure of 4-bit binary coded decimal, plus two extra bits. For example, the code for 'A", in row 2x and column x1, is hexadecimal 21, or binary '01 0001'.
The first versions of BCDIC had 48 characters, as they were based on card punch patterns and the repertoires of printers, neither of which encouraged having a power-of-two number of characters.
This was based on a 40-character punched card code; the original 37 (10 digits, 26 letters, and blank), plus three commercially important characters added around 1932::67 hyphen-minus used for printing credit balances and hyphenated names, the ampersand also used in many names and addresses (Procter & Gamble, Mr. & Mrs. Smith), and the asterisk used to overprint unused fields when printing cheques.
The IBM 704 reordered the BCDIC code to allow a normal alphabetic collating order internally, with 0 before 1 and A before Z. It could automatically translate between this internal form and the earlier BCDIC when reading and writing magnetic tapes.
( and were rarely-used characters that corresponded to the punched-card convention of a digit 0 with an overpunched sign in rows 12 or 11.)
The following table shows the code assignments for the type 716 printer used with the IBM 704 computer. This printer takes virtual punched-card columns as input, so the mapping from 6-bit binary characters is done by software, and is not built into the printer.
This is a repertoire of 45 characters (not counting blank, which is handled specially by the printer), as the characters
* are duplicated.
There was some variation; IBM 704 Fortran had a different set of special characters (preserving only the duplicated minus sign).
The IBM 1401 used the all-zero code for blank, and moved the digit zero to the code 10. It had defined character forms for all possible values, for documentation purposes, but only 48 of the 63 non-blank characters were printable, and there was considerable variation in how the other code values (shaded in the table below) were depicted in practice. Even the other characters varied between different available print chains for the IBM 1403 printer.
Below is the table of GE/Honeywell's GBCD code, a variant of BCD.
The BCDIC-A Code page was assigned as Code page 353, also known as CP353. Some of the characters in this code page are not in Unicode. [The presence of two # characters but no + character seems incorrect in this table.]
At 0x1A is the record mark, which was not proposed separately due to its similarity to the double dagger. At 0x3F is the group mark.
PTTC/BCD had 5 options. There were five code pages. They are shown below. The PTTC/BCD Standard Option was assigned as Code page 355, or CP355.
The PTTC/BCD H Option was assigned as Code page 357, or CP357.
The PTTC/BCD Correspondence Option was assigned as Code page 358, or CP358.
The PTTC/BCD Monocase Option was assigned as Code page 359, or CP359.
The PTTC/BCD Duocase Option was assigned as Code page 360, or CP360.
A six-bit character code is a character encoding designed for use on computers with word lengths a multiple of 6. Six bits can only encode 64 distinct characters, so these codes generally include only the upper-case letters, the numerals, some punctuation characters, and sometimes control characters. Such codes with additional parity bit were a natural way of storing data on 7-track magnetic tape.
|MacOS code pages("scripts")|
|DOS code pages|
|IBM AIX code pages|
|IBM Apple MacIntoshemulations|
|IBM Adobe emulations|
|IBM DEC emulations|
|IBM HP emulations|
|Windows code pages|
|EBCDIC code pages|
|Unicode / ISO/IEC 10646|
|TeX typesetting system|
|Miscellaneous code pages|