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
how to avoid a class from getting inherited but respective class should be able to instantiate ?
Explain the concept of segmentaion.
program for inter process communicatin using message sharing in unix c
can i learn ad. java without learned core java? java is best or .net is best for summer training?
how can i install windows-xp operating system in single time to 50 computersconnected in a LAN.
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.
what is defect tracking in sotware testing
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
pls send me rrb se(s&t)questions
Which software model is best suited for the Maintenance kind of project?
why unix commands simpler rather than complex task
How small can you make a computer? What are the limiting factors?
how to initialize a pointer to an array?
I am going to HAL Online test for Computer Science. Can you please mail me the model question papers ?
/bin/bash is missing.