
Bcd computer coding system pdf Continue BCD code redirects here. For BCD character sets, see BCD (character coding). Binary watches can use LEDs to express binary values. In this watch, each column of LEDs shows a binary decimal figure of traditional sexhemical time. In computing and electronic systems, binary decimal (BCD) is a class of binary codes of decimal numbers, where each digit is represented by a fixed number of bits, usually four or eight. Sometimes special bit templates are used for a sign or other indication (such as errors or overflows). In tote-oriented systems (i.e. most modern computers), the term unpacked BCD usually implies a full series for each digit (often including a sign), while packaged BCD typically encodes two digits within one time, taking advantage of the fact that four bits is enough to represent a range of 0 to 9. However, accurate 4-bit coding can vary for technical reasons (e.g. Excess-3). Ten states representing the BCD figure sometimes referred to as tetrads (for nibbling usually necessary for their conduct is also known as a notebook), while unused, non-care-states are called pseudo-tetrads (e) with de (10) (nb 1) The main virtue of BCD, compared to binary positioning systems, is a more accurate representation and rounding of decimal quantities, as well as the simplicity of conversion to the usual representations of humans. Its main drawbacks are a slight increase in the complexity of the schemes required to implement basic arithmetic, as well as slightly less dense storage. BCD was used in many early decimal computers and is implemented in a set of instructions by machines such as IBM System/360 and its descendants, THE VAX Digital Equipment Corporation, burroughs B1700 and Motorola 68000 processors. BCD as such is not as widely used as in the past, and it is no longer implemented in the set of instructions of new computers (e.g. ARM); x86 no longer supports its bcD instructions for long-term. However, decimals of fixed point and floating point formats are still important and continue to be used in financial, commercial, and industrial computing, where subtle conversion and fractional rounding errors inherent in floating point binary views cannot be tolerated. The BCD background uses the fact that any decimal figure can be represented by a four-bit pattern. The most obvious way to encode numbers is natural BCD (NBCD), where each decimal figure is represented by the corresponding 4,000 binary value, as shown in the following table. This is also called coding 8421. Decimal figure BCD 8 4 2 1 0 0 0 0 0 0 0 0 0 1 2 0 0 0 3 0 1 1 4 0 0 5 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 7 0 7 1 1 1 8 1 0 0 0 9 1 0 0 1 This scheme can also be called a simple binary decimal (SBCD) or BCD 8421, and is the most common coding. Others include so-called 4221 and 7421 coding - named after the weighing used for bits - and Excess-3. For example, the number BCD 6, 0110'b in 8421 notations, 1100'b in 4221 (two codings possible), 0110'b in 7421, while in Excess-3 it is 1001'b (6 x 3 9display 633'9). 4-bit codes BCD and pseudo-tetrad Bit Weight 0 1 2 3 4 5 6 8 9 10 11 12 13 14 15 Comment 4 8 8 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Binary 3 4 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 2 2 2 0 0 1 1 1 1 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 2 4 5 6 7 8 8 9 10 11 12 13 14 15 Dec 8 4 2 2 1 (XS-0) 1 0 1 2 3 4 5 6 6 7 8 9 10 11 12 13 14 15 (14) 16 nb 7 4 4 1 0 2 3 4 6 7 8 9 Aiken (2 4 2 2 1) 0 1 2 3 4 5 6 7 8 9 Excess-3 (XS-3) -3 -2 -1 0 1 2 3 4 5 6 7 8 9 9 10 11 12 Excess-6 (XS-6) -6 -5 -5 -4 -3 -2 -2 -1 0 1 2 3 3 3 3 4 5 6 7 8 9 x 18 nb 2 Jump-on-2 (2 4 2 2 1) 0 1 2 3 3 4 5 7 8 9 (2 4 2 2 1) 0 1 3 4 5 7 8 9 (21) 1 0 1 2 3 5 5 6 7 8 9 (I) 0 1 2 3 4 6 7 9 9 4 2 2 1 (II) 0 1 2 3 4 6 7 8 9 »21» 5 4 0 1 0 3 4 5 6 7 8 9 »18» 14 0 1 2 3 4 5 6 7 8 9 (14) 5 1 2 1 0 1 2 3 4 6 7 8 9 5 19 1 1 1 0 2 3 4 5 6 7 8 9 White (5 2 1 1 1) 0 1 2 3 4 6 7 8 9 x 18 14, 5 2 1 0 0 2 3 5 6 8 9 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 Magnetic Tape 1 2 2 2 3 4 5 6 7 8 9 0 (15) Paul 1 3 2 6 7 5 5 4 0 8 9 25 Gray 0 1 3 2 6 7 4 15 14 12 13 9 11 10 (26) 15 x 16 nb Glikson 0 1 3 2 2 7 5 4 9 9 8 (27) 14 4 3 1 1 0 1 1 2 3 5 4 6 7 8 9 (19) LA 0 1 2 4 3 5 6 6 7 9 8 (28) Clare 0 1 2 4 3 9 8 7 5 6 (RAE) 1 3 2 0 4 8 6 9 9 5 (29) 30 nb 5O'Brian I (Watts) 0 1 3 2 4 9 8 8 6 7 5 2 4 9 8 7 5 5 6 (32) 16 17 Lippel 0 1 2 2 3 4 9 8 7 6 5 O'Brien II 0 2 1 4 3 9 7 7 7 7 8 5 6 Tompkins II 0 1 4 3 2 7 9 8 5 6 (32) 2 0 -1 4 3 3 1 2 12 11 9 10 5 6 8 7 nb 2' 6 3 No 2 (I) 3 2 1 0 5 8 9 7 6 (28) 6 3 No2 (II) 0 3 2 1 6 5 4 9 8 7 (28) 8 8 8 8 No 2 0 4 3 2 1 8 6 5 9 (28) Lukal 0 15 14 1 12 3 2 13 8 7 6 4 11 10 5 (36) Kautz I 0 2 5 5 1 3 7 8 6 4 (18) Kautz II 9 4 1 3 2 8 6 0 5 (18) Suskindda I 0 1 4 3 2 9 8 8 8 5 6 7 (34) Suskind II 0 1 9 8 3 2 5 6 7 0 1 2 3 4 5 6 7 8 9 10 12 13 14 15 The next table represents a decimal figure of 0 to 9 in different systems BCD coding. In the blanks, 8 4 2 1 indicates the weight of each bit. In the fifth column (BCD 8 4 No21 two weights are negative. Digit BCD8 4 2 1 Stibit code or Excess-3 Aiken Code or BCD2 4 2 1 BCD8 4 No 2 No 1 IBM 702, IBM 705, IBM 7080, IBM 1401 8 4 2 1 ASCII 0000 8421 EBCDIC 0000 8421 0000 0011 0000 0000 1010 0011 0000 111 0000 1 0001 0100 0001 0111 0001 0001 1111 0001 20010 010 1 00010 0110 0010 0011 0010 111 0010 3 0011 0110 01011 0011 0011 0011 0011 1111 0011 0011 0011 4 0100 0111 0100 0100 0100 0011 0100 1111 0100 5 0101 1000 1011 1011 0101 0011 0011 0011 00110101 1111 0101 6 0110 1001 1010 1010 0110 0111 0110 1111 0110 7 0111 1010 1010 1010 10101101 1001 0111 0011 0111 1111 0111 8 1000 1011 1110 1000 1000 0011 100 0 1111 1000 9 1001 1100 1111 1001 0011 1001 1111 1001 Because most computers deal with data in 8-bit bytes , you can use one of the following methods to encode the BCD number: Unpacked: Each decimal digit is encoded in a row, with four bits representing the number, and the remaining bits do not matter. Packed: Two decimal figures are encoded one way, with one digit in the least meaningful nibble (bits 0 to 3) and the other by a digit in the most significant nibble (bits 4 to 7). (nb 8) As an example, encoding decimal number 91 using unpacked BCD leads to the following binary pattern of two bytes: Decimal: 9 1 Binary : 0000 1001 0000 0001 In packaged BCD, The same number will fit into one point: Decimal: 9 1 binary: 1001 0001 Thus, the numerical range for one unpacked BCD byte is zero through nine inclusive, while the range for one packaged bcD byte is zero through ninety-nine inclusive.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages3 Page
-
File Size-