![little man computer little man computer](https://sm.pcmag.com/t/pcmag_au/photo/w/women/women_nrnq.1080.jpg)
Now let’s see how we can combine these instructions into a program to have the Little Man do
![little man computer little man computer](https://www.101computing.net/wp/wp-content/uploads/LMC-Max.jpg)
Little man computer code#
The Little Man will work for the following basic instructions, Op Code Finally, after completing the instruction, the Little Man will increment the Instruction Location Counter by one and will go to the mail box specified by the counter. The Little Man will start to work by reading the number on Instruction Location Counter ( Instruction Location Counter keeps a particular address of a mailbox ) and then he walks to the particular mailbox in order to read the slip in it, on the slip, the instruction and the appropriate mailbox address which the instruction is to be applied are mentioned, and the task of the Little Man is to do that particular instruction on the mentioned mailbox. The instruction part of the three-digit code is also known as an “operation code”, or opcode for short, and other two digits indicate the appropriate mailbox address to be used as a part of the instruction. Just see the figure below to identify how each of the components is placed in the LMC.Įach of every mailbox in LMC contains a slip of paper, upon which is written a three-digit decimal number, the first digit will be the instruction digit which tells the Little Man what to do. The LMC is completely closed to the outside world by its walls, the only way that the outside world can communicate with the Little Man is through the “In” and “out” baskets and the Reset button that is used to reset the instruction location counter. LMC is just a small walled mail room which has 100 mailboxes that are addressed ranging from 00 to 99, a simple calculator which can perform addition and subtraction, an instruction location counter which shows an address of a mailbox and a Little Man who communicates between other components in the mail room. Stuart Madnick at MIT in 1965, since then this model is used all around the world to understand the computer’s operations easily. Mostly, this model is used to teach students to simplify the underline theory of how the computer behaves. These instructions and the way of LMC works is fundamentally similar to the instruction sets of many different computers. Little Man Computer is a simple model of a real-world computer, it contains basic instruction set that is used to do operations. Fortunately, there is a simple model called LMC(Little Man Computer) that works similar to the way of computer works. There are special responsibilities which are assigned for each of the main components in the computer, but it is somewhat hard to understand how each of them is working when an instruction is given. In order to do some operations, the computer mainly uses these three components. Note The CPU or the brain of the computer is mainly divided into two parts. So, in this post, I thought to write the way of computer works with its main components. Actually, the CPU does not use any complex instruction other than simple instruction at an extremely high rate of speed to do complex tasks. We all know that the brain of a computer is the CPU(Central Processing Unit), Now, the problem is how the CPU actually solve that much complex expressions so quickly. The computer does not take too much time to calculate even a complex calculation, within a few seconds it can solve very large expressions.