Skip navigation

Tag Archives: integers

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.16:

Assuming w = 4, we can assign a numeric value to each possible hexadecimal
digit, assuming either an unsigned or two's-complement interpretation. Fill in
the following table according to these interpretations by writing out the nonzero
powers of two in the summations shown in Equation 2.1 and 2.2 (in the book pg 52).



  Hexadecimal  Binary     Unsigned         Signed
  -----------------------------------------------------
       A        1010   2^3 + 2^1 = 10  -2^3 + 2^1 = -6
  -----------------------------------------------------
       0
  -----------------------------------------------------
       3
  -----------------------------------------------------
       8
  -----------------------------------------------------
       C
  -----------------------------------------------------
       F
  -----------------------------------------------------


Answers:

  Hexadecimal  Binary                    Unsigned         Signed
  -------------------------------------------------------------------------------
       A        1010               2^3 + 2^1 = 10                 -2^3 + 2^1 = -6
  -------------------------------------------------------------------------------
       0        0000                       0 =  0                          0 =  0
  -------------------------------------------------------------------------------
       3        0011               2^2 + 2^0 =  3                  2^2 + 2^0 =  3
  -------------------------------------------------------------------------------
       8        1000                     2^3 =  8                       -2^3 = -8
  -------------------------------------------------------------------------------
       C        1100               2^3 + 2^2 = 12                 -2^3 + 2^2 = -4
  -------------------------------------------------------------------------------
       F        1111   2^3 + 2^2 + 2^1 + 2^0 = 15    -2^3 + 2^2 + 2^1 + 2^0 =  -1
  -------------------------------------------------------------------------------


Advertisements