How is the number -x represented using 2’s complement?
-x = 2n-x
(Where n = the number of bits used to represent numbers).
(( in the picture: n = 4 ))
What is the algorithm for adding 1 to a binary number?
What is the algorithm for subtracting 1 from a binary number?
Move from right to left.
To add 1:
Flip all the digits until you have changed a 0 to a 1.
To subtract 1:
Flip all the digits until you have changed a 1 to a 0.
What is the binary representation of Not(x)?
Not(x) = -x-1
How do the ALU’s control bits control what the ALU computes?