This is the Little Computer Man, who lives in The Little Man Computer. There is a little computer man in every computer, except those populated by little computer women. The little man does all the important work inside the processor by following a process known as the 'Fetch Execute Cycle', which involves oddly enough, fetching instructions, and executing them. |
The Fetch ProcessBefore the little man can carry out an instruction, he needs to find out which instruction he has to carry out. He does this by first getting the value from the program counter (The thing that looks like a green mushroom in a block of wood), and then fetching the value from the corresponding address in memory. |
The Program CounterThe little man uses the value in the program counter to decide which address in memory he should get the next instruction from. After getting the value, but before going and getting that instruction, he increments the program counter, so that it has the correct value in it when he visits it next time. |
|
MemoryMemory can be used to store programs, and data. In the fetch phase of the fetch execute cycle we are only interested in the fact that we can get instructions from the memory. |
The Input and Output TraysThese are what we use to communicate with the little man. We provide him with data via the input tray, and when he's ready, he provides us with data via the output tray. |
The Execute ProcessOnce the little man knows which instruction he is going to perform, he has to set about actually doing it. This is the 'Execute' phase of the fetch execute cycle. For each instruction the little man will perform a series of tasks. For instance, for an input instruction, the little man will go to the input tray, take the value he finds there, and go and put it into the calculator. For an add instruction, he will take a value from memory, and add it to the value presently in the calculator. Once the execute phase is complete, the little man will start the cycle again , and head to the program counter to get the value of the next instruction he has to fetch. |
|
The CalculatorOn a 'real' computer, this would be the Arithmetic Logic Unit (ALU). The little man needs nothing so grand, and makes do with a simple three digit display calculator. |
||
Memory (again)Memory is accessed during the execute phase when we need to store or access data. It is possible to overwrite your programs when putting data into memory though, so be careful where you put it. |