For the number 6, if I need to represent it in 5421 code form, should I code it as 1001 or 0110? Why should I choose the one over the other?
Similarly for the number 5 in 2421, is it 1011 or 0101?
Edit 1:
In a weighted binary code, the name of the code indicates the weight assigned to each place.
So if the code is 8421, the number 9 would be written as 1001 (8*1 + 4*0 + 2*0 + 1*1=9). And the number 5 would be 0101 (8*0 +4*1 +2*0 +1*1=5). In each case, no other combination of weights add up to the values (9 and 5).
Edit 2:
But for 5421, can the number 5 be represented as 1000 (5*1+4*0+2*0+1*0=5) as well as 0101(5*0 + 4*1 + 2*0 + 1*1 = 5)? Which one should be chosen? Similarly for 2421, which one to choose between 1011 (2*1 + 4*0 + 2*1 + 1*1 = 5) and 0101 (2*0 + 4*1 + 2*0 + 1*1 = 5)?