TMCM Labs and Software Labs and Applets for The Most Complex Machine 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 an introductory computer science textbook that I wrote, but they can also be used independently of that text. All this material is free for personal use. I ask that the labs not be used as a formal part of a course, unless my text is adopted for use in that course. However, there is no restriction on any non-commercial use of the applets. 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, http://math.hws.edu/TMCM.html. For more information about me (David Eck) and my other projects, see my home page. You can send me email at eck@hws.edu. As of May 29, 1998, I have completed the full set of fifteen labs. I have also fixed a few glitches in the applets, although they may still have some problems, and some of them will only work well on the newest generation of Web browsers. Some of the applets have buttons for saving and loading files, but most browsers will not allow you to use these buttons, for security reasons. In a future release, I hope to fix this problem by "signing" the applets. I also hope to add some printing capability at some point. At the bottom of the page, you'll find links to the seven applets that are used in the labs. These links lead to Web pages that have reasonably complete information about using the applets. For some of the applets, there is also a set of tutorial examples. You don't need to read this material to do the labs, since the lab worksheets include instructions for using the applets. The labs use ideas from The Most Complex Machine, but they are for the most part self-contained. Downloading Information The entire set of labs and applets can be downloaded in a .zip archive at the address: http://math.hws.edu/TMCM/tmcm-java-labs.zip You are welcome to post these on your own Web server in unmodified form. You can use them on your own computer. However, if you try to do that, you'll probalby find that security restrictions on applets will prevent the applets from loading files of examples. 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 DataReps is 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. xLogicCircuits 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. xComputer is 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. xTuringMachine 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. xTurtle lets you write and execute programs written in the xTurtle programming language, which is used as an example in Chapters 6, 7, and 10. xSortLab 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. xModels 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 (eck@hws.edu), Last updated 28 May 1998