Computer Science 161.01

Professor Valente

 

Homework 3:  50 points

Due Wednesday September 19th at 9:30 AM

 

Arithmetic and Logic Type Problems

 

SHOW ALL WORK IN ORDER TO RECEIVE FULL CREDIT

 

 

1.  (20 points) For each of the following problems, first convert each operand to 8-bit binary numbers (two’s complement), then perform a column-by-column addition in binary, then convert the binary answer to a two’s complement decimal integer.  Do not expect the correct answer of 137 to to appear when converting the 8-bit “answer” in part c.

 

a) 19 + 23                  b)  -19 + 23             c)  32 + 105              d)  -32 + 105

 

 

2. (30 points) Do the following hex operations and express the answers in hex.

 

            a)  1A + E7     b)  1A AND E7   c)  NOT(B0) 

 

      d)  99 AND 00   e)    99 AND FF   f)  NOT(99) 

 

      g)  99 OR 99    h)    99 OR FF 

 

      i)  99 XOR 99    j)    99 XOR FF