Prove that in a self-complementing code the sum of the
weights must be 9?

Answer Posted / nobody

In self complementing code, 9's complement in decimal is the
1's complement in binary.

Now, assume a code with weights are W1,W2,W3 and W4.

We want to prove that,
W1 + W2 + W3 + W4 = 9

Let 'N' be a number in decimal.

Let N's binary equivalent in given code be
X1X2X3X4

Lets represent complement of N as COMP(N).

Let COMP(N)'s binary equivalent in given code be
Y1Y2Y3Y4

Therefore,

N = W1(X1) + W2(X2) + W3(X3) + W4(X4) ***************[1]

Now 9's complement of N is
[9's COMP(N)] = 9 - N
[9's COMP(N)] = 9 - [W1(X1) + W2(X2) + W3(X3) + W4(X4)]
***** (from eq.1) *******[2]

Now, COMP(N)'s binary equivalent in given code is Y1Y2Y3Y4.
COMP(N) = W1(Y1) + W2(Y2) + W3(Y3) + W4(Y4)
********************[3]

Now as it is a self complementing code, 9's complement in
decimal is equal to the 1's complement in binary.

Therefore,

[9's COMP(N)] = COMP(N)

From [2] and [3]

9 - [W1(X1) + W2(X2) + W3(X3) + W4(X4)] = W1(Y1) + W2(Y2) +
W3(Y3) + W4(Y4)

[W1(X1) + W2(X2) + W3(X3) + W4(X4)] + [W1(Y1) + W2(Y2) +
W3(Y3) + W4(Y4)] = 9

W1(X1+Y1) + W2(X2+Y2) + W3(X3+Y3) + W4(X4+Y4) = 9
****************************[4]

Now, as (X1,Y1) (X2,Y2), (X3,Y3), (X4,Y4) are complements of
each other, their sums will always be 1.
i.e
(X1 + Y1) = (X2 + Y2) = (X3 + Y3) = (X4 + Y4) = 1.

Putting this in eq. [4], we get,

W1(1) + W2(1) + W3(1) + W4(1) = 9

i.e
W1 + W2 + W3 + W4 = 9

Is This Answer Correct ?    27 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to avoid a class from getting inherited but respective class should be able to instantiate ?

1479


Explain the concept of segmentaion.

1699


program for inter process communicatin using message sharing in unix c

1316


can i learn ad. java without learned core java? java is best or .net is best for summer training?

1492


how can i install windows-xp operating system in single time to 50 computersconnected in a LAN.

1848






How to control the Relative humidity in Air handling unit in Pharmaceutical company ,the AHU is comprised with DX system(Cooling coil) and dry heaters. We are facing the RH issue low side and higher side.

904


what is defect tracking in sotware testing

1387


I am going to appear for ISRO written test on 26 th april 2009 .So kindly forward me sample previous question paper for ISRO for BE Computer Science . My mail id : jothychristiya@gmail.com

2105


pls send me rrb se(s&t)questions

1661


Which software model is best suited for the Maintenance kind of project?

2273


why unix commands simpler rather than complex task

2378


How small can you make a computer? What are the limiting factors?

792


how to initialize a pointer to an array?

1492


I am going to HAL Online test for Computer Science. Can you please mail me the model question papers ?

2458


/bin/bash is missing.

1446