Two’s compliment Flashcards
What does a 1 at the start of a binary number represent
A negative number
What does a 0 at the start of a binary number represent
A positive number
What is +1 in binary (8 digits)
0000 0001
What is -1 in binary (8 digits)
1111 1111
How to convert positive binary to negative binary (8 bit)
128 - number
Answer - closest bit repetitively until 0
How to subtract two binary numbers
Convert one to negative and then do addition
Unsigned binary vs signed binary
Unsigned binary is always positive
Signed binary can be positive or negative depending on the largest value
What mathematical operations can processors carry out
Only addition
How do processors subtract numbers
By converting one number to a negative and adding them together
Another way to convert to a negative binary number
Find the number’s unsigned binary number
Put a 1 at the largest bit
From the right, keep everything the same until the first 1
After the first 1, swap every 0 for a 1 and every 1 for a 0