Posts

The Real Thing

In the previous post I talked about the LMC as a model. After understanding how the Little Man works it’s time to grow, and use more “realistic” terms. The LMC is a simplified model of how the computer works. The following is a list of what we find inside a computer:

  • MAR: Memory Address Register
  • MDR: Memory Data Register
  • IR: Instruction Register
  • PC: Program Counter
  • A: Accumulator, also known as the GPR, General Purpose Register
  • I/O: Input / Output

Because the Computer doesn’t hold actual “memory” as people do, we have to use a special register to “remember” what instruction is being executed; this is what the IR is for. The PC plays the same role as the counter in the LMC and the A is equivalent to the calculator. The MAR and the MDR can be described as the mail boxes. Where the MAR is the number of the mail box, and the MDR is the actual message inside that mail box.

The system works in a “Fetch-Execute Instruction Cycle.” As the name suggests the instruction is read, and then executed and after that the next instruction is read. It is based upon the transfer of data from one register to another. The Fetch cycle starts with the PC, the number is transferred to the MAR. The data in the MAR runs through a decoder, “lighting up” the particular line in memory where the MDR reads it and stores it. The Data in the MDR is transferred to the IR. The fetch part of the cycle is complete. The execute part of the cycle starts here. Depending on what the instruction is the computer executes it. If the instruction was to load a particular address, the data would then flow from the IR to the MAR, the same process happens in lighting up the line with that particular address.  It is stored in the MDR and then the data is transferred to the A. The execute part of the cycle is complete, now the program counter is updated and goes on to continue the cycle by fetching for the next instruction.