There are a couple of methods of doing so.
One is to use a sign bit,
where the MSB represents the sign (1 meaning negative. Thus 01 would represent
+1 and 81 would represent -1 for two digit Hex numbers
Another is two's
complement. Here you invert all the bits and then add 1 to the result. thus 01
still represents +1 and FF represents -1.
The advantage of two's
complement is that it is easy to do with logic gates, and gives a result that
you can add directly. For example, FF + 01 =00 (ignoring the carry)
other examples:
0C + FA = 07 (12 + (-5) = +7)
05 + F3 = F9
(5+(-12) =-7)
Now you know negative hexadecimal numbers.
how would you convert a negative number into a hexadecimal format?
One is to use a sign bit,
where the MSB represents the sign (1 meaning negative. Thus 01 would represent
+1 and 81 would represent -1 for two digit Hex numbers
Another is two's
complement. Here you invert all the bits and then add 1 to the result. thus 01
still represents +1 and FF represents -1.
The advantage of two's
complement is that it is easy to do with logic gates, and gives a result that
you can add directly. For example, FF + 01 =00 (ignoring the carry)
other examples:
0C + FA = 07 (12 + (-5) = +7)
05 + F3 = F9
(5+(-12) =-7)
Now you know negative hexadecimal numbers.
how would you convert a negative number into a hexadecimal format?