Let's start with a demonstration of SimCom doing its thing. When you click on the link, SimCom will appear with a program already loaded. This is a program to generate the prime numbers (2,3,5,7,11,13,17,19,23,..). Press the RUN button to start the program and watch the primes appear in the black Output box. Click here now.
SimCom the Simple Computer 1 Ok, let me try to describe the various parts of SimCom. You should keep flicking between this page & SimCom to see what I'm talking about. SimCom has
So what can go in the memory boxes? There is room for 4 digits in a memory box. The four digits are sometimes broken into TWO parts by SimCom
- 100 memory boxes labelled 00,01,02,...,98,99;
- a Program Counter which tells us which memory box the computer is currently looking at;
- an Accumulator which is a special memory box - its importance will become apparent later;
- a Stack Pointer (this will not be discussed in the early parts of this presentation);
- an Output box - this is where SimCom can display a result for the outside world;
- the RUN button starts SimCom and changes to STOP while SimCom is running;
- the "1 STEP" button allows us to run a program one step at a time;
- CLEAR empties all the memory boxes and sets the Program Counter back to zero.
Here's a simple example: 785. "7" means "jump to" so 785 means "jump to box 85". Try it by pressing 1 STEP.
- the last two digits - this is the address of a memory box;
- the other digits (one or two) - these tell SimCom what to do with the address.
If we now put "700" in box 85, the Program Counter will bounce backwards and forwards between 0 and 85 forever! Try it. Not a very useful exercise but hopefully you're starting to get the idea.