Vous êtes sur la page 1sur 1

Homework 1

EECS 203

1. (20 pts.) Please explain what is a computer, what is a computation, how a computer can be implemented, and
what components are needed in a computer?
2. (20 pts.) A hour clock is a clock with only the hour reading, that is, it goes from 1 to 2, then 3, 4, ..., till 12, and
then back to 1. Based on our definition of computer, is a hour clock a computer? Given a memory cell and any
functional units you specify, implement a hour clock.
3. (30 pts.) At cross streets, traffic lights are essential for controlling traffic to avoid collisions. Normal traffic
lights consist of two sets of three lights: red, yellow, and green. Based on our definition of computer, is a set of
traffic lights a computer? Given 3 memory cells, any functional units you specify, and two sets of red, yellow,
and green lights, implement a set of traffic lights.
4. (30 pts.) Please note that Euclid’s algorithm can be modified as follows:

put a and b into memory x and y;


while (y 6= 0) {
x:= IF (x ≥ y) THEN x − y ELSE y
y:= IF (x ≥ y) THEN y ELSE x
}
output x;

Run this algorithm by hand on the input of 27, 45 to convince its correctness. Then please use two memory cells
and any functional units you specify to implement this GCD computer.

Vous aimerez peut-être aussi