0

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?

trusktr
  • 44,284
  • 53
  • 191
  • 263

2 Answers2

1

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

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

trusktr
  • 44,284
  • 53
  • 191
  • 263
dan04
  • 87,747
  • 23
  • 163
  • 198
  • well it's wierd because in my Assembly class `0110 000 000 000` is supposedly 6000 unsigned (obviously) but -4000 signed. How is that -4000 signed? – trusktr Nov 11 '10 at 00:39
  • aha, that is indeed what is going on here. You shoulda posted an answer! – trusktr Nov 11 '10 at 01:01
0

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.

Ken D
  • 5,880
  • 2
  • 36
  • 58