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.

Table 4.1: The BCD 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...

Copyright Orchard Publications 2007 under license agreement with Books24x7

Products & Services
Rotary Coded DIP Switches
Rotary coded dual in-line package (DIP) switches are activated by a rotating shaft and have several stop positions. They use the DIP form factor so that arrays of multiple switches can be incorporated into a single package.
Logic Counters
Logic counters are integrated circuits used for counting events in computers and other digital systems.
Logic Encoders
Logic encoders convert coded information into a familiar or uncoded format.
Logic Adders
Logic adders are digital devices that are capable of adding binary numbers. There are two basic types: half-adders and full-adders.

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...