Computer Science 220
Assembly Language & Computer Architecture

Fall 2010, Siena College

Lecture 02: Binary Arithmetic; Signed Representations; Signed Arithmetic
Date: Thursday, September 9, 2010

Agenda

Lecture Assignment 02

Due at the start of class, Tuesday, September 14.

Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to jteresco AT siena.edu by the start of class. We will discuss these questions at the start of class, so no late submissions are accepted.

  1. Represent each of the following quantities using each of the following 8 bit representations, where possible: unsigned, signed magnitude, 1's complement, 2's complement. Values are given in base 10, and characters are ASCII. Express each as both an 8-bit binary number and a 2-digit hexadecimal number.
    For example, to represent the value -17, the unsigned representation is not possible, the signed magnitude representation is 100100012 or 9116, the 1's complement representation is 111011102 or EE16 and the 2's complement representation is 111011112 or EF16.
  2. Compute the following binary 2's complement problems in 4 bits. Which answers to you trust and why (your reasons should refer to values that can easily be checked by computer such as values of carry bits)?
     0001      0001      1001      1111
    +0101     +0111     +1111     +0101
     ----      ----      ----      ----
    
    
  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
    ----      ----      ----      ----     ----     ----