What does it mean for a number to be weighted? For example, 8421 BCD codes are weighted and XS3 codes are not. (I only know this because I am regurgitating what I read but, I don't grasp it.) According to some random stuff I found on the Internet, weights have to do with the position of digits and that shifting the position of those digits matters however, I can't picture a case where shifting the position of digits wouldn't matter. Sorry for being pedantic about something that's probably not so important but, I just want to know!
Binary Coded Decimal (BCD) is weighted (like our decimal system) in that each digit has a certain weight assigned to it. The number can be recovered by simple summing the right weights. Excess-3 (XS3) (and Gray code being another example) is not weighted. For Gray code, it is more clear. You cannot say that a certain bit always will have a value of 2. While in XS3 each bit has a weight (like in BCD), you cannot simply sum all the weights. You have to add +3 to it. Therefor, it is not weighted. An example (BCD): the value of \[0110 = 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 0 \cdot 2^0 = 6\] The same number in XS3 would be \[0110 = 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 0 \cdot 2^0 + 3 = 9\] The extra +3 you need to use make XS3 non-weighted. (In Gray code the number would be 4) (also have a look at http://www.asic-world.com/digital/numbering3.html )
Okay so, it's that additional constant (3 in the case of XS3 code and 4 in the case of Gray code, for example) being added to the initial sum that makes the entire number not be weighted? Or no?
Yes. The fact that you cannot simply take the sum of the weights, but that you have to do something different makes it non-weighted. (btw, Gray code is a bit more complex that just adding +4. What I meant was that 0110 is 4 in Gray code)
Thanks a lot! :)
Join our real-time social learning platform and learn together with your friends!