Question

How do you tell the difference? For example, say you have 0110 0101 1001 0011. The unsigned BCD is 6593, but what is the signed value?

Was it helpful?

Solution

Usually, you tell the difference by explicitly storing the sign.

Radix complement (en.wikipedia.org/wiki/Method_of_complements)

OTHER TIPS

in normal binary system, signed numbers uses the MSB (most significant bit) to determine the sign of the number, the rest of the number is the actual value.

Unlike that in Packed BCD, the 4 LSb (least significant bits) represent the sign, and the rest (to the left) of the number represents the actual value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top