Skip navigation

This solution is for the book I am currently reading. All of my notes and solutions are available at Google Code.

Here is my work for problem 2.19:

Explain how Equation 2.4 applies to the entires in the table
you generated when solving Problem 2.18

You simply add 2^w where w = number of bits to convert to
the two's complement value to convert to unsigned if two's
complement of x is a negative value (most signficant
bit is flipped).


  x   T2U₄(x)
 -------------
 -8     8       1000    2^3        = 2^4 + -2^3
                          8        = 16 - 8

 -------------
 -6    10       1010    2^3 + 2^1  = x + -2^3 + 2^1
                           10      = x + -6
                           16      = x
                           2^4 = 2 * 2 * 2 * 2 = 16

 -------------
 -4    12       1100     2^3 + 2^2 =  2^4 + -2^3 + 2^2
                          8  +  4  =  16 +   -8  + 4
                            12     =  16 + -4 =

 -------------
 -1    15       1111   2^3 + 2^2 + 2^1 + 2^0 = 2^4 + -2^3 + 2^2 + 2^1 + 2^0
                        8  +  4  +  2  +  1  =  16 +  -8  +  4  +  2  +  1
                          12     +     3     =     8      +       7
                                 15          =         15
 -------------
  0     0
 -------------
  3     4
 -------------




Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: