7.2. The Little Computer¶
The Little Computer (sometimes called the Little Man Computer) is designed to explore how machine level languages work. At a low level, all computers do is move around pieces of data and do basic math and logic operations on that data.
The Little Computer has memory for 100 pieces of information and a simple CPU. The CPU has three registers: a program counter, an instruction register, and an accumulator. The CPU supports a very basic set of operations: it can get input and output, it can store data to memory and load it from memory, it can do addition and subtraction, and it can branch (or jump) to a different instruction if certain conditions are met.
This video introduces how the Little Computer works:
You can run the Little Computer be run in a web page using the link below. The interface looks a little different than the video, but it functions the same way. It will launch with the program shown in the video. To try out a different program, simply edit the values that are in memory, and then press the reset button.
Launch the Little Computer (Control or Command click to open in a new window)
As you experiment with the little computer, notice that the memory is storing both the instructions and the data. An “instruction” is simply some data in memory that the computer tries to decode as a machine instruction and run.