BCD 1001 0111 → decimal
introdecode each nibble separately
Answer
97
Why this example is worth doing
Decoding is per-nibble and never across the whole word: 1001 is nine and 0111 is seven, so the value is ninety-seven. Read as ordinary binary the same bits are one hundred and fifty-one, and the page shows both to make the point that a bit pattern means nothing without a declared encoding. That is the same lesson as the two's complement width question, arriving from a different direction.
Try your own input in the BCD converter. Pack and unpack binary-coded decimal, and add with the +6 correction shown.
How the answer is reached
Decode packed BCD 10010111
| group | bits | digit |
|---|---|---|
| 0 | 1001 | 9 |
| 1 | 0111 | 7 |
value97