Jason Hyman's Homepage |
|
COMPUTER SIMULATORThis is a simulator for a very basic computer. This project was done for my computer architecture class (CP SC 231). I have made some modifications to the original to make it more presentable here. Namely, the original was not an applet. The input to the program came from a text file. The output of the program was a printout of the registers after each instruction. To make the program a little more interesting, I have put a friendly face on the engine. As such, the register contents are now displayed on the applet. Also, a neat feature is that you can type in a program and the applet will step through (or run the whole thing at once) the program that you typed in. Of course, you need to know the architecture and the instruction codes. They are as follows. Registers Register/Number of Bits AR/12 Instruction codes Hex Code/Symbol/Description 0xxx/AND/AND memory word at cell xxx to AC Program structure When entering a program in the applet, use the following template. (PC Startup value) Example Program - Adding two numbers The following program is annotated. Italicized text should not be entered. 200 ORG of first instruction to be executed The first line says that the first instruction is at memory word 200. Program starts with the instruction at memory location 200, 2100 = load accumulator with value in memory location 100 (AC = C3A9). The next instruction (at memory location 201) is 1101 = add memory data at cell 101 to accumulator (AC = C3A9 + 0011 = C3BA). The last instruction (at memory cell 202) is 7001 = halt.
Applet follows (may take some time to load): Last updated: 8/9/2005
|
|
Copyright 2005 Jason Hyman
|
Version 2.0
|