4-Bit Binary Coded Decimal (BCD)Systems The 4-bit BCD system is usually employed by the computer systems to represent and process numerical data only.In the 4-bit BCD system,each digit of the decimal number is encoded to its corresponding 4-bit binary sequence.The two most popular 4-bit BCD systems are: Weighted 4-bit BCD code Excess-3(XS-3)BCD code
4-Bit Binary Coded Decimal (BCD) Systems ◼ The 4-bit BCD system is usually employed by the computer systems to represent and process numerical data only. In the 4-bit BCD system, each digit of the decimal number is encoded to its corresponding 4-bit binary sequence. The two most popular 4-bit BCD systems are: • Weighted 4-bit BCD code • Excess-3 (XS-3) BCD code
Weighted 4-Bit BCD Code The weighted 4-bit BCD code is more commonly known as 8421 weighted code. It is called weighted code because it encodes the decimal system into binary system by using the concept of positional weighting into consideration. In this code,each decimal digit is encoded into its 4- bit binary number in which the bits from left to right have the weights 8,4,2,and 1,respectively
Weighted 4-Bit BCD Code ◼ The weighted 4-bit BCD code is more commonly known as 8421 weighted code. ◼ It is called weighted code because it encodes the decimal system into binary system by using the concept of positional weighting into consideration. ◼ In this code, each decimal digit is encoded into its 4- bit binary number in which the bits from left to right have the weights 8, 4, 2, and 1, respectively
Weighted 4-Bit BCD Code Decimal digits Weighted 4-bit BCD code 0 0000 Apart from 1 0001 8421, some 2 0010 other 3 0011 weighted 4 0100 BCD codes 5 0101 are4221, 6 0110 2421 and 7 0111 5211. 8 1000 9 1001
Weighted 4-Bit BCD Code Decimal digits Weighted 4-bit BCD code 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 ◼ Apart from 8421, some other weighted BCD codes are 4221, 2421 and 5211
Weighted 4-Bit BCD Code Examples 6.1-6.6,p100. 6.1:Represent the decimal number 5327 in 8421 BCD code. The corresponding 4-bit 8421 BCD representation of decimal digit 5 is 0101 The corresponding 4-bit 8421 BCD representation of decimal digit 3 is 0011 The corresponding 4-bit 8421 BCD representation of decimal digit 2 is 0010 The corresponding 4-bit 8421 BCD representation of decimal digit 7 is 0111 Therefore,the 8421 BCD representation of decimal number 5327 is 0101001100100111
Weighted 4-Bit BCD Code ◼ Examples 6.1-6.6, p100. ◼ 6.1: Represent the decimal number 5327 in 8421 BCD code. The corresponding 4-bit 8421 BCD representation of decimal digit 5 is 0101 The corresponding 4-bit 8421 BCD representation of decimal digit 3 is 0011 The corresponding 4-bit 8421 BCD representation of decimal digit 2 is 0010 The corresponding 4-bit 8421 BCD representation of decimal digit 7 is 0111 Therefore, the 8421 BCD representation of decimal number 5327 is 0101001100100111
Excess-3 BCD Code The Excess-3(XS-3)BCD code does not use the principle of positional weights into consideration while converting the decimal numbers to 4-bit BCD system.Therefore,we can say that this code is a non-weighted BCD code. The function of XS-3 code is to transform the decimal numbers into their corresponding 4-bit BCD code. In this code,the decimal number is transformed to the 4- bit BCD code by first adding 3 to all the digits of the number and then converting the excess digits,so obtained,into their corresponding 8421 BCD code. Therefore,we can say that the XS-3 code is strongly related with 8421 BCD code in its functioning
Excess-3 BCD Code ◼ The Excess-3 (XS-3) BCD code does not use the principle of positional weights into consideration while converting the decimal numbers to 4-bit BCD system. Therefore, we can say that this code is a non-weighted BCD code. ◼ The function of XS-3 code is to transform the decimal numbers into their corresponding 4-bit BCD code. ◼ In this code, the decimal number is transformed to the 4- bit BCD code by first adding 3 to all the digits of the number and then converting the excess digits, so obtained, into their corresponding 8421 BCD code. Therefore, we can say that the XS-3 code is strongly related with 8421 BCD code in its functioning