|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
THE BCD TO EXCESS 3 CODE CONVERTER
|
TRUTH TABLE | ||||||||
---|---|---|---|---|---|---|---|---|
Input (BCD) | Output (Excess-3) | |||||||
A | B | C | D | W | X | Y | Z | |
0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | |
0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | |
0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | |
0 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | |
0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | |
0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | |
0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | |
0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | |
1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | |
1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
As you are about to find out, code converters are used for more than protecting private information. Here is an illustration. You go to your fridge to get some ice cream and find a frozen mouse on the bowl, with its tiny little teeth stuck in your ice cream. After taking a minute to catch your breath, you decide to tell your friend about this unusual event. However, there is a problem: your friend lives in a different zip-code half hour away. Consequently, you cant yell the information to your friend as if your friend were in the next room; your voice will not carry that far (i.e., your voice is not portable over such distance). So you use your cellular phone instead. When you speak into the cellular phone, an encoder converts the sound of your voice into electrical signals — which can travel very fast over very long distances. When the electrical signals get to your friends cellular phone, a decoder converts the electrical signals back to the sound of your voice! So now you know: Code converters are used for more than protecting private information from spies. They are also used to enhance data portability and tractability.
Portability and tractability are not technical terms. They are mere English words. In our context portability means the information can be transported from location to location, such as from your house to your friends house. Tractability means the information can be easily managed, stored, used, etc. For instance, if you have a comprehensive encyclopedia in paper book form at home, and I have the same comprehensive encyclopedia in electronic book form on a thumb drive; not only can I carry mine in my pocket whereas you cannot even lift yours off the table, I can also do a word search more quickly than you can. Hence, my encyclopedia is more tractable than yours.
We will complete our introduction to code converters by designing an Excess-3 Binary Coded Decimal (BCD) circuit. The term BCD refers to representing the ten decimal digits in binary forms; which simply means to count in binary; see Table 1 below. The Excess-3 system simply adds 3 to each number to make the codes look different. We will not venture to discuss the importance of the Excess-3 BCD system because the discussion would serve too great a distraction from our present purpose and the cost would outweigh the benefit. Suffice it to say that the Excess-3 BCD system has some properties that made it useful in early computers.
Decimal Numerals | Binary Numerals |
---|---|
0 | 0000 |
1 | 0001 |
2 | 0010 |
3 | 0011 |
4 | 0100 |
5 | 0101 |
6 | 0110 |
7 | 0111 |
8 | 1000 |
9 | 1001 |
Table 1: BCD
The Excess-3 BCD system is formed by adding 0011 to each BCD value as in Table 2. For example, the decimal number 7, which is coded as 0111 in BCD, is coded as 0111+0011=1010 in Excess-3 BCD.
Decimal Numerals | Binary Numerals | Excess-3 |
---|---|---|
0 | 0000 | 0011 |
1 | 0001 | 0100 |
2 | 0010 | 0101 |
3 | 0011 | 0110 |
4 | 0100 | 0111 |
5 | 0101 | 1000 |
6 | 0110 | 1001 |
7 | 0111 | 1010 |
8 | 1000 | 1011 |
9 | 1001 | 1100 |
Table 2: BCD Excess-3
Our BCD Excess-3 circuit will convert numbers from their binary representation to their excess-3 representation. Hence our truth table is as below, Table 3.
A | B | C | D | W | X | Y | Z | |
---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | |
0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | |
0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | |
0 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | |
0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | |
0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | |
0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | |
0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | |
1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | |
1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
Table 3: Truth Table BCD to Excess-3
Our task now is to use the truth table to find four switching expressions: one for W, one for X, one for Y,
and one for Z. We have two choices: we can use Boolean algebraic manipulations, or we can use
Karnaugh Maps. For the sake of expediency we will solve for the variables using K-Maps. If you want to
see how to use Boolean algebraic manipulations, read the Boolean Algebra article.
In the four K-maps that follow, the xs are referred to as “ dont cares ”. These dont cares are available
because if you look at the truth table in Table 3, no WXYZ valuations exist for ABCD = 1010, ABCD =
1011, ABCD = 1100, ABCD = 1101, ABCD = 1110, and ABCD = 1111. As such, we evaluate WXYZ = xxxx for
each of these entries. And we are free to use these xs as we please (as 0s or as 1s where convenient)
since we cant really hurt anything.
For W:
Table 4: Karnaugh Map for W
For X:
Table 5: Karnaugh Map for X
X = BCD + BD + BC = BCD + B (D + C)
For Y:
Table 6: Karnaugh Map for Y
Y = CD + CD
For Z:
Table 7: Karnaugh Map for Z
Z = D
Now we have all the four switching functions we need to build the Excess-3 circuit:
W | = | A + BD + BC = A + B (D + C) | ||
X | = | BCD + BD + BC = BCD + B (D + C) | ||
Y | = | CD + CD | ||
Z | = | D |
You probably noticed that Circuit 4 does not look like the interactive circuit at the top of this page. We
invite you to check that they perform the exact same function. We use two different implementations to
impress upon you that you are free to implement your circuits however best fits your resources.
The design process we use to synthesize the BCD to Excess-3 code converter is simple, and you should
use it to design your combinational circuits, whether they have a single output or multiple outputs.
Okay. Maybe we should tell you one special property of the Excess-3 system; just to give you a taste for
why we still use it. Here it is: In the Excess-3 BCD system, all pair of numbers that add up to 9 add up to
1111:
0 + 9 = 0011 + 1100 = 1111Pretty cool, No?! This property is known as self-complementing. We leave 3 + 6 and 4 + 5 for you to try.
1 + 8 = 0100 + 1011 = 1111
2 + 7 = 0101 + 1010 = 1111.