Browse Definitions :

binary-coded decimal

What is binary-coded decimal?

Binary-coded decimal is a system of writing numerals that assigns a four-digit binary code to each digit 0 through 9 in a decimal (base 10) number. Simply put, binary-coded decimal is a way to convert decimal numbers into their binary equivalents. However, binary-coded decimal is not the same as simple binary representation.

More about binary-coded decimal

In binary-coded decimal, each digit in a decimal base 10 number is represented as a group of four binary digits, or bits. Any base 10 number or digit can be represented in binary notation using binary-coded decimal.

Digit to binary-coded decimal truth table
Standard digits versus their equivalent 4-bit binary-coded decimal codes.

Each digit is encoded separately. The full number is first segregated into its individual digits. These digits are then represented by their equivalent 4-bit binary-coded decimal codes as shown in this truth table.

In general, decimal-to-binary encoding using binary-coded decimal can be done using either 4-bit or 8-bit equivalents. However, the 4-bit equivalent is usually preferred, which effectively represents the decimal values from 0 to 9.

Arithmetic operations, like multiplication and addition, are required to convert real binary numbers to decimal. However, in binary-coded decimal, only 10 different combinations are possible (see above table) in each 4-bit binary sequence. This makes binary-coded decimal an easier way to represent decimal numbers.

The following numbers are not considered binary-coded decimal: 1010, 1011, 1100, 1101, 1110 and 1111.

Representing larger digits and numbers with binary-coded decimal

In the decimal system, all numbers larger than 9 have two or more digits. In the binary-coded decimal system, these numbers are expressed digit by digit.

Example 1

Decimal number = 1764

The binary-coded decimal rendition is represented as the following:









Example 2

Decimal number = 238

The binary-coded decimal rendition is represented as the following:







Example 3

Decimal number = 1895

The binary-coded decimal rendition is represented as the following:









The binary-coded decimal representation of a number is not the same as its simple binary representation. For example, in binary form, the decimal quantity 1895 appears as 11101100111. In binary-coded decimal, it appears as 0001100010010101.

The binary equivalents for each of the above examples always go from left to right. Other bit patterns are sometimes used in binary-coded decimal format to represent special characters relevant to a particular system, such as sign (positive or negative), error condition or overflow condition.

Advantages and applications of binary-coded decimal

The binary-coded decimal system provides a way to get around the size limitations imposed on integer arithmetic. It also enables easy conversion between machine-readable and human-readable numerals. Compared to the binary system, it is easy to code and decode binary-coded decimal numbers. Thus, binary-coded decimal offers a fast and efficient system to convert decimal numbers into binary numbers.

Binary-coded decimal is useful in digital displays, where it can be difficult to manipulate or display large numbers. Since binary-coded decimal treats each digit as a separate subcircuit, data manipulation in such devices becomes easier. Integrated circuits that are configured to give a binary-coded decimal output on such displays are available.

The binary-coded decimal conversion system is also used in some currency applications where floating point representations are not completely accurate.

Limitations of binary-coded decimal

Despite its advantages, binary-coded decimal comes with certain limitations. For example, representing a decimal number as binary-coded decimal requires extra bits of storage in a computer's memory, making it an inefficient way to store numbers. It also takes increased circuit complexity when compared to the standard binary system. Binary-coded decimal code can also be wasteful since many 4-bit states (10 to 16) are not used.

Another limitation of binary-coded decimal is that performing arithmetic tasks using binary-coded decimal numbers can be cumbersome since no digit can exceed 9. Consequently, adding of two decimal digits in binary-coded decimal could create a carry bit of 1, which must be added to the next group of 4 bits to arrive at the correct binary-coded decimal representation.

Types of binary-coded decimal

There are two types of binary-coded decimal.

Unpacked binary-coded decimal

In unpacked binary-coded decimal numbers, each 4-bit binary-coded decimal group is stored in a separate register inside a computer. The drawback here is that, if the registers are 8 bits or wider, space is wasted storing the binary-coded decimal numbers.

Packed binary-coded decimal

In packed binary-coded decimal numbers, a single 8-bit register stores two binary-coded decimal digits. By shifting the number in the upper register to the left four times and then adding the numbers in the upper and lower registers, the process combines two binary-coded decimal digits, which enables storage in a single register.

binary vs. digital data measurements

Binary-coded decimal vs. simple binary representation

In simple binary representation, the whole number is converted into its binary form by dividing the number by 2 repeatedly. In binary-coded decimal, each individual digit is converted to binary. The 4-bit binary equivalent of each digit is then written together.

Here's an example:

  • The decimal number is 234.
  • In binary format, 234 = 11101010
  • In binary-coded decimal, 234 is written as the following:
    • 2 = 0010, 3 = 0011, 4 = 0100
    • Hence, 234 = 001000110100

See also: Extended Binary Coded Decimal Interchange Code, encoding and decoding, hexadecimal, big-endian and little-endian, globally unique identifier, universally unique identifier and American Standard Code for Information Interchange.

This was last updated in June 2022

Continue Reading About binary-coded decimal

  • network traffic

    Network traffic is the amount of data that moves across a network during any given time.

  • dynamic and static

    In general, dynamic means 'energetic, capable of action and/or change, or forceful,' while static means 'stationary or fixed.'

  • MAC address (media access control address)

    A MAC address (media access control address) is a 12-digit hexadecimal number assigned to each device connected to the network.

  • Evil Corp

    Evil Corp is an international cybercrime network that uses malicious software to steal money from victims' bank accounts and to ...

  • Trojan horse

    In computing, a Trojan horse is a program downloaded and installed on a computer that appears harmless, but is, in fact, ...

  • quantum key distribution (QKD)

    Quantum key distribution (QKD) is a secure communication method for exchanging encryption keys only known between shared parties.

  • green IT (green information technology)

    Green IT (green information technology) is the practice of creating and using environmentally sustainable computing.

  • benchmark

    A benchmark is a standard or point of reference people can use to measure something else.

  • spatial computing

    Spatial computing broadly characterizes the processes and tools used to capture, process and interact with 3D data.

  • talent acquisition

    Talent acquisition is the strategic process employers use to analyze their long-term talent needs in the context of business ...

  • employee retention

    Employee retention is the organizational goal of keeping productive and talented workers and reducing turnover by fostering a ...

  • hybrid work model

    A hybrid work model is a workforce structure that includes employees who work remotely and those who work on site, in a company's...

Customer Experience
  • BOPIS (buy online, pick up in-store)

    BOPIS (buy online, pick up in-store) is a business model that allows consumers to shop and place orders online and then pick up ...

  • real-time analytics

    Real-time analytics is the use of data and related resources for analysis as soon as it enters the system.

  • database marketing

    Database marketing is a systematic approach to the gathering, consolidation and processing of consumer data.