In an 8-bit system, the order is:
128, 64, 32, 16, 8, 4, 2, 1
Add the numbers with 1 below them.
Find the number in the 8-bit system that is higher than the rest but lower than the denary number.
For example, 78. 128 is too high. 64 is right.
78 - 64 = 12. 32 and 16 are both too high. 8 is right.
12 - 8 = 4. 4 is right.
4 - 4 = 0
Then, with the numbers that you used to subtract, put 1s under it.
01001100 is 78 in binary.
Remember the digits in hexadecimal:
1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Split the 8-bit binary in half:
01001100 becomes 0100 and 1100
First half is 4 in denary. Second half is 12 in denary.
There is no 12 in denary. In hexadecimal, that is C.
01001100 to hexadecimal is 4C.
Split 4C in half like in binary.
First half is 4 and second half is C.
4 is 0100 in binary and C is 1100 in binary (because C = 12, and 8 + 4 = 12) .
Put them together to make 01001100.
0 + 0 = 0
0 + 1 = 1 or 1 + 0 = 1
1 + 1 = 1 carry 1
If there are more than 8 bits, it is called overflow.
Using 01001100 as an example.
Flip all bits in 01001100.
01001100 becomes 10110011.
Add 1 to the inverted bits, 10110011.
10110011 + 00000001 = 10110100
The answer is -76 because:
-128 + 32 + 16 + 4 = -76
In two’s complement, the furthest bit (in this case 128) because negative. Not sure why but I’m guessing it’s just to make the denary negative. Just remember that for the exam.
Every bit moves to the left. Bit on the far left is removed and a 0 is added to the farthest right of the binary.
For example, 01001100 shifted to the left once is 10011000.
Logical left shifts multiply the denary number by 2.
Proof: 01001100 is 76 in denary. 10011000 is 152. 152 / 2 = 76. 76 has been doubled when shifted to the left.
Opposite of logical left shifts. Binary shifts to the right. Farthest right bit is dropped, a 0 is added in the farthest left.
For example, 01001100 shifted to the right once is 00100110.
Logical right shifts divide the denary number by 2.