Homework 1

22C:122, Fall 1998

Due Monday Aug 31, 1998, in class

Douglas W. Jones

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list!

This assignment is dominated by review questions that are not as much specific to the material in the book as they are to material you should have learned in prior courses or work experience.

  1. What is your E-mail address? (If you have more than one, give the address you'd prefer used for class purposes.)

  2. Background: Look at the Programmer's Reference Manual for the CDC-160, indexed from the course web page http://homepage.cs.uiowa.edu/~dwjones/arch/. This web page documents the architecture of the CDC 160, one of the first transistorized computers to begin mass production.

    The Problem: Ignoring questions about I/O or word size, what features that you expect to find on a modern CPU were missing from the instruction set of this machine? Please mention only those features that would cause severe problems for you as an assembly language or machine language programmer!

  3. Background: Many computes contain a general purpose Arithmetic Logic Unit, or ALU. A typical ALU would have, as inputs, two single-word operands A and B, and a carry-in bit, plus a function-select input. As outputs, the ALU would deliver a carry-out bit and the result F of applying that operation.

    For this assignment, assume that our ALU has a 3-bit function select input with the following functions:

      000 F = 0
      001 F = A - B
      010 F = B - A
      011 F = A + B
      100 F = A xor B
      101 F = A and B
      110 F = A or  B
      111 F = -1
    
    Assume two's complement arithmetic, and assume that, for subtraction, the a 1 on the carry bit means "do not borrow", while a zero means "borrow".

    The Problem: Give a truth table for a one bit bit-slice of this ALU. This will have, as inputs, one bit from each of the A and B operands plus a carry-in bit, and it will have, as outputs, one bit of the result F and a carry-out bit.