Information and commands are encoded or represented in a computer through binary (0s and 1s), with the smallest unit called a bit, which signifies either 0 or 1 (on or off).
Binary Representation of Negative Numbers:
A negative number can be depicted in binary, where the most significant bit (the leftmost bit) denotes the sign of the number (0 indicates positive and 1 indicates negative). This is known as the "Sign Bit".
In essence, negative integers can be represented using one's complement or two's complement.
1. Sign and Magnitude:
This is the simplest method. You use the first bit (leftmost) as a sign bit:
0 means positive.
1 means negative.
The remaining bits represent the magnitude (absolute value) of the number.
2. One's Complement: In this system, negative numbers are formed by flipping all bits of the positive version of the number.
Step 1:
+11 = 00001011.
Step 2:
Invert all the bits.
Inverting the bits entails switching each bit to its opposite is equal to 11110100.
3. Two's Complement: This is the most widely used method in computing today.
Step 3:
Add a 1 bit to the right side to get the two's complement.
= 11110100
+
1
The resulting value is:
= 11110101.
Thus, -11 is represented in binary as:
-11 = 11110101.
5. 8-bit Binary Representation of -11. Answer is 11110101. (This is how most modern computers store -11.)
6. Convert That Binary to Hexadecimal
We now convert 11110101 (8-bit binary) into hexadecimal:
Step 1: Break it into two 4-bit groups:
1111 0101
Step 2: Convert each group to hex:
1111 = F
0101 = 5
So, the hexadecimal equivalent of -11 is:
F5