Excess-3 and BCD usage Logic in Digital Circuits Topic

Excess-3:
Excess-3 codes consist of 4-bit codewords representing the numeric values 0 through 9 as follows:

0 -> 0011
1 -> 0100
2 -> 0101
3 -> 0110
4 -> 0111
5 -> 1000
6 -> 1001
7 -> 1010
8 -> 1011
9 -> 1100
There are a couple properties of excess-3 codes that are interesting:

Each codeword is equivalent to its decimal value plus 3 in binary.

The codewords for 0–4 are complements of the codewords 5–9.

So, the rules for adding 2 excess-3 digits are as follows:
If the sum of a pair of excess-3 digits does not generate a carry, subtract 3.
If the sum of a pair of excess-3 digits does generate a carry, add 3.

For example, let’s say I want to do the subtraction of 49 - 22.

49 -> 0111 1100 (minuend)

22 -> 0101 0101 (subtrahend)

The 10’s complement of 22 will be:

Flip the bits: 0101 0101 -> 1010 1010
Add 1: 1010 1010 + 1 = 1010 1011
Then, we can do an addition:

0111 1100 (49) + 1010 1011 (10’s complement of 22)
First we do the least significant digits: 1100 + 1011 = 0111 with a carry of 1. We then add 3 to the digit to get 1010
Then we sum the next significant digits and the carry-in: 0111 + 1010 + 1= 0010 with a carry of 1. We add 3 to the digit and ignore the carry to get 0101
Our final excess-3 number is 0101 1010 -> 27, which is the correct difference


BCD:

As mentioned, the benefit of excess-3 is that addition and subtraction are easier than other decimal codes, especially BCD. The BCD code is the following:

0 -> 0000
1 -> 0001
2 -> 0010
3 -> 0011
4 -> 0100
5 -> 0101
6 -> 0110
7 -> 0111
8 -> 1000
9 -> 1001
The rules for addition in BCD are along the lines of the following (please correct me if I’m wrong):

If you add 2 digits and the sum is not larger than 10, do nothing.
If you add 2 digits and the sum is larger than 10 but smaller than 16, subtract 10 and generate a carry.

If you add 2 digits and the sum is 16 or larger (meaning it generates a carry), add 6 to the sum.


Excess-3 and BCD usage Logic in Digital Circuits Topic Excess-3 and BCD usage Logic in Digital Circuits Topic Reviewed by Akhil Kumar on 8:16 AM Rating: 5

No comments:

Popular Posts

Quick view

20th April 2021

Woke up at 5:45 Exercised 7 Minutes Surya Namamskar and Pranayama Checked for GRE details better to start Quant only  Thought of doing NPTEL...

Powered by Blogger.