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

explain software engineering practices

1365


hey guys.... My name is Bandana Thakur.Im a cse(8th sem) student.i want to make my career in php language.i want to work with google,wipro,tcs,infosys.peoples tell me that the salary package of php developer is very less n these companies do not work in php language.please tell me what i do now? should i go with the php language or make my career in another language? pls reply me in my e-mail id bandana.thakur14at@gmail.com

1589


i possess a little knowledge of core java . so is it will be difficult for me to start advanced java?

1494


Hi, I am preparing for Assistant Motor Vehicle Inspector (AMVI) exam.If any body having old question papers please send.My mail id is siyadndd@gmail.com

1706


Qatar petroleum will call me for an technical phone interview as safety officer Please let me know what kind of question they asked ? any idea about this written test ?

6006






is the RKDF university is aicte approved for b.tech in computer

1531


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1280


I want to make my career in networking so how to going there? right now i have done a+ n+ ccna course from cms com institute but i m not certified with globle certification os what is my frist step ?, my finincial prob also with me plz sorry isubmit it

1492


How to freely move a ball in graphics mode.

1898


HOW WE CAN CORRELATE THE MA\ECHANICAL POWER TO ELECTRICAL POWER. SUPPOSE IF I WANT A PUMP OF PUMPIG 200 LPM AT 20 METER HEAD MENAS WHAT IS THE POWER NEEDED FOR PUMP IN ELECTRCAL AND HOW CAN WE GET IT

1390


i want techical questions on c and java with code part

1423


can u tell me any JAM topics.........and answers also...plz send me.........e-mail: anitha839@gmail.com

4980


what is the use of fact tables in your banking project doveleped with teradata?

1400


Explain what are db_options used for?

1394


2. A product selected for testing is equally likely to have been produced by one the 6 machines/processes. (i) Determine sample space ā€˜Sā€™ (ii) What is the probability that the product is from machine 1? (iii) What is the probability that the product is from machine 2 or machine 4? (iv) What is the probability that the product is from both machine 5 and machine 3? (v) What is the probability that the product is not from machine 6? (vi) What is the probability that the product is not from either machine 6 or machine 1?

1512