Tags: #◇Computer Science #◇CSARCH1 #◇Computer Architecture #◇Data Representation #◇Binary Codes for Decimal Digits
Binary Codes for Decimal Digits
◇Overview
This module covers how to represent decimal digits using different types of binary codes. Representing decimal digits in binary requires a minimum of 4 bits per digit, allowing for combinations. Since there are only 10 decimal digits, 6 combinations remain unused.
◇Types of Binary Codes
- Binary Coded Decimal (BCD):
- Weighted code (8 4 2 1).
- 2421 Code:
- Weighted code (2 4 2 1).
- Self-complementing: The 9's complement of a decimal digit is obtained by flipping the bits of its binary code.
- Excess-3 Code:
- Derived by adding 3 (0011 in binary) to the BCD representation.
- Self-complementing code.
- 8, 4, -2, -1 Code:
- Weighted code with positive and negative weights.
- Self-complementing code.
- Biquinary Code (5 0 4 3 2 1 0):
- 7-bit code with error-detection properties.
- Contains a two-bit group (5 0) and a five-bit group (4 3 2 1 0).
◇Gray Code (Reflected Code)
- A non-weighted binary code where only one bit changes in the sequence when going from one number to the next.
- Useful in electro-mechanical applications such as rotating motors to avoid transient errors during state transitions.
Decimal Digit Representations Table
| Decimal | BCD (8 4 2 1) | 2421 Code | Excess-3 | 8, 4, -2, -1 | Biquinary (5 0 4 3 2 1 0) | Gray Code |
|---|---|---|---|---|---|---|
| 0 | 0000 | 0000 | 0011 | 0000 | 01 00001 | 0000 |
| 1 | 0001 | 0001 | 0100 | 0111 | 01 00010 | 0001 |
| 2 | 0010 | 0010 | 0101 | 0110 | 01 00100 | 0011 |
| 3 | 0011 | 0011 | 0110 | 0101 | 01 01000 | 0010 |
| 4 | 0100 | 0100 | 0111 | 0100 | 01 10000 | 0110 |
| 5 | 0101 | 1011 | 1000 | 1011 | 10 00001 | 0111 |
| 6 | 0110 | 1100 | 1001 | 1010 | 10 00010 | 0101 |
| 7 | 0111 | 1101 | 1010 | 1001 | 10 00100 | 0100 |
| 8 | 1000 | 1110 | 1011 | 1000 | 10 01000 | 1100 |
| 9 | 1001 | 1111 | 1100 | 1111 | 10 10000 | 1101 |
◇Examples
- Representing 395:
- BCD:
0011 1001 0101 - 2421:
0011 1111 1011 - Excess-3:
0110 1100 1000 - 8, 4, -2, -1:
0101 1111 1011
- BCD:
◇References & Navigation
- Previous Topic: ◇Binary Data Organization
- Next Topic: ◇Number System Base Conversion
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
How many minimum bits are required to represent a single decimal digit using a binary code?
Which of the following binary codes is NOT considered self-complementing?
What is the Excess-3 code representation for the decimal digit 5?
In the Biquinary code (5 0 4 3 2 1 0), how is the decimal digit 3 represented?
What is a key characteristic of Grey Code (Reflected Code)?
In the 2421 code, what is the binary sequence for the decimal digit 6?
Which of the following codes is known to be used in rotating motors?
What is the BCD (8 4 2 1) representation for the decimal number 395?
How many unused bit combinations are there when representing decimal digits with 4-bit binary codes?
What is the 8, 4, -2, -1 code representation for the decimal digit 9?