OverviewScheduleResourcesAssignmentsHome

CSC 221: Computer Organization, Spring 2006

Assignments

Monday, February 6:
Chapter 2, Exercises 2, 3, 7, and 8
Monday, February 13:
Chapter 3, Exercises 20, 23, 25, 27, 36, 39, 48, and 49
Wednesday, February 22:
Chapter 4, Exercises 4, 6, 9, 14, and 15
Monday, March 6:
Chapter 5, Exercises 8, 9, 12, 16, 19, 24, and 28
Monday, March 20:
Chapter 6, Exercises 4, 13, 15, 24, and 26
Friday, April 7:
Programming Project: Translate the following C++ program into Pep/8 assembly language and test it on the Pep/8 simulator. Your testing should be thorough enough to convince yourself that the translation has been done correctly and that the program has no bugs. The action of the program should be to read a list of integers from input, terminated by -9999 (which is not included in the list). It should then print the list in non-decreasing order on the output, then stop. The only limit on the size of the list should be the number of linked-list nodes that can be allocated in memory (without running into the stack... -- for extra credit, calculate exactly how large the list can be for your implementation). Credit will be based on both correctness and readability.
#include <iostream>
using namespace std;

struct node {
    int data;
    node *next;
};

node *insert(int x, node *head)
{
    if (head == 0 || head->data >= x) {
        node *p = new node;
        p->data = x;
        p->next = head;
        return p;
    } else {
        head->next = insert(x, head->next);
        return head;
    }
}

node *read()
{
    node *result = 0;
    int n;
    cin >> n;
    while (n != -9999) {
        result = insert(n, result);
        cin >> n;
    }
    return result;
}

void write(node *head)
{
    while (head != 0) {
        cout << head->data << endl;
        head = head->next;
    }
}

int main()
{
    write(read());
    return 0;
}
				
Wednesday, April 19:
Chapter 10, Exercises 1, 2, 16efg, 17efg, 21cde, 22cde, 23cde, 27cde, 28cde, 31cde, 32cde, 36d, and 46
Wednesday, May 10:
Chapter 11, Exercise 16, except have 8 states (000 through 111) instead of 4, and build the circuit in Logisim.
For Extra Credit, complete the 7-segment decoder from class and incorporate it in the circuit so it will display numbers from 0 to 7 when counting.
OverviewScheduleResourcesAssignmentsHome

Valid HTML 4.01!Valid CSS!DePauw University, Computer Science Department, Spring 2006
Maintained by Brian Howard (bhoward@depauw.edu). Last updated