LMC (Little Man Computer)
In this lesson, students look at the CPU in detail, exploring the three major parts: Arithmetic/Logic Unit (ALU), Control Unit (CU) and Memory. Students also explore the Little Man Computer simulation to demonstrate the fetch-execute cycle.
Credits: This lesson is based on the sample Scheme of Work supplied by OCR. You can see the original version by clicking here.
Suggested time: 50-100 mins
Learning Objectives:
Curriculum Mapping:
KS3:
What is Little Man Computer:
The Little Man Computer (LMC) is a simulator which models the basic features of a modern computer. It is based on the Von Neumann architecture featuring a central processing unit consisting of an arithmetic logic unit and registers, a control unit containing an instruction register and program counter, input and output mechanisms and memory to store both data and instructions.
The LMC is based on the concept of a little man (shut in a small room or inside a computer) acting like the control unit of a CPU i.e. fetching instructions from memory, decoding and executing the instructions, and managing the input and output. The LMC can be programmed using either "Machine Code" or "Assembly Language".
Credits: This lesson is based on the sample Scheme of Work supplied by OCR. You can see the original version by clicking here.
Suggested time: 50-100 mins
Learning Objectives:
- State the purpose of the CPU
- Describe the function of the CPU as fetching and executing instructions stored in memory
- Understand the concept of machine code and assembly language instructions
Curriculum Mapping:
KS3:
- Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems
- Understand how instructions are stored and executed within a computer system
What is Little Man Computer:
The Little Man Computer (LMC) is a simulator which models the basic features of a modern computer. It is based on the Von Neumann architecture featuring a central processing unit consisting of an arithmetic logic unit and registers, a control unit containing an instruction register and program counter, input and output mechanisms and memory to store both data and instructions.
The LMC is based on the concept of a little man (shut in a small room or inside a computer) acting like the control unit of a CPU i.e. fetching instructions from memory, decoding and executing the instructions, and managing the input and output. The LMC can be programmed using either "Machine Code" or "Assembly Language".
Starter:
This activity, courtesy of CS Unplugged, provides students a basic understanding of how computers work by having them act out a simple computer simulation.
How it works:
Each student takes on the role of a different part of a simplified computer (CPU, ALU and Display) and, working in groups of three, run a simple program. The end result of this program is to draw a picture on a simulated computer display.
You download the activity here: http://cse4k12.org/how_computers_work/index.html
This activity, courtesy of CS Unplugged, provides students a basic understanding of how computers work by having them act out a simple computer simulation.
How it works:
Each student takes on the role of a different part of a simplified computer (CPU, ALU and Display) and, working in groups of three, run a simple program. The end result of this program is to draw a picture on a simulated computer display.
You download the activity here: http://cse4k12.org/how_computers_work/index.html
Activity 1:
Show students a picture of a CPU (If you have a spare CPU to hand - even better!). Explain to students that, in the starter activity, they simulated what goes on inside the CPU (All be it at a very basic level!). Explain that the students will be taking a deeper look inside the CPU using a simulation called Little Man Computer (LMC).
|
Load Little Man Computer (http://peterhigginson.co.uk/LMC/) and explain to students that the main function of the CPU is to fetch and execute the instructions.
Load the following set of instructions, to add two numbers, into the simulator to demonstrate how the simulator works.
Load the following set of instructions, to add two numbers, into the simulator to demonstrate how the simulator works.
Click on 'Submit' to load the instructions followed by 'RUN' to execute the code.
Activity 2:
After demonstrating the LMC simulator, hand students the following sequence of instructions, (printed and cut into pieces). Ask students, in groups of about 4 or 5, to load the Little Man Computer simulator and execute the sample program. Once the students have successfully loaded the simulator, ask them to place the printed instructions in the correct order and record their answers on the task sheet, provided. After 5 mins, discuss with the class the students’ findings.
lmc_cutout.docx |
After discussing the sample program with the class, show them the LMC reference sheet (below) and explain the different instructions.
Finally, challenge the students, using the reference sheet and what they had learnt, to write a program to add 3 numbers and execute it in the LMC simulator. As an extension, ask some students to write a program to add and subtract a number or to write a program of their own (see worksheet below).
Resources:
Finally, challenge the students, using the reference sheet and what they had learnt, to write a program to add 3 numbers and execute it in the LMC simulator. As an extension, ask some students to write a program to add and subtract a number or to write a program of their own (see worksheet below).
Resources:
|
Little Man Computer (LMC) worksheet
|
|
LMC extension worksheet
|
|
LMC reference sheet
|
Extension:
Challenge the students to convert the instructions from assembly language to machine code.
Challenge the students to convert the instructions from assembly language to machine code.
|
LMC Machine Code Reference Sheet
|
Plenary: CPU Dingbats
Finish by playing a game of CPU dingbats (see attached). This version is based on a starter activity shared via CAS by John Bilton. (Original version can be found here: http://community.computingatschool.org.uk/resources/1314).
Finish by playing a game of CPU dingbats (see attached). This version is based on a starter activity shared via CAS by John Bilton. (Original version can be found here: http://community.computingatschool.org.uk/resources/1314).
cpu_dingbats_plenary.pptx |
Downloads:
Links:
LMC:
Fetch-execute cycle:
- http://www.gcsecomputing.org.uk/lmc/lmc.html (Downloadable VB.Net version of the Little Man Computer)
- http://peterhigginson.co.uk/LMC/ - Enhanced online version of the VB.Net LMC simulator created by Peter Higginson
- http://www.gcsecomputing.org.uk/lmc/lmc_java.html - Original OCR recommended Java Script version of the LMC (Note: this version may now be blocked due to the recent JAVA update)
Links:
LMC:
- http://mrbcomputing.com/assembly-language-introduction-using-lmc/ - Short video tutorial introducing students to Assembly Language using the Little Man Computer
- http://community.computingatschool.org.uk/resources/1573 - Little Man Computer CPD Pack: Excellent set of resources from a Little Man Computer focused Master Teacher CPD session. (Requires signup - FREE)
- http://www.gcsecomputing.org.uk/lmc/index.html - Little Man Computer support page
- LMC and CPU Basics.ppt - Great PowerPoint, from D Travi, explaining how The LMC and CPU work
- http://www.pwnict.co.uk/computingGCSE/2.1.2%20Hardware/lesson%201%20-%20CPU/What%20is%20the%20CPU.pptx - Excellent PowerPoint explaining how the CPU works courtesy of PWNICT
Fetch-execute cycle:
- http://www.eastaughs.fsnet.co.uk/cpu/execution-fetch.htm - Animation demonstrating the fetch-execute cycle
- http://community.computingatschool.org.uk/resources/95#post_18284 (Requires you to sign up – FREE)