3-digit 16’s/15's complement representation of a negative number?

539 Views Asked by At

I have been trying to solve the following questions.

  1. What is the following is the 3-digit 16’s complement representation of -12810.
  2. What is the following is the 3-digit 15’s complement representation of -25110?

I got a result of 80H for the first question. But the answer sheet says the answer is F80H instead. I took the twos complement of 128 and convert it to hex accordingly.

What is the correct method/steps required to convert a negative decimal to an N complement's form?

1

There are 1 best solutions below

0
On

I managed to dig out a StackExchange post which had an algorithm for such problems.

$$-(Number) \equiv Complement^N- Number = Complement's \: representation.$$ Hence $$-128 \equiv 16^3 - 128 = 3968 \: or \: F80H $$ Where N is the number of digits.