Due: Friday, February 17 by 10:30AM
In the 1950s and 1960s, as programmable computers developed, people needed a way to write programs for the computer to execute. Since the notion of programming languages was just beginning to take shape, programmers had to know how to enter instructions in the form that the machine understood: machine language. But this was cumbersome, entering instructions as numbers. Computer programmers were also adjusting to the stored program concept, where program instructions and data are stored together in memory.
Bell Labs developed a paper simulation of a typical computer called CARDIAC, along with a manual to explain how programs work in a computer using a very simple machine language. The language, however, was sophisticated enough to allow for conditional tests, loops, and subroutines - even recursion! You can still find copies of the CARDIAC "simulator" online to purchase, but there is a web-based simulator online that you can use to experiment with CARDIAC.
Go to the simulator here:
The manual on how to use this simulator is given here:
And a page describing how to program the "computer" along with some historical informaiton is given here:
You will enter a set of programs into CARDIAC and run them. You need to capture what you are doing as a video (one for each program) that we can watch afterwards to see that you were able to load the program and run it successfully.
1. For the first program, enter the simple addition program from section 8 of the manual into the simulator and run it. You should do this by entering the instructions directly into memory in the indicated locations, enter two values to add into the card deck and load them into the card reader, set the PC (program counter) to the location of the first instruction in memory (17), then step through the program using the STEP button until you reach the halt instruction. If you do this correctly, you should see the total in the output deck.
2. For the second program, you should try to enter and run the program in section 11 of the manual, page 30, in the same way as in the previous task (i.e. manually).
3. For the third program, you should try to run the Towers of Hanoi program given in the historical page (near the bottom of the web page). For this program, read in the manual to learn how bootstrapping works. Copy and paste the program listing into the simulator's card deck, MODIFY IT SO IT SOLVES THE TOWERS OF HANOI PROBLEM FOR 4 DISCS INSTEAD OF 3 DISCS, then load the deck into the reader, make sure your PC is set to 00, and run the program in SLOW mode to show the program loading itself into memory and then executing.
In a separate text file README.txt, answer the following three questions:
Write an additional CARDIAC program that computes something useful and interesting. Do not use one of the other CARDIAC programs given in the manual or historical page or copy a CARDIAC program from the web. For your program, you should include in the readme file a listing of your program with comments (similar to that shown for the Towers of Hanoi) along with a Card Deck listing that we can just cut and paste into the simulator.
Embellishments that show significant skill will be awarded additional points and may be presented in class.
You should include a README.txt file that answers the three questions above along with a program listing and Card Deck for an additional program if you choose to write one.
Zip up all files (three short videos and a readme file) that are required and hand in to Autolab (on andrew).
Assignments will be graded out of 100 points. For maximum credit (100 points), we expect that your program will contain one significant embellishment beyond the basic requirements of the assignment. Assignments that meet the basic requirements will receive 90 points.
Programs may be handed in up to 24 hours late with a 20% penalty.