0
\$\begingroup\$

To convert the given decimal number to XS3, I have to add 3 to each individual number and convert that number into BCD. If the given decimal number is 12 then adding 3 to each gives me 45 and the equivalent BCD is 0100 0101.

So, whats the XS-3 for 29? My calculations:

Adding 3 to each, i get 5 12. I knew from my book that I shouldn't take the carry into next column. Now, when I have to convert it to BCD, it converts to 0101 00010010. I converted 12 to its BCD (1 to binary and 2 to binary). But my text book is telling me that the answer is 0101 1100. 12 is converted to binary instead of BCD.

What am I missing here? enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ I don't know anything about XS-3. But from your description I'd say that it's exactly what it says it is: decimal digits with 3 added to them. And that's all. There doesn't appear to be any rule saying that each resulting 4-bit BCD digit has to be between 0 and 9. Can you point to documentation saying so? \$\endgroup\$
    – jonk
    Nov 8 '19 at 16:08
  • \$\begingroup\$ I am confused why there is binary equivalent of 12 instead of BCD. BCD was meant to replace each individual digit (1 and 2 in this case) by its equivalent binary. \$\endgroup\$
    – G-aura-V
    Nov 8 '19 at 16:17
  • 1
    \$\begingroup\$ Like I said, I am not at all familiar with XS-3. I'm only pointing out that "9+3=12" and that 12, when in 4-bit binary, is simply 1100. That's just a fact. Now, different systems may have different rules about what to do with binary values that exceed a range. But I don't see any rules about that in your book pages. It appears to "simply add 3" while keeping the 4-bit per digit format. So I imagine (I don't know) that this is just about first converting each digit to a simple 4-bit binary digit, then adding 3 to that binary digit. Period. The book pages you've added don't disagree. \$\endgroup\$
    – jonk
    Nov 8 '19 at 16:21
  • \$\begingroup\$ Wikipedia has a page on Excess 3 that confirms jonk's speculation. \$\endgroup\$
    – The Photon
    Nov 8 '19 at 16:24
  • 1
    \$\begingroup\$ Excess 3 is a form of binary coded decimal (BCD). Your book is unclear, but when they say "convert to binary coded decimal" it seems they mean, convert to a binary form (of this decimal number), not convert to the usual unbiased BCD format. \$\endgroup\$
    – The Photon
    Nov 8 '19 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.