Using a six-bit representation of one and two additions, I am trying to solve the following problem:
12 - 7
Now I take 12 binary and 7 in binary format.
12 = 001100 - 6 bit
7 = 000111 - 6 bit
Then, if I flipped a bit for two additions and added one?
12 = 110011 ones complement
+ 1
-------
001101
7 = 111000 ones complement
+ 1
---------
111001
then add these two additions together
001101
+111001
1000110 = overflow? discard the last digit? If so I get 5
Now, if I have a number like
-15 + 2
Then I would add the sign value on the MSB if it is zero?
as:
-15 = 001111 6 bit
Would I add 1 at the end here before flipping the bits?
= 101111
user249375
source
share