From Digital Circuit Analysis and Design with Simulink Modeling and Introduction to CPLDs and FPGAs, Second Edition
This chapter describes the most commonly used binary codes. In particular, we will discuss the Binary Coded Decimal (BCD), the Excess 3 Code, the 2*421 Code, the Gray Code, and the American Standard Code for Information Interchange (ASCII) code. We will also discuss parity bits.
4.1 Encoding
In general, encoding is the process of putting a message into a code. In this text, encoding will refer to a process where the decimal numbering system as well as other alphanumerics (combinations of numbers and letters) are represented by the digits of the binary numbering system, that is 0 and 1. In this section we will introduce four different codes where 4 bits are used to represent a single decimal character.
4.1.1 Binary Coded Decimal (BCD)
The Binary Coded Decimal (BCD) uses 4 bits to represent the decimal numbers 0 through 9 and these are shown in the Table 4.1. This code is also known as 8421 code because the digits 8,4, 2, and 1 represent the weight of its bits position. In other words, the BCD is a weighted code.
| Decimal | BCD |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
We observe that only ten of the sixteen (2 4) possible combinations are used in BCD; the remaining six combinations 1010, 1011, 1100, 1101, 1110, and 1111 are invalid in BCD. The designations A through F to represent these numbers are...
Products & Services
Topics of Interest
This chapter begins with the basic logic operations and continues with the fundamentals of Boolean algebra and the basic postulates and theorems as applied to electronic logic circuits. Truth tables...
Overview This chapter describes the most commonly used binary codes. In particular, we will discuss the Binary Coded Decimal (BCD), the Excess-3 Code, the 2*421 Code, the Gray Code, and the American...
3.5 8B/10B BLOCK CODING OVERVIEW When 8-bit data are generated in a serial string, there is no assurance that the string will not contain a long sequence of zeros or ones. In fact, it is...
Overview Objective: This chapter shows how bits can be used to represent numbers and characters. The codes presented for integers are sequential binary, octal, hexadecimal, Gray, and BCD. The codes...
OVERVIEW Modern electronic controllers are digital. But while some transmitters and the majority of systems communicate in digital format, the measurements found in industry operate in a continuous...