The University of Texas at San Antonio Computer Science Program offers a sophomore-level course called Computer Organization II which is required of all undergraduate computer science majors. We use the text Structured Computer Organization by Tanenbaum [8]. The background of the students taking this course includes an introductory course in which they learn to program in C, a data structures course, also in C, and a circuit design course. The course covers CPU organization, the instruction cycle, memory, microprogramming, instruction formats and types, addressing, assembly language and RISC machines. We use the Intel 80x86, the Motorola 680x0 and the SPARC microprocessors as case studies. The course includes a segment on assembly language programming using the SPARC assembly language [5].
The most difficult material in the course is the microprogramming covered in the Tanenbaum book in chapter 4. Students who understand microprogram control develop a fundamental understanding of how a CPU executes a program. This understanding is important for later courses in operating systems and architecture. Unfortunately few students are able to master the material from lecture presentations alone. They are confused by the presence of two instruction cycles (microprogram and conventional machine level) and have difficulty understanding the timing of the microprogram instructions themselves. Students clearly need hands-on experience with this material. Exercises in the Tanenbaum book include translation of assembly language into microcode and addition of new assembly language instructions to the machine. Assignments of this type do not give students a sense of the execution timing.
The traditional approach to overcoming these pedagogical difficulties is for the instructor to provide hardware or a simulator for student experimentation [1,2,3,4,6]. The student then views the state of the machine during execution. Fuchs et al. [3] describe a microprogramming simulator which they have successfully used to enhance learning in an introductory computer engineering course. They introduce an instructional microprocessor simulation which has a graphical user interface. The students can write assembly language or microcode for this target machine and the tool simulates its execution. Their approach is a definite improvement over pencil and paper simulation and is particularly useful if the goal is to teach students how to write efficient assembly language or microcode.
The goal of a sophomore level computer science course in computer organization is for the students to develop a fundamental understanding of how computers work. In particular, the goal is to achieve an understanding of the instruction cycles of a microcoded Von Neumann machine. At this level, a simulator like the one in [3] does some of the thinking for the students. We have used an alternative approach in which the students write their own simulation. Because the instruction cycle is the key concept in this material, we provide an animation environment using a standard freely-available animation package which allows students to do a full-instruction cycle implementation in a few hundred lines of code. The simulator is organized so that it can be implemented in stages with well-defined milestones. The animated output allows students to see the execution of the machine as they develop code. The project is so clearly-defined that most students are able to complete the simulation. Student comments were extremely positive about the experience. The unique advantages of the approach described here are:
The organization of the paper is as follows. In Section 2 an overview of the simulator is given. The animation interface is described in Section 3, and class assignments are described in Section 4. A discussion of the results is in Section 5. Some examples of Mic-1 and Mac-1 execution are provided in the appendix for readers who are unfamiliar with Tanenbaum's text.