Labs and Applets for
The Most Complex Machine

(David Eck, May 1998, March 2000, and June 2004)

ON THIS PAGE YOU'LL FIND a set of lab worksheets and Java applets that are meant to help people learn about computer science. They were written for use with my introductory computer science textbook, but they can also be used independently of that text. The labs and applets are free for personal use. In addition, the applets can be freely used for non-commercial purposes, including courses that do not use my textbook. I ask that teachers use the labs as an official part of a course only if they adopt my textbook for that course (but I will consider giving permission for other uses). Again, the applets -- including the informational page about each applet at the bottom of this page -- are free for any non-commercial use, including use in any course.

Note about software update in June 2004: The Java applets were written using the original version of Java. While they have generally continued to work with more recent Java releases, a few incompatibilities have crept in. In June 2004, I fixed the known problems, so that the applets should now work with all versions of Java (at least for the time being). I have also taken the opportunity to repackage the applets in "executable jar files" that can be run as stand-alone applications, outside of a web browser. See the download page for more information.

The text for which I wrote the applets and labs is The Most Complex Machine: A Survey of Computers and Computing. It is an introductory survey of a big chunk of computer science. You can learn more about it at its home page, For more information about me (David Eck) and my other projects, see my home page at You can send me email at

Later on this page, after the labs, you'll find links to more general information about each of the seven applets that are used in the labs. For some of the applets, a set of tutorial examples is included. You don't need to read this material to do the labs, since the lab worksheets include instructions for using the applets.

The labs and applets are available for downloading. So is source code for the applets. The applets are also available as Java applications, which can be run without a Web browser. For more details, see the "downloading and information page." You'll also find information there about how to use the applets on your own Web pages.

The Labs

Introductory Lab: The Web, Java, and DataReps.

This lab is mainly an introduction to the use of the World Wide Web and to the idea of Java applets. A simple applet, DataReps, serves as an example of an applet. It also serves to demonstrate how several different types of data are represented in a computer.

xLogicCircuits Lab 1: Logic Circuits.

Explores logic circuits created out of AND, OR and NOT gates. The relationship between circuits and Boolean algebra is also covered.

xLogicCircuits Lab 2: Memory Circuits.

Shows how circuits that contain feedback loops can be used as memory circuits, and how a RAM (random access memory) can be constructed and used.

xComputer Lab 1: Introduction to xComputer.

Introduces the xComputer, a simple model computer, and investigates how it operates in a fetch-and-execute cycle to carry out machine language instructions stored in its memory.

xComputer Lab 2: Assembly Language Programming.

Covers assembly language programming for the xComputer, including labels and indirect addressing.

xComputer Lab 3: Subroutines.

Introduces the idea of a subroutine and shows how subroutines can be implemented "by hand" in the assembly language of xComputer, even though that language does not offer direct support for subroutines.

xTuringMachine Lab: Introduction to Turing Machines.

This lab is meant to illustrate the basic operation of Turing machines and to show that even the extremely simple operations performed by Turing machines are sufficient for performing complex computations.

Publishing on the Web.

This lab will cover some of the basics of Web publishing, concentrating on the "Composer" utility in Netscape Communicator. This lab is not closely related to The Most Complex Machine, and it does not use any applets. However, it does sort of fit in with the theme of "real computers" and their impact on society, which is covered in Chapter 5 of the text. (This lab is somewhat specific to Hobart and William Smith Colleges.)

xTurtle Lab 1: Introduction to Programming.

Covers the basics of the xTurtle programming language, including loops, if statements, variables, and built-in turtle graphics commands.

xTurtle Lab 2: Thinking about Programs.

Investigates how preconditions and postconditions can be used to help develop working programs that perform complex tasks. Also introduces the idea of subroutines.

xTurtle Lab 3: Subroutines and Recursion.

Continues with subroutines in general and recursive subroutines in particular. Recursion is used to produce nifty pictures.

xSortLab Lab: Sorting and the Analysis of Algorithms.

Uses the xSortLab applet to investigate several different algorithms for sorting lists of numbers.

xTurtle Lab 4: Multiprocessing.

Shows how multiprocessing can be used to divide a large problem into several subtasks that can be executed in parallel. Some examples of communication between parallel processes are also given.

xModels Lab 1: Two-D Graphics and Animation.

Introduces a scene-description language for creating still images and multi-frame animations. Shows how hierarchical, geometric models are used in computer graphics. In this lab, only two-dimensional images are covered.

xModels Lab 2: Adding the Third Dimension.

Extends the ideas covered in the previous lab to three dimensions. Also covers "lathing" and "extrusion," two operations for producing three-dimensional objects.

The Applets


A small applet that shows how the same 32 bits stored in the memory of a computer can represent different things, depending on how they are interpreted. It is related to material covered in Chapter 1, Section 1 of The Most Complex Machine.


Lets you create simulated logic circuits, like those discussed in Chapter 2, by dragging AND gates, OR gates, and other components onto a circuit board and drawing connections between them. You can turn the inputs of your circuits on and off, to see how the circuits behave.


An implementation of the model computer developed in Chapter 3. You can write assembly language programs for that computer and watch as the computer executes them step-by-step.


Lets you create Turing machines and watch as they move back and forth along a "tape," reading and modifying its contents. Turing machines are covered in Chapter 4.


Lets you write and execute programs written in the xTurtle programming language, which is used as an example in Chapters 6, 7, and 10.


Lets you watch several sorting algorithms in action and measure their performance. This applet is related to material on the analysis of algorithms that is covered in Chapter 9. (Note, added September 1, 2004: A French translation of this applet by Tahia Benhaj-Abdellatif has been posted on the Web.)


Does geometric modeling and computer animation, as discussed in Chapter 11. You can write "scene descriptions" and then "render" the resulting images or animations as wireframe models.

David Eck (
Labs last updated 28 May 1998
Page design updated 23 March 2000
Software updated June 2004