




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Proceedings of the 2001 Winter Simulation Conference B. A. Peters, J. S. Smith, D. J. Medeiros, and M. W. Rohrer, eds.
This paper describes the use of a particular type of com- puter simulator as a tool for teaching computer architec- ture. The Little Man Computer (LMC) paradigm was de- veloped by Stuart Madnick of MIT in the 1960s and has stood the test of time as a conceptual device that helps stu- dents understand the basics of how a computer works. With the success of the LMC paradigm, LMC simulators have also proliferated. We compare and contrast the cur- rent crowd of LMC simulators highlighting visual features. We found unexpected insights since despite starting with the same paradigm with the same goals, each implementa- tion is distinct with different strengths and weaknesses. It is our intention that interested educators will find this a useful starting point or useful reference for incorporating simulation into their courses.
1 INTRODUCTION
The value of teaching computer architecture and assembly language programming is an old debate that continues to resurface as outside pressures on educational institutions press for market-driven skills based on high-level abstrac- tion. We feel that concrete and rigorous low-level educa- tional experiences are necessary as a foundation before building toward higher-level abstraction. Dr. C. Ravis- hankar, Professor of Computer Science/University of Cali- fornia-Riverside says it clearly, “Information hiding is all very good, but students need to have some information be- fore they can start hiding it.” Computer architecture is also maligned because it is a difficult topic to teach. First, a wide range of skills and de- tails need to mastered – ranging from transistor implemen- tation at the logic gate level up to the architecture of an en- tire computer system (with one measure of scope being the number of transistors under consideration ranging from a few to millions). Second, actual computer system architectures contain characteristics that are (A) unique to the manufacturer; (B)
complex to understand; and (C) cryptically documented. This makes executing laboratory experiments for students a challenge requiring extensive preparation and the result may be skills and knowledge not transferable to other machines. Third, computer architecture is intimidating to most students – while students may have a high level computer literacy of software applications, languages, and peripher- als, many have incomplete, unrealistic, and sometimes pro- foundly strange conceptions of how a computer works un- derneath the cover. Thus, most students are reluctant to figuratively or literally open the computer cover for dis- covery, scared of the binary can-of-worms they do not un- derstand. Lastly, students are crowded with marketing informa- tion about computers from advertisements on television, radio, and magazines. Since students are not informed consumers understanding computer architecture there are two effects: (1) empty or misleading information crowds out useful facts about computer architectures, and (2) stu- dents acquire a false sense of competence due to familiar- ity with computer marketing hype. All is not lost however. Recent textbooks, web re- sources, supplementing traditional lectures with active learn- ing experiences, and the sharing of distributed expertise have empowered educators with new tools and increased the opportunity for student learning of computer architecture (Cassel et al. 2001; Yehezkel, Yurcik, and Pearson 2001). This paper describes the use of visual computer simula- tors as teaching tools for computer architecture. Detractors state that simulation is not as good as the real thing. We agree – simulation can be better than the real thing! For in- stance, assembly language programming can be one of the most user unfriendly human-computer interactions – a com- puter simulator can make assembly language programming more user friendly and even intuitive. A simulator can highlight core computer features of educational value and eliminate unnecessary details unique to a specific manufac- turer. Lastly, creating a computer simulator in software is a cathartic educational experience similar to building a real computer in hardware but less costly in monetary terms,
William Yurcik
Department of Applied Computer Science Illinois State University Normal, IL 61790, U.S.A.
Hugh Osborne
School of Computing & Mathematics University of Huddersfield Queensgate, Huddersfield, HD1 3DH, U.K.
more flexible to allow the students to make mistakes and re- cover, and easily extensible allowing increasing functional- ity upon a core design. Simulators can be built for many different actual machine architectures or general- ized/experimental machines of educational value can be cre- ated by students as projects. The Little Man Computer (LMC) simulators presented here fall under the class of a generalized/experimental machine of educational value.
2 THE LMC PARADIGM
The LMC paradigm was developed by Stuart Madnick and John Donovan of MIT during the 1960s where it was taught to all MIT undergraduate computer science students. The paradigm has stood the test of time as a conceptual device which helps students understand the basics of com- puter architecture. Irv Englander/Bentley College cur- rently has a popular textbook which continues the LMC tradition (Englander 1996; Englander 2000). The LMC paradigm consists of a walled mailroom, 100 mailboxes numbered 00 through 99, a calculator, a two-digit location counter, an input basket, and an output basket. Each mailbox is designed to hold a single slip of paper upon which is written a three-digit decimal number. Note that each mailbox has a unique address and the contents of each mailbox is different from the address. The calculator can be used for input/output, temporarily store numbers, and to add and subtract. The two-digit location counter is used to in- crement the count each time the Little Man executes an in- struction. The location counter has a reset located outside of the mailroom. Finally, there is the “Little Man” himself, depicted as a cartoon character, who performs tasks within the walled mailroom. Other than a reset switch for the loca- tion counter, the only communication an external user has with the Little Man is via slips of paper with three-digit numbers put into the input basket or retrieved from the out- put basket. An instruction cycle takes place as follows:
The instruction could be:
The LMC paradigm is illustrated in Figure 1.
Figure 1: The Little Man Computer Paradigm
The analogy between LMC and real computers is not perfect. In a real computer, memory (mailboxes) are sepa- rated both physically and functionally from the central processing unit (CPU). In most computers, registers are available to hold data temporarily while it is being proc- essed. Although the LMC paradigm has no registers, the calculator display loosely serves the purpose of an accumu- lator. Clock timing and interrupts are not part of the LMC paradigm. Lastly, the LMC instruction set is based on the decimal system, not binary as a real computer would be. In spite of these deviations from reality, the use of this simple but powerful model with a more familiar number system allows students to focus on understanding the tasks being performed in executing instructions rather than the sometimes complex details of a specific manufacturer’s implementation. In addition, the Postroom Computer (see section 3.1) addresses some of these points.
3 MULTIPLE LITTLE MAN COMPUTER SIMULATORS
With the success of the LMC paradigm, LMC simulators have proliferated. The current crowd of LMCs not only captures LMC information processing functionality but also use visual techniques to highlight LMC operation. The goal is to allow student visualization of different parts of the LMC simultaneously to show relationships and thus form student intuition.
registers) and 20 “administrative” registers – program counter, stack pointer, flag register, MAR, MDR, I/O buffer registers etc. The ten addressing modes are:
3.1.3 Postroom Input/Output Extensions
The third dimension in the design space is provided by the Postroom Computer's I/O model. In the basic Postroom Computer an I/O instruction ( INP [input] or OUT [out- put]) is executed, just like any other instruction, as an atomic action – i.e., execution of the program is suspended until the input or output is complete. This is implicitly a form of busy wait I/O. In the interrupt driven I/O model an I/O instruction will cause an interrupt. An interrupt han- dler must be provided that traps the interrupt and passes the necessary data to the I/O module that will perform the re- quired action. Upon completion of the I/O, the I/O module will cause another interrupt, which must again be trapped by the interrupt handler.
3.1.4 Building a General-Purpose Computer System Based on the Postroom Computer
The Postroom Computer system allows the user to assem- ble, load and trace execution of Postroom Computer pro- grams. A compiler from a simple high level language to Postroom Computer assembler is provided. Different speeds of Postroom Computer components can also be modeled. The Postroom Computer Assembler offers all the usual features of an assembler: lexical and syntactic check, symbolic labels, and mnemonics for opcodes, registers, ad- dressing modes and condition codes. Both integer and character data values are supported, and strings are con- verted to sequences of characters. There is also a macro mechanism, including macro parameters, allowing users to program their own macros, e.g. a MUL x y macro for mul- tiplication. Intermediate files are produced at each stage of assembly, and may be preserved for inspection, and for il- lustration of assembly processes – e.g. macro expansion, label generation – to the students. The loader will load a Postroom Computer machine code file and start execution. Upon completion of the pro- gram it will report the number of instructions executed, and may be configured to also report the (virtual) time required for execution. More advanced configuration options allow the user to model differing levels of efficiency for the vari- ous components of the Postroom Computer, defining the (virtual) time taken for, for example, access to registers,
and to cache, main and background memory, and for basic I/O operations. Program execution can be traced. The simplest trace will show the source-code line currently being executed. A more detailed trace is available showing state changes in the machine model. These are expressed using Update Plans: a formal, yet intuitively clear, specification lan- guage for low level activities (Osborne 1992; Osborne 1994; Osborne 1996). Yet more detailed traces are avail- able, describing execution at the fetch/execute level and microcode level. The fetch/execute cycle and microcode are also fully specified in Update Plans. Files of the traces can also be produced for inspection after execution has terminated. Execution may be in burst mode, in which instructions are executed until a HLT (halt execu- tion) instruction is reached, or step mode, in which exe- cution steps through the program one “program unit” at a time. The user may specify the level of the “program unit” to be a single Postroom Computer instruction, a single phase of the fetch/execute cycle, or a single mi- crocode instruction. There is a mechanism using annota- tion of the source code that allows the user to set Postroom Computer instruction level breakpoints. The step level is independent of the trace level, i.e. the user may, for example, step through the program one Postroom Computer instruction at a time, while tracing execution at the fetch/execute cycle level. A compiler is available for a simple imperative lan- guage with if, while, repeat and case statements, primitive and compound types (both standard and user defined), and procedures. The compiler provides lexical and syntactic checking, and type checking in which the user can choose the degree of polymorphism and implicit coercion. Compi- lation is by stepwise program transformation, and each step in the transformation can be inspected by the user, and used for teaching purposes. Currently no attempt is made to optimize the resultant Postroom Computer code. A use- ful exercise for students is to give them the unoptimized code produced by the compiler with the challenge to make it as (space and/or time) efficient as possible.
3.2 Web-Based LMC-
Under the direction of Professors Larry Brumbaugh and William Yurcik of Illinois State University (Yurcik and Brumbaugh 2001; Yurcik, Vila, and Brumbaugh 2000), an interactive LMC simulator (see Figure 3) was developed so that students could visualize simultaneous events occurring during the execution of their LMC assembly language pro- grams. Word of this intuitive visualization spread such that the application was eventually ported to a web-based application implemented in Java embedded within an app- let to provide ubiquitous Internet access. The only user re- quirement is a Java-enabled browser such as Internet Ex-
plorer 4.0 or Netscape Navigator 3.0. Unique features to this web-based LMC-1 simulator include:
Figure 3: A Java Web-Based LMC-1 Simulator
3.3 Web-Based LMC-
Satyanarayana Seethasridhar, under the direction of Pro- fessor M. Dadashzadeh of Wichita State University, has developed a web-based ActiveX LMC-2 simulator, which runs on Internet Explorer (preferred) or Netscape Naviga- tor. This simulator does not attempt to visualize the fetch- execute cycle but does visualize the calculator, in- put/output boxes, location counter, and memory in a simple and intuitive interface. There is no documentation pro- vided but software developer contacts are linked. The Ini- tial screen of the simulator is shown in Figure 4.
Figure 4: An ActiveX Web-Based LMC-2 Simulator
3.4 Son-of-LMC
Alan Pinck of Algonquin College Canada has developed a Son-of-LMC simulator running under Windows 95/98. Son-of-LMC was developed in Visual Basic (v.4) and Dynamic Link Libraries are provided. Unique to Son-of- LMC is visualization of the bootstrap process, subroutine calls, and the linking process. See Figure 5.
Figure 5: The Son-of-LMC Simulator
eled as being in a warehouse at some distance from the postroom (see Figure 8) and direct memory access is dis- cussed.
Figure 8: LMC Background Memory Warehouse Model
The fully specified and traceable fetch/execute cycle and microcode levels enable these concepts to be related directly to the LMC model. The microcode implementation is based on RISC architectures and although its implemen- tation is currently sequential, it will in future be pipelined providing a Postroom Computer example of this type of architecture. The flexibility of different LMC implementations makes a large range of realistic programming exercises possible. Students have in the past successfully undertaken the following exercises:
5 FUTURE LMC SIMULATOR DEVELOPMENTS
Predicting the future is always problematic but we attempt some educated guesses on subsequent LMC simulator de- velopments. Combining the intuitive user interface design of web-based Java LMC-1 with the more developed un- derlying processing capabilities of the Postroom computer would be the LMC simulator state-of-the-art circa 2001. A wish list for extensions to the 2001 state-of-the-art include:
The ultimate aim: to provide a computer architec- ture/low level programming paradigm that can take students from their first elementary school introduction to “how do computers work?” through first year undergraduate Com- puter Systems Architecture 101, to more advanced under- graduate modules on compiler construction, advanced archi- tectures and networks. Ideally a future LMC could be formally specified using Update Plans giving not only a “megaLMC” but also the first, as far as the authors are aware, example of a system fully specified and validated from high level code/operating system down to logic gates.
6 SUMMARY
This paper summarizes the use of a LMC simulator as a visual tool to teach computer architecture. We emphasized that there is a crowd of different LMC simulators and we described and compared the LMC simulators known to the authors. We actively encourage other LMC developers to contact us so that the crowd is complete but we realize this may be a never-ending task. Thus this paper is snapshot in time of the current evolution of a long-lived and successful teaching paradigm that shows survivability into the fore- seeable future. The authors also encourage anyone with knowledge of related computer simulator projects to con- tact them.
ACKNOWLEDGMENTS
The first author would like to thank Larry Brumbaugh and Rahul Gedupudi who contributed insights into developing computer simulators and in many ways helped stir up the current crowd of LMC simulators. The second author would like to thank the University of Huddersfield for the Teaching Fellowship funding pro- vided in 1999/2000 for the development of the Postroom Computer.
Cassel, L., D. Kumar, K. Boulding, J. Davies, M. Holliday, J. Impagliazzo, M. Pearson, G. S. Wolffe, and W. Yurcik. 2001. Distributed Expertise for Teaching Computer Organization and Architecture. ITiCSE Working Group Report, [to appear] ACM SIGCSE Bulletin ]. Englander, I. 1996. The Architecture of Hardware and Sys- tems Software. John Wiley & Sons , first edition. Englander, I. 2000. The Architecture of Hardware and Systems Software. John Wiley & Sons , second edition. Osborne, H. 1994. Update Plans. In Proceedings of the 25 th Hawaii International Conference on System Sciences , IEEE Computer Society Press: 488-496. Osborne, H. 1992. Update Plans – A High Level Low Level Specification Language. PhD. Thesis, University of Nijmegen, Toernooiveld 1, Nijmegen, The Nether- lands. Osborne, H. 1992. Update Plans for Parallel Architectures. In Abstract Machine Models for Parallel and Distrib- uted Computing (Proceedings of the Third Abstract Machines Workshop, Amsterdam), IOS Press. Yehezkel, C., W. Yurcik, and M. Pearson. 2001. Teaching Computer Architecture with a Computer-Aided Learn- ing Environment: State-of-the-Art Simulators. In Pro- ceedings of International Conference on Simulation and Multimedia in Engineering Education (ICSEE) , Society for Computer Simulation Press. W. Yurcik, and L. Brumbaugh. 2001. A Web-Based Little Man Computer Simulator. In Proceedings of the 32 nd ACM SIGCSE Technical Symposium on Computer Science Education , ACM Press: 204-208. W. Yurcik, J. Vila and L. Brumbaugh. 2000. An Interac- tive Web-Based Simulation of a General Computer Architecture. In Proceedings of IEEE International Conference on Engineering and Computer Education (ICECE) , IEEE Press.
AUTHOR BIOGRAPHIES
WILLIAM YURCIK is an Assistant Professor of Applied Computer Science at Illinois State University. His re- search interests are system survivability and simulation education. He is a member of ACM, IEEE, SCS, and is the creator of the Simulation Education Homepage. His Email address is .
HUGH OSBORNE is a Senior Lecturer of Computer Science at University of Huddersfield. His research interests are in formal methods and specification systems. He is a member of NVTI (Nederlandse Vereniging voor Theoretische Informatica: The Dutch Association for Theoretical Computer Science). His email address is .