CS 61 - Computer Organization & Assembly Language

Assignment 1 - due Saturday July 30, 2005 11pm

In this programming assignment, you will be required to write a C++ program that treats basic data types as binary numbers and performs bitwise manipulation.

Your program must work as follows:

  1. Input three 8-bit binary numbers from the user as strings.
  2. Convert these strings into 8-bit Two's compliment numbers stored as char's
  3. Perform the boolean function:

    f(x, y, z) = NOT ( (x AND y) XOR z )

    and output the result in binary and decimal.

You must implement the following functions:

If each input given is not exactly 8 binary bits, your program can report an error and exit.

What to turnin

Turn in both you C++ source code and a Makefile that will compile the code.