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 code
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 pun ...
s.
Unlike later encodings such as
ASCII
ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
, 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
Transcoding is the direct digital-to-digital conversion of one encoding to another, such as for video data files, audio files (e.g., MP3, WAV), or character encoding (e.g., UTF-8, ISO/IEC 8859). This is usually done in cases where a target de ...
, are sometimes incorrectly termed BCD.
Many variants of BCD encode the characters '0' through '9' as the corresponding binary values.
History
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
In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communicati ...
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
2,11,0+ digit
–9; most special characters have two or three punches (zone
2,11,0,or none+ digit
–7+ 8).
The BCD code is the adaptation of the punched card code to a six-bit
binary code
A binary code represents plain text, text, instruction set, computer processor instructions, or any other data using a two-symbol system. The two-symbol system used is often "0" and "1" from the binary number, binary number system. The binary cod ...
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
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
applied the terms ''binary-coded decimal'' and ''BCD'' to the variations of BCD ''alphamerics'' used in most early IBM computers, including the
IBM 1620
The IBM 1620 was a model of scientific minicomputer produced by IBM. It was announced on October 21, 1959, and was then marketed as an inexpensive scientific computer. After a total production of about two thousand machines, it was withdrawn on N ...
,
IBM 1400 series
The IBM 1400 series are second-generation (transistor) mid-range business decimal computers that IBM marketed in the early 1960s. The computers were offered to replace tabulating machines like the IBM 407. The 1400-series machines stored infor ...
, and non-
Decimal Architecture members of the
IBM 700/7000 series
The IBM 700/7000 series is a series of large-scale (Mainframe computer, mainframe) computer systems that were made by IBM through the 1950s and early 1960s. The series includes several different, incompatible processor architectures. The 700s ...
.
Among the vendors using BCD were
Burroughs,
Bull
A bull is an intact (i.e., not Castration, castrated) adult male of the species ''Bos taurus'' (cattle). More muscular and aggressive than the females of the same species (i.e. cows proper), bulls have long been an important symbol cattle in r ...
,
CDC
The Centers for Disease Control and Prevention (CDC) is the national public health agency of the United States. It is a United States federal agency under the Department of Health and Human Services (HHS), and is headquartered in Atlanta, ...
,
IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
,
General Electric
General Electric Company (GE) was an American Multinational corporation, multinational Conglomerate (company), conglomerate founded in 1892, incorporated in the New York (state), state of New York and headquartered in Boston.
Over the year ...
(the computer division was purchased by
Honeywell
Honeywell International Inc. is an American publicly traded, multinational conglomerate corporation headquartered in Charlotte, North Carolina. It primarily operates in four areas of business: aerospace, building automation, industrial automa ...
in 1969),
NCR,
Siemens
Siemens AG ( ) is a German multinational technology conglomerate. It is focused on industrial automation, building automation, rail transport and health technology. Siemens is the largest engineering company in Europe, and holds the positi ...
, and
Sperry-
UNIVAC
UNIVAC (Universal Automatic Computer) was a line of electronic digital stored-program computers starting with the products of the Eckert–Mauchly Computer Corporation. Later the name was applied to a division of the Remington Rand company and ...
.
IBM announced the 8-bit ''
Extended Binary Coded Decimal Interchange Code'' (EBCDIC), based on BCDIC, in 1964 with the introduction of its
System/360
The IBM System/360 (S/360) is a family of mainframe computer systems announced by IBM on April 7, 1964, and delivered between 1965 and 1978. System/360 was the first family of computers designed to cover both commercial and scientific applicati ...
line.
Special characters
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 32
8 in some BCD variants. The closest Unicode equivalent is , but that is not found in many fonts, so 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 77
8 in some BCD variants. The groupmark was proposed for Unicode standardization in 2015,
and was assigned to value . 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.
The ''
Wordmark
A wordmark or word mark is a text-only statement of the name of a product, service, company, organization, or institution which is used for purposes of identification and branding. A wordmark can be an actual word (e.g., Apple), a made-up term ...
'', by contrast, is ''not'' a BCD character. Rather, it is a flag bit used to mark the end of a word on some
variable word length computers such as the
IBM 1401
The IBM 1401 is a variable word length computer, variable-wordlength decimal computer that was announced by IBM on October 5, 1959. The first member of the highly successful IBM 1400 series, it was aimed at replacing unit record equipment for pr ...
.
BCD code variations
There are many different versions of the six-bit BCD code. There are three major categories of difference:
# The mapping from zone punches to high-order bits. All codes translate no zone punches to a bit pattern of 00, but some encode the zone punches in 12-11-0 order, preserving alphabetical order, while others use 0-11-12 order, resulting in a partially reversed alphabet.
# The handling of the digit 0. The straightforward translation from punched form would place the blank before digits 1–9, and encode 0 at the start of the line with 'S' in it. All codes have some special-case handling which either translates the digit 0 to the all-zero binary code (and moves the blank elsewhere), or gives it binary code 001010 (decimal 10) and moves the 8+2 punch elsewhere.
# The assignment of special characters. The characters assigned to codes beyond the basic alphanumeric set varied widely, even within one model of computer. For example, some computers had the percent and lozenge () at the same codes as left and right parentheses in other encodings.
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.
Examples of BCD codes
The following charts show the numeric values of BCD characters in
hexadecimal
Hexadecimal (also known as base-16 or simply hex) is a Numeral system#Positional systems in detail, positional numeral system that represents numbers using a radix (base) of sixteen. Unlike the decimal system representing numbers using ten symbo ...
(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 3x and column x1, is hexadecimal 31, or binary '11 0001'.
Tape style
48-character BCD code
The first versions of BCDIC had 48 characters, as they were based on card punch patterns and the character sets 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:
hyphen-minus
The symbol , known in Unicode as hyphen-minus, is the form of hyphen most commonly used in digital documents. On most keyboards, it is the only character that resembles a minus sign or a dash, so it is also used for these. The name ''hyphen-mi ...
used for printing credit balances and hyphenated names, the
ampersand
The ampersand, also known as the and sign, is the logogram , representing the grammatical conjunction, conjunction "and". It originated as a typographic ligature, ligature of the letters of the word (Latin for "and").
Etymology
Tradi ...
also used in many names and addresses (
Procter & Gamble
The Procter & Gamble Company (P&G) is an American multinational consumer goods corporation headquartered in Cincinnati, Ohio. It was founded in 1837 by William Procter and James Gamble. It specializes in a wide range of personal health/con ...
, Mr. & Mrs. Smith), and the
asterisk
The asterisk ( ), from Late Latin , from Ancient Greek , , "little star", is a Typography, typographical symbol. It is so called because it resembles a conventional image of a star (heraldry), heraldic star.
Computer scientists and Mathematici ...
used to overprint unused fields when printing
cheque
A cheque (or check in American English) is a document that orders a bank, building society, or credit union, to pay a specific amount of money from a person's account to the person in whose name the cheque has been issued. The person writing ...
s.
IBM 1401 BCD code
Rather than following the IBM 704's storage representation,
IBM 1401
The IBM 1401 is a variable word length computer, variable-wordlength decimal computer that was announced by IBM on October 5, 1959. The first member of the highly successful IBM 1400 series, it was aimed at replacing unit record equipment for pr ...
followed the tape representation (descended from the 48-character BCD), thus using the all-zero code for blank and the code 10 (0x0A) for the digit zero. 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.
Code page 353
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 duplication of '#' can be found in IBM's own documentation and is not a mistake here.
)
At 0x1A is the record mark. At 0x3F is the group mark.
Code page 354
The BCDIC-B Code page was assigned as Code page 354, also known as CP354.
Some of the characters in this code page are not in Unicode.
At 0x1A is the record mark. At 0x3F is the group mark.
PTTC/BCD code pages
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.
IBM 704 storage style
IBM 704 BCD code
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 tape
Magnetic tape is a medium for magnetic storage made of a thin, magnetizable coating on a long, narrow strip of plastic film. It was developed in Germany in 1928, based on the earlier magnetic wire recording from Denmark. Devices that use magnetic ...
s.
The following table shows the code assignments for the
IBM 704
The IBM 704 is the model name of a large digital computer, digital mainframe computer introduced by IBM in 1954. Designed by John Backus and Gene Amdahl, it was the first mass-produced computer with hardware for floating-point arithmetic. The I ...
computer. Unassigned code positions appear as blanks.
( 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 starting with the IBM 704 computer and through the 7094.
The 704 interface sent virtual punched-card rows to this printer, two words (72 bits) at a time, so the mapping from 6-bit BCD characters was done by software, and was 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
+
,
-
and
*
are duplicated.
Fortran character set
There was some variation; IBM 704
Fortran had a different set of special characters (preserving only the duplicated minus sign).
A similar code was used for the
IBM 709
The IBM 709 is a computer system that was announced by IBM in January 1957 and first installed during August 1958. The 709 was an improved version of its predecessor, the IBM 704, and was the third of the IBM 700/7000 series of scientific compute ...
,
7090 and
7094 successors,
but with some of the special characters reassigned:
GBCD code
Below is the table of GE/Honeywell's GBCD code, a variant of BCD.
Burroughs B5500 BCD code
The following table shows the code assignments for the
Burroughs B5500 computer, sometimes referred to as BIC (Burroughs Interchange Code).
See also
*
Binary-coded decimal
*
Six-bit character code
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 pun ...
*
EBCDIC
Extended Binary Coded Decimal Interchange Code (EBCDIC; ) is an eight- bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It descended from the code used with punched cards and the corresponding si ...
*
SQUOZE
Notes
References
Further reading
*
*
{{DEFAULTSORT:BCD
Character encoding
EBCDIC code pages