========================================= The Little Man Computer Instruction Cycle ========================================= -IAN! idallen@ncf.ca 1. FETCH: Go to the counter. Read the 2-digit number on the counter. Go to the corresponding mailbox. Fetch from the mailbox a copy of the 3-digit number inside. Remember the 3-digit number. 2. INCREMENT: Go to the counter. Click it once. (Add one to the counter.) 3. EXECUTE: Go to the Wall Chart of Instructions. Look up the 3-digit number from the FETCH step. Do whatever the Wall Chart says to do. Repeat these three steps forever, or until encountering a HALT instruction that puts the Little Man to sleep. ---------------------------------------------------------------------------- You can see a picture and download an animation of a similar Little Man Computer from this Web site: http://www.herts.ac.uk/ltdu/projects/mm5/index.html http://www.herts.ac.uk/ltdu/projects/mm5/instructions/info_display.html The LMC on the above site combines the FETCH and INCREMENT steps into one. The Little Man reads the counter *and increments it* before going to fetch the number from memory. This isn't the way real CPU's work; but, the net effect is the same as the above three-step cycle that we use. Real CPU's can't do the INCREMENT until after the FETCH, since the INCREMENT has to increment the counter past the end of the instruction being fetched, and in many computers (not the LMC) instructions have different lengths. You can't increment the counter until you read the instruction and know how much to increment it! The LMC on the above web site does not implement the 803 or 0xy instructions.