mhh, I wonder who they are?
Ok, let's get you even more confused!
It's definitely not "a Hex represented as a decimal"
It's more the other way round, believe me!
You are coding/representing decimals! In binary. And then you can look at it in hex if you want...
But the hexadecimal aspect is not that relevant. But there's a phenomenon: The hexadecimal representation of a packed BCD looks exactly like the decimal (see the examples below). (each decimal digit is coded in a hexadecimal nibble)
You really should carefully read the article that warui posted:
http://www.danbbs.dk/~erikoest/bcd.htm
Wrong! The maximum figure is 9. BCD is actually wasting some bits (also in the packed BCD)! You won't see any A/B/C/D/E/F (binary 1010 to 1111) in a hex representation of a BCD!Tyn wrote: They store it in 4 bits per unit as the maximum figure will be 15
here two examples:
111 (decimal)
00000001 00000001 00000001 (BCD (binary representation))
0001 0001 0001 (PACKED BCD (binary representation))
0x0111 (PACKED BCD (hexadecimal representation))
5639 (decimal)
00000101 00000110 00000011 00001001 (BCD (binary representation))
0101 0110 0011 1001 (PACKED BCD (binary representation))
0x5639 (PACKED BCD (hexadecimal representation))
hope this helps