Computer Science 324
Computer Architecture

Mount Holyoke College
Fall 2007


Lecture 02: Computer Arithmetic, Bitwise Operations
Date: Monday, September 10, 2007


Agenda

Examples

Lecture Assignment

Due at the start of class, Wednesday, September 12.

Turn in short answers to these questions. Please turn in a hard copy (typeset or handwritten are OK). We will discuss these questions during class, so no late submissions are accepted.

The readings for next time are P&H Sections 2.1-2.3, and the first part of my notes on the MIPS ISA.

  1. Compute the following binary 2's complement problems in 4 bits. Which answers to you trust?
     0001      0001      1001      1111
    +0101     +0111     +1111     +0101
     ----      ----      ----      ----
    
    
    
  2. Compute the following binary 1's complement problems in 4 bits. Which answers do you trust?
      0001      0001      0000      1000
     +0101     +0111     +1111     +1111
      ----      ----      ----      ----
    
    
    
  3. The following problems are expressed in 8 bit, hexadecimal, 2's complement. Compute the result as 16 bit 2's complement expressed in hex. Which answers do you trust?
      FF        FF        01        4c       7f       80
    + 11      + FF      + 7F      x 04     x 7f     x 80
    ----      ----      ----      ----     ----     ----
    
    
  4. (Moved to next lecture assignment)
  5. True or false: The signed product of two signed n-bit numbers can always be correctly expressed as a signed 2n-bit number. Justify your answer.