A goal for both on-campus and distance education is how to
provide a quality laboratory experience with limited resources.
One approach that can help is computer simulation, which allows
a student to create a simplified model of a complex system and
observe the consequences. This opens up many possibilities that
can enhance teaching and learning, and can help the student develop
competence in technical problem solving. Until recently, however,
most computer simulations required software available only in
specialized labs on campus. Successful deployment of web-based
computer simulations enables more cost effective delivery of quality
laboratory material to both on- and off-campus students.
This project was supported in part by a grant from the Center for Teaching Excellence at the University of Wyoming. Some of the web pages shown at http://plum.uwyo.edu/~comporgn were developed by Susan McClendon and Russel Ingram. The authors would also like to thank the students in COSC 2150 at the University of Wyoming who have been "guinea pigs" for the web based materials described here.
The Computer Organization class at the University of Wyoming uses
a model of a simple computer to teach students the relationship
between hardware and software. To learn this academic subject
matter, students must understand the concepts of interpreters,
the "fetch/execute" cycle, and machine language. These
concepts, which apply to all computers built during the last half
century, are often difficult for students to learn on a complex
machine like the Pentium(TM). The web-based computer simulator we
built makes these concepts much more understandable. The simulator
gives the student a chance to observe and experiment with a simulated
machine. On the web, the student can manipulate the internals
of an entire computer. For instance, the memory and registers
of the simulator can be changed on-screen, something that would
be impossible with a physical device. Because the material is
web-based, it can be used in both traditional and distance education
Simulation can be used to teach most academic subjects, but
it is especially helpful in subjects like science and engineering
where computer simulations are commonly used by professionals.
from the Internet to simulate the actions of another much simpler
computer. Our purpose for using this simulation is to teach the
enduring concepts of Computer Science. We need to make
a distinction between the Computer Science concepts (such as the
fetch/execute cycle) we are trying to teach and the computer technology
(such as Netscape) that enables us to do so. Our pedagogical
challenge is to use the latest computer technologies (such as
In this regard, the danger we face is the same as anyone who
is trying to use the Internet to teach an academic subject: we
do not want the medium to become the message. But since our subject
is called Computer Organization, we need to emphasize this
We will describe the lessons learned about our simulator from two semesters of experience in the Computer Organization class. In the first semester, many students said that the simulator was somewhat difficult to use. In part this was due to factors beyond our control, such as the limited resources (diskless 386s and 486s running Netscape) available to our students. As to the factors that were within our control, we concluded that part of the problem was that we did not fully exploit the unique properties of our web-based tool. As a consequence of this realization, we created a series of more focused exercises, which we used the second semester. Student reaction to these exercises was favorable. We plan to continue to improve our simulator, and deploy additional exercises based on the positive feedback we have received from students.
I. Simulation Education (read: "Why should I simulate?")
II. Lessons Learned (read: "Was it really that easy?")
IV. Conclusions (read: "What does it all mean?")
V. Students' Comments (read: "How did the students like it?")
VI. References (read: "Where can I find out more?")
VII. Appendix (read: "Tell me more about the PDP-8!")
The practicality of computer simulation (such as the one we implemented) has been made possible by the explosion of Internet access in the last decade. The ability to deliver content without regard to time or location make Internet simulations especially valuable.
The first reason to look at Internet-based simulation is that the cost can be so low. There are three main reasons that simulation is less expensive than the real thing: there is no equipment to buy; there is no equipment to maintain; and access is not restricted by physical equipment locations.
While there are costs associated with the development of simulations, which we will discuss in the next section, the costs of access are relatively low, and dropping all the time. Even if students do not have Internet access in their homes/dormitories, simulations can still be accessed from general purpose labs on campus.
It is important to realize that the cost of using a simulation can be many several orders of magnitude less than the cost of the actual object being simulated. Imagine that a computer science instructor wanted to teach her students about parallel processing. She could simply purchase a top-end supercomputer to demonstrate the concept. Of course, few institutions of higher education could afford such an extravagant purchase for any situation, much less as part of an independent exercise for a single class. On the other hand, with some effort expended by the instructor, a reasonable facsimile of the original supercomputer can be developed. While the speed of the simulation would not approach the speed of the original, the functionality would be available to demonstrate concepts to the students. (Many of our examples come from the realm of computer science, as that is our background, but simulations can just as easily demonstrate chemical processes, geological events, or economic interactions, etc.)
There was an unforeseen cost advantage from our own PDP-8 work. The simulator that we developed mimics equipment that is ideally suited to teach the introductory concepts in our Computer Organization class but that is no longer available through standard purchasing channels. The actual equipment is also fragile and costly to maintain. We now have a mechanism that can overcome some of the limitations imposed by the failure of aging hardware so that the superb design that C. Gordon Bell created three decades ago can continue to illustrate the foundation concepts in Computer Organization.
It is sometimes difficult, especially with swelling class sizes, to find seats for students in front of actual lab equipment. When using the web for deployment, a finished simulation can essentially be distributed to one user or a thousand without an increase in cost.
Simulation education can help overcome problems imposed by time and location as well. Some students, especially students with strict commitments outside of their academic programs (i.e., families, work, etc.), cannot easily bend their schedules around limited lab hours. Students who commute also have trouble with lab locations. In these situations, the ability to use a simulation on the Internet at any arbitrary time and place can be invaluable. With simple and clear online instructions (supplemented by appropriate printed documentation), students can use simulations without much instructor support. Our experience has shown that it can be a task in itself to get students familiar with web tools such as Netscape, and that some instructor interaction will invariably be required.
There are some situations were traditional lab exercises demand a restriction on resources and locations. For instance, certain Chemistry laboratory projects cannot be done without dangerous chemicals and specialized safety equipment that is only available in specific on-campus locations. In those situations it would be impossible to give students the ability to complete projects outside of the lab location. With chemical simulations available on the Internet, and simple to rules to guide a series of reactions for a fixed set of reagents, students can perform reactions that were only previously available in expensive labs with expensive equipment and consumable resources.
While simulations could not, and should not, replace all laboratory
experiences, there are some which are clear candidates for
replacement. In addition to any of those, simulations can be used
to augment almost any existing lab course.
The Computer Organization class at the University of Wyoming gives a student the opportunity to discover for herself the answer to the most important question she can ask about computer science and engineering:
Our web based simulator is designed to expose the student to the details behind this question, and give the student an opportunity to realize what the answer means. This simulator implements the complete instruction set of the PDP-8, a classic small computer that is ideally suited to achieve our pedagogical goals. As the student struggles to understand these details, she may wonder:
Several things became clear to us that first semester we used the simulator.
Although about one half of the class had access to equipment (at home or in restricted labs on campus) capable of running Netscape 3.0 reasonably, the other half had to rely on the facilities provided by our central Division of Information Technology. These later facilities, primarily consisting of diskless 386s and 486s with 640 by 480 video booting from a central server with no laser printers, were just barely adequate to run our simulator. The Division of Information Technology resisted installing Netscape 3.0 on their server for about a month even though Netscape is free to academic institutions.
Some proponents of web-based education advocate that it can be a replacement for printed documentation, such as handouts and textbooks. Perhaps this could be true in an environment with resources to hire enough lab assistants to hold the hands of each student and to provide free laser prints of all HTML pages. In the resource-constrained environment in which we operate, printed documentation is essential. Surprisingly for a sophomore level Computer Science class, many of the students had never used Netscape before. It was necessary for us to spend time in class covering the use of the simulator, and to make handouts that show precisely how to use it. The need for documentation was compounded by the constraints on facilities mentioned above.
As a result of the student feedback, the assignments were modified so that a student used the simulator to conduct more focused experiments with machine language. The student edits (if necessary) the machine language program given by a text box. (The example program given in http://plum.uwyo.edu/~comporgn/web0.html is already correct, and does not need to be edited.) Next, the student sets up the registers appropriately (often by hitting the "ZERO" buttons, although any valid octal value can be entered into each register). Then the student hits the "Load File" button. The student repeatedly clicks on the four steps of the "fetch/execute" flowchart to simulate what the hardware does. Finally, the student fills in a HyperText Markup Language (HTML) form to answer specific questions about what she observed, and submits answers to the instructor via email. Student comments relating to these more focused experiments are given in section V.
While the new assignments are more focused than the original ones, they are still much more open ended than the typical drill and practice that one finds on the web. This is possible because the simulator allows the student the opportunity to observe how the simulated computer will malfunction when the student makes a mistake. This also allows students to find different ways to solve the problem; they are not forced into specific conclusions.
A top priority for future work is to merge the simulator and assembler into a single web page. Instead of making the student copy the object code into the "Load File" text box, the assembler will directly put the object code into the simulator's memory. The problem with doing this is that there is not room on the screen for everything. To overcome this, we propose making one of the frames scrollable with the assembler and other new options hidden below the visible screen. Also, we may stop supporting the lowest resolution display (640 by 480) that the current simulator supports.
A related goal is to put the textbook on-line, with object and assembly code examples linked to the simulator/assembler the same way the proposed assignments will be. This will allow a student who does not understand a particular example in the textbook to try it out interactively simply by clicking on a link.
The current simulator only supports polled input and output. An important topic in the Computer Organization class is interrupts. We hope to expand the simulator to provide a good visualization of how interrupts are processed.
We currently provide the student feedback about grades with a web page that is a mixture of CGI and email. The student enters her email address, and the CGI script validates the student is currently enrolled in the course. If it is valid, the CGI script sends an email message to the student with current grade information. We choose this solution because it is at least as secure as a fully CGI solution (that provided instantaneous feedback with passwords maintained in the CGI server) without our having to maintain passwords. (The passwords for email are maintained by our central Division of Information Technology. ) The grade information is manually downloaded from a spreadsheet, and is not automatically tied to our simulator. An area for future investigation would be to have simulator assignments be automatically graded and recorded.
Lower priority issues that may be addressed in the future include making the simulator/assembler support multiple platforms (Intel, Macintosh, and UNIX) and multiple browsers (Netscape and Internet Explorer). Although the current simulator runs on Internet Explorer, the appearance of the "pseudo-keyboard" is very unattractive with that browser. A low priority goal is to make a version that looks better on Internet Explorer (perhaps using the image of a keyboard instead of the current buttons, which Internet Explorer refuses to treat reasonably.) A reduced version of the current simulator runs on Macintosh, but the memory requirements of the current version used by students are too large for the Macintosh. Many of the assignments do not need all of memory, and so it may be possible to provide versions that work on with Macintosh. Also, students have complained that the simulator is not usable with browsers provided by commercial services, such as America Online. It is unclear whether we will ever have the resources to support all these platforms.
Currently, the student has two choices to run a PDP-8 program:
by clicking on the buttons that represent the steps of
the fetch execute cycle (which we used exclusively
during the second semester); or by clicking on the RUN button (which
executes many instructions per second). The latter gives too
much detail for large programs, but the former may not give enough.
A low priority area for future work is to include more options
for simulation, such as allowing a student to choose between speed
and visual effect. For large simulations, it might be helpful
to turn off all display, but early in the semester the visual
effects are important. A related idea is to use the timer capabilities
at a slow enough pace (say every two seconds) for the student
to visualize what is going on.
The ability to develop effective teaching tools quickly and cheaply is critical to effective roll-out of Internet simulations. If simulations cannot be developed with a minimum of expense in time and resources, they do not deliver a net gain to instructors or users.
With a code base developed over a few months time, we have been able to develop simple extensions and changes to existing simulations literally in a matter of minutes. While it is not realistic that all developers could do things so quickly, with some effort even novice programmers can develop web-based simulations in a short time. We will walk through a short example that shows how a simple concept can be delivered to the students via the Internet.
The first thing that has to be done with this quadratic equation
solver is to allow for user input. The inputs in this case are the
coefficients of the x terms. The interface is a simple text box
or programming, just the HTML:
Enter Coefficient of X^2 here --> <INPUT TYPE=text SIZE=5 NAME=inputbox1 value=0><P>
Enter Coefficient of X here ----> <INPUT TYPE=text SIZE=5 NAME=inputbox2 value=0><P>
Enter Constant here ------------> <INPUT TYPE=text SIZE=5 NAME=inputbox3 value=0><P>
These few lines of HTML are enough to set up a typing area for
the coefficients of the quadratic. The second step of the process
is to set up a space for the outputs, the roots of the equation.
It only takes a few lines of HTML to do that as well:
Root1 --> <INPUT TYPE="text" SIZE=50 NAME="outputbox1"><p>
Root2 --> <INPUT TYPE="text" SIZE=50 NAME="outputbox2">
With the input and output fields ready for use, the only thing
remaining is the activation key. In this case, we have chosen
a simple button with the label "SOLVE." Once again,
button. However, there is an additional bit of code that causes
<INPUT TYPE=button VALUE="SOLVE"
The VALUE="SOLVE" in the above code indicates
that the text "SOLVE" will appear on the face of the
button. This is still part of standard HTML. The code also tells
the button what to do when it is clicked. It should run the function
"solve_quad," using the current page as the scope (indicated
by the "this.form" argument to the function). After
the user enters the coefficients of the quadratic equation and clicks on
Lines 10 and 11 perform a simple error check on the input data. The location "form.inputbox1.value" is an HTML location. It was created in the first lines of code included in this example. The comparison functions, as with the rest of the syntax, is similar to the C language.
Lines 13 and 14 warn the user if she did not input a quadratic equation. The input testing is by no means complete, but should give the reader a feel for the programming possibilities. The "alert" call sends a message to the user if her input values were not correct. On line 15, there is a "return" statement that ends the execution of the function, just like C.
Lines 19, 20, and 21 convert the input values into numeric values and stores them in temporary variables. While the conversion might not be necessary, there is a risk that the values will be treated as simple strings and not numeric values. The use of the built-in "parseFloat" function (for real numeric values) assures that the values placed into the variables will be numeric. There is a similar "parseInt" function for integer values which we do not need here, but which is very useful in our simulator.
Lines 27-28 and 32-35 show how easy it is to generate the output.
By simply assigning a value to the HTML location specified by
"form.outputbox1.value," the user sees the result of
the calculation performed by the script.
simulator is a powerful teaching tool for Computer Science concepts.
We believe that it should be possible for teachers in other disciplines
Given its low cost and wide
such educational simulators on the web.
The PDP-8 was designed by C. Gordon Bell (perhaps the most brilliant computer designer in history) in 1965 for Digital Equipment Corporation (DEC). It continued to be produced in three decades. It single-handedly transformed the computer industry from a niche market to a mass market. It paved the way for the introduction of the more complex microprocessor by Intel in 1971, from which today's Pentiums are descended. The reason for choosing the PDP-8 for this course is its simplicity and elegance. These attributes make it the ideal vehicle to explain the universal nature of computers to students in Computer Organization.
A computer is a machine that processes information. Because a computer is a machine, it is constructed by connecting certain hardware components:
The memory of a computer contains the data it manipulates, and the machine language program that instructs the computer how to manipulate that data. The idea that programs can be stored in the same memory as data originated in the 1940's, and has been used in almost all computers since then.
All computer organize memory as an array of words, where in turn each word is an array of bits . In the case of the PDP-8, the memory is composed of 4096 words, and each PDP-8 word contains 12 bits. So, in total, the PDP-8's memory contains 49,152 bits of information. In contrast, the typical memory attached to a Pentium(TM) contains about one hundred million bits. Although the PDP-8's memory seems paltry in comparison, the PDP-8's memory is more than enough to do practical programming, and to contain programs that illustrate the important concepts taught in Computer Organization.
Each PDP-8 word can store a single integer between -2048 and 2047 or alternatively a single unsigned integer between 0 and 4095. Also, rather than storing data, a word could be an instruction. In any case, the contents of memory is shown by the simulator in octal notation, between 0000 and 7777.
One way in which the simplicity of the PDP-8 is obvious is with the set of registers required to build the machine. The central processing unit of the PDP-8 primarily consists of the following registers:
There are a few additional minor details (Link, Interrupt Enable, and HALT), but in essence, that is all there is to the PDP-8. One of the constraints faced by anyone developing web based material is the "real estate" available on the screen. The above registers all fit in a small portion of the upper left corner of our PDP-8 simulator. Part of the beauty of the PDP-8 is that its entire operation at any instant in time can be summarized by such a small amount of information.
Although this is clearly an advantage for us as we implement the simulator, it is also an advantage for the student as she learns the material. Because there are fewer arcane details, there is less to memorize. Therefore, the student is more successful at memorizing what constitutes this machine language. All computers have a program counter and instruction register of some sort, and memorizing that they exist reinforces the universal ideas that are at the heart of the course. The only other main register is the AC, and so the PDP-8 is often known as a single accumulator machine.
Such single accumulator machines predominated the industry for many years, but are now viewed as antiquated technology by some authors. Our mission is to teach those universal abstract concepts of Computer Science that have endured for half of a century and are likely to continue to be important in the future.
Contrast the elegant simplicity of the single accumulator PDP-8 with the extensive set of registers found on the Pentium(TM). In addition to its program counter and instruction register, the Pentium(TM) has an alphabet soup of registers: AL, AX, EAX, BL, BX, EBX, CL, CX, ECX, DL, DX, EDX, SP, ESP, SI, ESI, DI, EDI, BP, EBP, CS, DS, ES, FS, GS, SS as well as registers for floating point, multimedia, and operating systems. Despite the vast difference in complexity, the PDP-8 and the Pentium(TM) are theoretically equivalent to each other. Any program of suitable length written in machine language for the PDP-8 can be translated to the Pentium(TM) and vice versa. Certainly there are concepts on the Pentium(TM) that have no direct counterpart on the PDP-8, such as the registers used in protected mode, but until the student understands concepts like self-modification (which can be illustrated beautifully on the PDP-8), she cannot understand what it is that the Pentium's protected mode protects.
To be precise in physics, you have to define fundamental physical units, like the meter. The same is true in computer science about information.
The fundamental unit of information is the bit. A bit represents the answer to some particular yes/no question that a programmer is concerned about. By convention, a bit that is 1 usually means yes, and a bit that is zero usually means no. There are twelve bits in each word of the PDP-8. Groups of three bits are abbreviated in octal:
000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7
The chapters refer to the textbook, Introduction to Computer Organization Using the PDP-8 which will be put online during the summer of 1997 in PDF form.
To sell a large number of computers, each machine needs to be general purpose. Different people can program it to do different things. To make this possible, a general purpose computer needs the following attributes:
The chapters refer to the textbook, Introduction to Computer Organization Using the PDP-8 which will be put online during the summer of 1997 in PDF form.
Answering the question "what is the nature of a computer?" should be important to the student for both practical and philosophical reasons. On the practical side, it is programmable nature of the computer which has propelled the computer industry to become a significant factor in the world economy. It is likely a student will have a job in the computer industry after graduation because of this. The economies of scale in the computer industry necessitate such a programmable machine. This programmable nature ultimately stems from the "fetch/execute" cycle and related concepts, which are the subject matter of the Computer Organization class.
On the philosophical side, understanding the fundamental nature of the computer should give the student insight into what computers can do, and how they actually do it. This class focuses on universal concepts that have remained unchanged for the first half century of the computer industry. They are almost certainly going to remain important during the entire career of the student.
As small children, all of us were inquisitive about the nature of things. The best computer scientists and engineers combine this playful joy with a stern work ethic. Too many students today assume that when they take a class, knowledge will be poured into their brain in a painless process. Real education is just the opposite. The "hands on" assignments (http://plum.uwyo.edu/~comporgn/assign.html) in the Computer Organization class give the student the chance to make many mistakes. A child falls down often before mastering the technique of walking. The student may encounter similar pitfalls as she proceeds through this course. Many great scientists and engineers have credited their ultimate success to their early failures.
A child does not have to run a marathon before learning to walk. By analogy, a student should not have to learn about an excessively complex computer, like the Pentium (TM), before mastering the universal concepts that apply to all computers. Instead, in the Computer Organization class, the student first learns about one of the simplest and most beautiful computers that has ever existed: the PDP-8. Because it is simple, the extensive assignments (http://plum.uwyo.edu/~comporgn/assign.html) in this class are within within the student's grasp. Similar assignments dealing with another machine, say the Pentium (TM), would be beyond the student's grasp. The simple PDP-8 highlights the essential principles that are common to all computers. Because it is simple, the concepts are clear. The PDP-8 has three pedagogical advantages:
In contrast, the Pentium has three major disadvantages: