Lesson 5 - Processing LMC
New LearningToday you will be using the Little Man Computer (LMC) to find out a bit more about how data is processed by the CPU.
There are two ways of programming the LMC - assembly language and machine code. Assembly language uses mnemonics (eg INP means input and STA means store). Machine code is a numeric representation of the same codes, called opcodes (eg 901 means input and 399 means store in memory at address 99). You can write a program by writing the mnemonics into the message box or the numeric codes directly into the memory blocks on the left hand side. Every processor type has it's own machine load (that means how the data is input into the processor) and there are different types of assembly language, many of which are more complex than what you will use in the LMC. |
Learning objectiveUnderstand how the CPU processes data
Write a simple program which outputs a number input by a user using the LMC Learning outcomesALL: Level 5
Understand how data, such as numbers, sound and images are physically stored on a computer system MOST: Level 6 Understand how instructions are run inside a computer SOME: Level 7 Understand how instructions can be written efficiently and be able to describe the efficiency of your programs. KeywordsMachine Load
LMC Mnemonics Assembly code Machine code Processor |
Follow your teachers instructions to open the LMC
Talk Task
|
Your teacher will talk you through the first two slides.
Then follow the link above to have a go at running your first LMC program. |
Learning DevelopmentYour teacher will talk you through how the LMC works by completing the rest of the above presentation.
Points to Note
Step Through By clicking the step button the program will execute one line at a time. You can watch the following boxes to see how the registers inside the processor work. Accumulator <-- Temporarily stores the most current piece of data Program Counter <-- Keeps track of which instruction to carry out next MEM Address <-- Points to the currently addressed memory block MEM Data <-- Loads the contents of the addressed memory In-Box <-- Used for data input Out-Box <-- Used for data output |
Plenary
The LMC is a simplified version of how the CPU works.
Can you explain how the CPU works?
Can you explain how the CPU works?