Binary-coded decimal: Difference between revisions

Content deleted Content added
Packed BCD: fixed typo
Tags: Mobile edit Mobile web edit
IBM: Fix capitalization.
Line 697:
===IBM===
{{Main|BCDIC}}
IBM used the terms ''[[Binary-Coded Decimal Interchange Code]]'' (BCDIC, sometimes just called BCD), for 6-bit ''[[alphanumeric]]'' codes that represented numbers, upper-case letters and special characters. Some variation of BCDIC ''alphamerics'' is used in most early IBM computers, including the [[IBM 1620]] (introduced in 1959), [[IBM 1400 series]], and non-[[IBM 700/7000 series#Decimal architecture (7070/7072/7074)|Decimaldecimal Architecturearchitecture]] members of the [[IBM 700/7000 series]].
 
The IBM 1400 series are character-addressable machines, each ___location being six bits labeled ''B, A, 8, 4, 2'' and ''1,'' plus an odd parity check bit (''C'') and a word mark bit (''M''). For encoding digits ''1'' through ''9'', ''B'' and ''A'' are zero and the digit value represented by standard 4-bit BCD in bits ''8'' through ''1''. For most other characters bits ''B'' and ''A'' are derived simply from the "12", "11", and "0" "zone punches" in the [[punched card]] character code, and bits ''8'' through ''1'' from the ''1'' through ''9'' punches. A "12 zone" punch set both ''B'' and ''A'', an "11 zone" set ''B'', and a "0 zone" (a 0 punch combined with any others) set ''A''. Thus the letter '''A''', which is ''(12,1)'' in the punched card format, is encoded ''(B,A,1)''. The currency symbol '''$''', ''(11,8,3)'' in the punched card, was encoded in memory as ''(B,8,2,1)''. This allows the circuitry to convert between the punched card format and the internal storage format to be very simple with only a few special cases. One important special case is digit ''0'', represented by a lone ''0'' punch in the card, and ''(8,2)'' in core memory.<ref name="Thelen_Van1401"/>
 
The memory of the IBM 1620 is organized into 6-bit addressable digits, the usual ''8, 4, 2, 1'' plus ''F'', used as a flag bit and ''C'', an odd parity check bit. BCD ''alphamerics'' are encoded using digit pairs, with the "zone" in the even-addressed digit and the "digit" in the odd-addressed digit, the "zone" being related to the ''12'', ''11'', and ''0'' "zone punches" as in the 1400 series. Input/Outputoutput translation hardware converted between the internal digit pairs and the external standard 6-bit BCD codes.
 
In the Decimaldecimal Architecturearchitecture [[IBM 7070]], [[IBM 7072]], and [[IBM 7074]] ''alphamerics'' are encoded using digit pairs (using [[two-out-of-five code]] in the digits, '''not''' BCD) of the 10-digit word, with the "zone" in the left digit and the "digit" in the right digit. Input/Outputoutput translation hardware converted between the internal digit pairs and the external standard 6-bit BCD codes.
 
With the introduction of [[System/360]], IBM expanded 6-bit BCD ''alphamerics'' to 8-bit EBCDIC, allowing the addition of many more characters (e.g., lowercase letters). A variable length Packedpacked BCD ''numeric'' data type is also implemented, providing machine instructions that perform arithmetic directly on packed decimal data.
 
On the [[IBM 1130]] and [[IBM 1800|1800]], packed BCD is supported in software by IBM's Commercial Subroutine Package.