1 / 8

LMC Intro

LMC Intro. The Little Man Computer. LMC. Imagine a tiny man in a box with: Input and output trays List of numbers (memory) Program Data Calculator Only holds one value at a time. Excel WS. Excel Version of LMC:. Instructions. First number is Opcode 0 is end program

camila
Download Presentation

LMC Intro

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LMC Intro The Little Man Computer

  2. LMC • Imagine a tiny man in a box with: • Input and output trays • List of numbers (memory) • Program • Data • Calculator • Only holds one value at a time

  3. Excel WS • Excel Version of LMC:

  4. Instructions • First number is Opcode • 0 is end program • 9 is input/output • Operand of 01 is input • Operand of 02 is output

  5. Instructions • First number is Opcode • 3store what is in the accumulator • Operand gives memory location312 = store at location 12 • 5 get a value from memoryput in accumulator • Operand gives memory location512= get value at location 12

  6. Instructions • First number is Opcode • 1/2 add or subtract givenmemory location from valuein accumulator • Operand gives memory location112 = get value from location 12 and add to accumulator

  7. Instructions • First number is Opcode • 6/7/8 set the PC to the valuegiven in the operand • 612 jumps to instruction 12next • 7xx & 8xx look at accumulator to decide ifwe should branch

  8. Data • Program at start of memory • Ends with 0xx instruction (or empty box) • Extra space used to store data • For Store/Load/Add/Subtract • Program can include data • This program always adds 10 to input

More Related