Tue, 10 Sep 2013, 01:01



One more thing, I told you that the negative numbers were specified by
choosing bit patterns such that when I add +A to -A, I will get 0.  That
is true!  BUT, there is a useful shortcut, and my TAs ganged up on me and
told me I better show it to you.  So, here goes:

Take the 6 bit positive number 011101.  It is +29.  What is the
representation for -29.  What would happen if I add to 011101 the
representation with all bits flipped.  That is 100010.

011101
100010
-
111111

What if I add to this 000001?

111111
000001
-
000000

I started with +29, which is 011101.  I added the value obtained by
"flipping all the bits" and then added 1 to it.  My result is 0.

Therefore, -29 must be "all bits flipped" +1.  That is, 

100010
000001
-
100011

Try it:

011101 +29
100011
-
000000

So, -29 is 100011.  The negative of this must be +29.

Flip all the bits and add 1.

011100
000001
-
011101

And I am back to -(-29) = +29.

OK?

See you on Wednesday.

Yale Patt