Little Man Computer Programs

Description| How to Use| LMC Programs| How it works

A few sample programs have been provided. A brief desciption of these follows.

The "Add" and "Subtract" programs are simple programs, the Add program displays the sum of 2 inputs and the Subtract program subtracts the second input from the first. These make good starting points for learning LMC programming.

The output of the "FindMax" program is the maximum of two inputs. The "CountDown" program takes in a user input and keeps counting down till the output reaches 0.

The output of the "Square" program is the square of the input. It multiplies a number with itself by repeated addition. It uses a counter for keeping track of the number of times addition is required. The programme is a good illustration of the fact that multiplication is more expensive in terms of computing time compared to the simpler processes of addition and subtraction.