Little Man Computer - PowerPoint PPT Presentation

About This Presentation
Title:

Little Man Computer

Description:

walk to calculator, reads the number there, and writes the number on a slip of ... walk to calculator; if the value is less than zero then walk to prog. ... – PowerPoint PPT presentation

Number of Views:787
Avg rating:3.0/5.0
Slides: 17
Provided by: rebecc2
Learn more at: https://www.cs.unca.edu
Category:

less

Transcript and Presenter's Notes

Title: Little Man Computer


1
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

2
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.

3
Calculations and other operations performed by
CPU (Central Processing Unit)
4
LMC Model
5
LMC Schematic
123
00
123
500
01
199
02
500
03
399
04
05
95
96
97
98
123
99
05
6
System Counterparts
ALU
Input/output interface
123
00
123
500
01
199
02
500
03
399
04
05
Control unit
95
96
97
98
123
99
05
Program counter
7
System Block Diagram
CPU
Memory
ALU
Input/outputinterface
Control unit Program counter
8
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

9
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

10
LMC Instruction Set
11
LMC Instruction Set
12
LMS Instruction Set
13
LMS Instruction Set
14
A program to add 2 numbers
  • 00 500 input
  • 01 299 store data
  • 02 500 input
  • 03 399 add
  • 04 600 output
  • 05 700 stop
  • 99 data

15
A program to find positive difference of 2 numbers
  • 00 Input 500
  • 01 Store 11 211
  • 02 Input 500
  • 03 Store 12 212
  • 04 Subtract 11 411
  • 05 Skp if Neg 800
  • 06 Jmp 09 909
  • 07 Load 11 111
  • 08 Subtract 12 412
  • 09 Output 600
  • 10 Halt 700
  • 11 Data 000
  • 12 Data 000

16
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
Write a Comment
User Comments (0)
About PowerShow.com