Chapter 2 Flashcards
1
Q
How is the number -x represented using 2’s complement?
A
-x = 2n-x
(Where n = the number of bits used to represent numbers).
(( in the picture: n = 4 ))
2
Q
What is the algorithm for adding 1 to a binary number?
What is the algorithm for subtracting 1 from a binary number?
A
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.
3
Q
What is the binary representation of Not(x)?
A
Not(x) = -x-1
4
Q
How do the ALU’s control bits control what the ALU computes?
A
5
Q
A