2.8 BINARY-CODED DECIMAL REPRESENTATION

Humans beings use decimal numbers in their daily arithmetic operations. Conversion from binary to decimal is not trivial for the common consumer of digital systems, such as a calculator. Digital systems must therefore allow the frequent user inputs and output to be performed in decimal form. A special number system, binary-coded decimal (BCD), has been designed to represent decimal numbers in a particular binary grouping (Figure 2.6). Digits A through F of the hexadecimal system are considered invalid binary forms in the BCD system. The BCD system has various codes, the most popular of which is the 8421 code. Other codes, such as the 5421 and the excess-3 codes, are also used in special cases.

Replacing every digit of a decimal number by its corresponding 4-bit binary code gives the BCD representation of that number. This means that only binary numbers from 0000 to 1001 occur in a system that operates using BCD representation. The other numbers are considered to be “Don't-care” conditions. Although this type of representation offers simplicity in display, its implementation for arithmetic operations becomes complex and also wastes six other possible code combinations: the codes from 1010 to 1111. The BCD system makes it possible for frequency inputs and output to use the decimal system; however, the digital system still performs arithmetic operations on BCD numbers in binary form. Arithmetic operations in the BCD system may lead to invalid ...

Get Introduction to Digital Systems: Modeling, Synthesis, and Simulation Using VHDL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.