edited by
4,639 views

2 Answers

Best answer
8 votes
8 votes

First of all a bit about Excess-3 code. 

Excess-3 code is a self-complimentary BCD code. i.e., to obtain 9's complement we just have to invert each bit.

Advantages:

  1. Ease of finding 9's complement
  2. After adding two numbers using 4 bit adder, we get a carry set when result is above 9.

https://en.wikipedia.org/wiki/Excess-3

Now, coming to the given question it is indirectly asking what Excess code we need if instead of base 10 we use base 20. (Though this is not really clear)

In base 20, 19's complement of any number $x$ is $19-x$. And we need minimum $5$ bits as for the largest number $19$, $5$ bits are required.

With 5 bits, the maximum number represented is 31.

Now, say for base 32, if we simply do $31-x$, we get its 31's complement. But here we have base 20. So, let us add an excess $d$ for each number (hence for complement also).

So, for number $x$, we get $x+d$. Its complement is $31-(x+d)$ and this value must be equal to $19-x + d$. (19's complement in base 20 and with excess d).

So, 

$31-x-d = 19-x+d$
$\implies 2d = 12$
$\implies d = 6$

https://books.google.co.in/books?id=wFNMpKd6_y8C&pg=PA173&lpg=PA173&dq=A+number+system+uses+20+as+the+radix.+The+excess+code+that+is+necessary+for+its+equivalent+binary+coded+representation+is&source=web&ots=jw2QPeAlPA&sig=asZ5goFNqCMw4bKPNe9xzs5LVa4&hl=en&sa=X&oi=book_result&resnum=10&ct=result#v=onepage&q&f=false

selected by
3 votes
3 votes

A number in Number System of base or radix r is represented by a set of symbols from r distinct symbols .

so Radix means base , like in binary number syatem radix is 2 , they are 0 and 1 .

here radix = 20 , means number is represented by 0-19 .

BCD means to represent a decimal number into it's binary form digit by digit , in BCD or binary-coded-decimal code, a decimal number is not converted as a whole to binary, but rather digit by digit .

like in BCD 4 bits are needed to represent each digit of a binary number , like 2 is represented in BCD as 0010 .

in Excess 3 code 0011( decimal 3) is added with every BCD( decimal digit ) of a number. like excess-3 code for 421 is  754 for 7 0111 , for 5 0101  and for 4  0100 .

If number system uses 20 as radix,  each digit needs 5 bits in equivalent Binary number . [ it is because now 25 = 32 , 20 < 32 ] . But to represent a binary number in to BCD we need 4 bits,  because BCD implies binary coded decimal 0 to 9. If we consider 5th bit for bcd, we would essentially represent numbers greater than 9 . In BCD we only use the representations from 0 to 9 [3].

Given radix or base is 20 , so number range for base 20 is 0 to 19 .

Now we know that for decimal 0 to 9 binary and BCD representation is same . ex: take 9 it's in binary is 00001001 , BCD representation of 9 is also 00001001 .

Next is decimal range  10 to 19 . For this 10-19 range , lets take number 10 , it is in binary 00001010 . when we convert 10 into BCD for 0 it is 0000 for 1 it is 0001 so BCD for 10 is 00010000 . 

00001010 = 10

00010000 = 16 , so excess is 16 - 10 = 6 .

again take 17 , it's binary is 00010001 , BCD is 1 = 0001 & 7 = 0111 .

00010001 = 17

00010111  = 23 so excess is 23 - 17 = 6 .

take last number in this rage that is 19 .  

00010011 = 19

00011001 = 25  so excess is 25 - 19 = 6

That's why in range between 10 to 19 we use excess 6 when represent in BCD.

Now we take 20 .

00010100 = 20

00100000 = 32 ,  so excess is 32 - 20 = 12

if we continue this , we can see that for range 20 to 29 we have to add 12 [1].

In this question , a number system uses radix as 20  , so for radix 20 range of numbers are 0 to 19 ( it is same like for base 10 , range of numbers are 0 to 9  like that )

we can see that for range 0-9  BCD is same as decimal and for range 10-19, we use Excess 6  to represent a number to its equivalent binary coded representation .

when number is 20 we need to use Excess 12 [1].

Hence for radix 20 number system , the excess code that is necessary for its equivalent binary coded representation is 6 .

Btw , This question asks if we have any base 20 number system,  then how many excess bits we need  when represent any number from this number system into BCD .

Reference:

[1] https://answers.yahoo.com/question/index?qid=20070930062637AAzyBlv

[2] https://www.physicsforums.com/threads/in-bcd-addition-why-add-6.639798/ 

[3] https://electronics.stackexchange.com/questions/87211/why-do-we-add-6-in-bcd-addition

edited by
Answer:

Related questions

0 votes
0 votes
0 answers
1
krish71 asked Aug 1, 2022
460 views
Hi,Can someone please tell if gray code representation can also work for negative binary number?I’ve seen examples of gray code for only positive binary number not sure...
0 votes
0 votes
1 answer
2
2 votes
2 votes
1 answer
3
Parimal Paritosh asked Sep 10, 2017
1,323 views
In Excess 3 addition, the groups that have produced a carry we have to add 0011 to them and subtract 0011 from the groups which have not produced a carry during the addit...