Little man computer

[1] The LMC is generally used to teach students, because it models a simple von Neumann architecture computer—which has all of the basic features of a modern computer.

[2][3][4] The LMC model is based on the concept of a little man shut in a closed mail room (analogous to a computer in this scenario).

The latter is achieved by setting the Program Counter to a non-sequential memory address if a particular condition is met (typically the value stored in the accumulator being zero or positive).

As specified by the von Neumann architecture, any mailbox (signifying a unique memory location) can contain either an instruction or data.

Care therefore needs to be taken to stop the Program Counter from reaching a memory address containing data - or the Little Man will attempt to treat it as an instruction.

To use the LMC, the user loads data into the mailboxes and then signals the Little Man to begin execution, starting with the instruction stored at memory address zero.

Some LMC simulators are programmed directly using 3-digit numeric instructions and some use 3-letter mnemonic codes and labels.

To work around this difficulty, most assembly languages (including the LMC) combine the mnemonics with labels.

(Note: an input that results in a value greater than 999 will have undefined behaviour due to the 3 digit number limit of the LMC).

This image is a screen capture of a Little Man Computer program. The background colour is a vibrant purple, in the top left the program title reads “Little Man Computer Simulation” in white text. Below it sits a table of data, with columns with names such as “line”, “label”, “operator” and “operand”. In it lie various computer commands, such as “start” “loop” “finish” “number” “zero”. The centre of the image is occupied by a representation of the different parts a computer, connected by blue lines on a pink background. The different parts of the computer have different shapes and names, such as the orange box labelled “PC” or the green “V” shape labelled “ALU”. To the right of that is a black and grey table titled “MEMORY”, filled with various digits, presumably collected from the operation of the machine. Finally, below this lies a panel where the user can enter “inputs” to receive an “output” - this is next to another box titled “console” which records the operation of the machine, e.g. “ASSEMBLY: SYMBOL TABLE BUILT”.
Little Man Computer simulator