in Digital Logic edited by
3,635 views
1 vote
1 vote
A number system uses 20 as the radix. The excess code that is necessary for its equivalent binary coded representation is ?
in Digital Logic edited by
3.6k views

2 Answers

7 votes
7 votes
Best answer

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

4 Comments

I think for 10...     (9-8)(9-9)    1001-1000  1001-1001  =  0001 0000    9's complement is done bit by bit
0
0
@Ahwan Thanks, corrected now.

@Bikram It is not what I said -- you can see the wikipedia link given. The question is not clear but this is the only thing the question setter could have imagined. If we say a representation uses some "Excess code", it should be used for all numbers in it -- not just for some.
0
0
@Arjun Sir. That should be 9's too instead of 10's I guess.
1
1
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

4 Comments

@arjun

i read many times her answer, before your edit, it had no meaning really..  can you plz clear why she divided by 2 ? .. i checked that link she posted but not understand .
0
0
yes, that is to make the code self-complementary. Excess-3 is the self-complementary code for BCD. Now for base 20, what code is required? This is the question. The procedure could be detailed.
2
2
edited by
@arjun

How this self complementary thing is working ?

take an example , a decimal number 14 . In binary 14 is 1110 whose complement is  0001 = 1  

BCD of 14 is     0001  0100 which is 20 so excess is 20 - 14 = 6 !!

here is excess 6 we can see .

How you say that " Excess-3 is the self-complementary code for BCD " ?

need some clarification from your end .
0
0
Answer:

Related questions