Little Man Computer - UNC Asheville

Little Man Computer - UNC Asheville

Little Man Computer When your program gets translated to machine code all 0s & 1s The translator must know the language of the program (java) as well as the language of the cpu the instruction set LMC is a simple instruction set for toy computer About The LMC It is a model/illustration of a computer Created by Dr. Stuart Madnick at MIT in 1965 (he updated it in 1979) A fairly accurate representation of how computers still work today. Calculations and other operations performed by: CPU

(Central Processing Unit) LMC Model LMC Schematic 123 456 00 01 02 03 04 05 95 96

97 98 99 789 05 123 500 199 500 399 123 System Counterparts ALU Input/output

interface 123 456 00 01 02 03 04 05 123 500 199 500 399

Control unit 95 96 97 98 99 789 123 05 Program counter System Block Diagram CPU

ALU Input/output interface Memory Control unit Program counter LMC Instruction Set Layout of Instructions 3 digits (use decimal; idea is similar in binary) Think of memory as storage locations mailboxes that can hold one slip of paper with 3 digits LMC Instruction Set

Interpretation of the 3 digit 1st digit = instruction called the operation code op code for short 2nd and 3rd digits mailbox address (for the most part) eg. 225 means store into mailbox 25 LMC Instruction Set 1 Load Reverse of Store: walks to the mbox specified, copies the instruction on the slip of paper and takes it to the calculator and punches the number in.

2 Store walk to calculator, reads the number there, and writes the number on a slip of paper, walks to the mbox specified in the instruction, and puts this slip of paper there (replacing any paper already there LMC Instruction Set 3 Add walk to mailbox address specified and read the number there; walk to

calculator and adds it to the number already in the calculator 4 5 Subtract similar to add but subtracts Input walks to the in box and picks up the slip of paper having a 3-digit number on it; walks over to the calculator and enters that number LMS Instruction Set 6 Output

7 Halt 800 Skip if Negative walk to calculator, reads the number there, and writes the number on a slip of paper, walks to the out box and puts this slip of paper there stop walk to calculator; if the value is less than zero then walk to prog. counter and add one to the current value LMS Instruction Set 801 Skip If Zero walk to calculator; if the value is

zero then walk to prog. counter and add one to the current value 802 Skip If Positive walk to calculator; if the value is greater than zero then walk to prog. counter and add one to the current value 9 Tells LMC to change the program counter to the number shown on the address portion Jump

A program to add 2 numbers 00 01 02 03 04 05 99 500 299 500 399 600 700 input store data

input add output stop data A program to find positive difference of 2 numbers 00 01 02 03 04 05 06 07 08 09

10 11 12 Input 500 Store 11 Input 500 Store 12 Subtract 11 Skp if Neg Jmp 09 909 Load 11 111 Subtract 12 Output 600

Halt 700 Data 000 Data 000 211 212 411 800 412 Fetch, (Decode,) Execute Instruction Cycle Fetch: get the next instruction as indicated by the program counter: goes to mbox address and reads

the 3 digit code (the instruction) and then increments the program counter Decode: electronically decode the instruction to determine which operation to perform (not shown in LMC) Execute: perform the instruction Repeat cycle until halt

Recently Viewed Presentations

  • Writing: Expository Writing Time: Task: Students will read

    Writing: Expository Writing Time: Task: Students will read

    Do not be tempted to relive the story; speak about it with an academic voice. Generate final remarks without introducing brand new examples Unify and Summarize your ideas Remind the audience of your main point / thesis Use a satisfactory...
  • The Giant Planets  Beyond Mars and the asteroids

    The Giant Planets Beyond Mars and the asteroids

    Jupiter, Saturn, Uranus, Neptune Pluto is part of the outer solar system but will be considered with the moons of the Jovian planets These planets are dramatically different from the terrestrial planets The Jovian planets formed much farther from Sun...
  • Sargent House - crjustice.org

    Sargent House - crjustice.org

    Introduction to Effective Practices in Community Correctional settings and how we use it within SJSD. EPICS Coaching Sessions: Monthly EPICS training sessions for case managers where different modules are reviewed to keep EPICS on the forefront at the SJS programs...
  • Lecture PowerPoints Chapter 11 Physics: Principles with Applications,

    Lecture PowerPoints Chapter 11 Physics: Principles with Applications,

    A wave reaching the end of its medium, but where the medium is still free to move, will be reflected (b), and its reflection will be upright. A wave hitting an obstacle will be reflected (a), and its reflection will...
  • ICSB3: DRPM Measures

    ICSB3: DRPM Measures

    Feb 10 Biomaterials Evolution Platform Sequencing tracked Moore's law 2X/2 yr until 2005-9 10,000x/4yr DNA Synthesis, assembly & analysis on chips Biomaterials Evolution Platform Biomaterials Evolution Platform Biomaterials Evolution Platform Mirror world : resistant to enzymes, parasites, predators Approach#1: De...
  • Welcome to Year 1!!

    Welcome to Year 1!!

    Reading - Modelled, Shared, Guided& Independent Reading. Numeracy Block: iStarmethod for curriculum delivery. Scope and Sequence. Daily mental maths. ... To assist with reading to your child, there is a tub of books available for borrowing.
  • Local Wellness Policy Requirements Stephanie Stambach MS, RD,

    Local Wellness Policy Requirements Stephanie Stambach MS, RD,

    It must also include: Nutrition standards for all foods sold (such as Smart Snacks standards) Nutrition guidelines for foods available (not sold), such as food rewardsand classroom parties ... The food and beverage marketing applies to things such as score...
  • Transaction Services Citi Commercial Cards  Fraud Early Warning

    Transaction Services Citi Commercial Cards Fraud Early Warning

    Fraud Early Warning (FEW) Alert Methods. Overview. Citi Commercial Card continues innovating our overall communication strategy by implementing advanced technology to create a single source solution to contact cardholders via text message, e-mail and voice. Cardholders are contacted when fraud...