Little Man Computer When your program gets “translated to machine code” all 0’s & 1’s The translator must know the language of the program (java) as well.

Slides:



Advertisements
Similar presentations
The CPU The Central Presentation Unit What is the CPU?
Advertisements

CHAPTER 6: The Little Man Computer
The “Little Man Computer” Version
Stored Program Architecture
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
The Little man computer
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
LMC Little Moron Computer
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Stored Program Concept: The Hardware View
LAB 9 Simulator Chap 14 REED. Datapath Simulator accompanying the text is a datapath simulator a.k.a. the Knob & Switch Computer developed by Grant Braught.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
The Little Man Computer
A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.
An Interactive Web-Based Simulation of a General Computer Architecture
Machine Instruction Characteristics
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
Computer Architecture and the Fetch-Execute Cycle
Microcode Source: Digital Computer Electronics (Malvino and Brown)
CPU Design. Introduction – The CPU must perform three main tasks: Communication with memory – Fetching Instructions – Fetching and storing data Interpretation.
CHAPTER 6: The Little Man Computer
The Central Processing Unit (CPU) and the Machine Cycle.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set.
CMSC 150 PROGRAM EXECUTION CS 150: Wed 1 Feb 2012.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
An Example Architecture. A Paper Computer - Woody Woody's characteristics Word size – 8 bits One word.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Dale & Lewis Chapter 5 Computing components
Examples with 3-Digit Numbers
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
An Adder A Subtractor. A and B are the inputs of the adder/ subtractor R is the output of the adder/ subtractor F is the control to tell it to add or.
This is where you can reset and run your program. If your program has an “INP” (input) command, you will type it in this box here. Using the LMC These.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Mastering LMC Coding Part #1 Introduction to Low Level Languages Introduction to Little Man computer Simple examples (demos) with video tutorials included.
Program to multiply 2 numbers 500-Input x 291-Store acc. as x 500-Input y 292-Store acc. as y 193-Load y in to acc. (0 on 1 st parse) 391-Add x to acc.
The Postman in your PC Today you are going to learn how a computer’s CPU works to handle data. Teachcompsci.co.uk.
Little Man Computer Task 1 Last lesson you were asked to write a program to multiply two numbers together. The next slide has a working program to do this.
1. 2 TimeActivity 9:45Welcome and introductions 10:00What is a computer? 10:15What’s inside? 10:45Activity: A simple view of how computers work 11:15Coffee/tea.
The Little man computer
CHAPTER 6: The Little Man Computer
CPU Organisation & Operation
CHAPTER 6: The Little Man Computer
Review of computer processing and the basic of Operating system
Starter Read the Feedback Click on Add new Feedback Open Realsmart
Computer Science 210 Computer Organization
Data Representation – Instructions
The fetch-execute cycle
The Processor and Machine Language
Computer Science 210 Computer Organization
CS149D Elements of Computer Science
CHAPTER 6: The Little Man Computer
CSCE Fall 2013 Prof. Jennifer L. Welch.
The Little Man Computer
Computer Architecture
CSCE Fall 2012 Prof. Jennifer L. Welch.
Program Execution.
Little Man Computer There’s a little man in the mailroom that follows each instruction to the letter but he can only follow one instruction at a time.
Little Man Computer (continued).
A Level Computer Science Topic 5: Computer Architecture and Assembly
Information Representation: Machine Instructions
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Instruction execution and ALU
Computer Architecture
Little Man Computer.
Presentation transcript:

Little Man Computer When your program gets “translated to machine code” all 0’s & 1’s 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.

(Central Processing Unit) Calculations and other operations performed by: CPU (Central Processing Unit)

LMC Model

LMC Schematic 00 123 123 01 500 02 199 03 500 04 399 456 05 95 96 97 98 789 99 123 05

System Counterparts ALU Input/output interface Control unit 00 123 123 01 500 02 199 03 500 04 399 456 05 Control unit 95 96 97 98 789 99 123 05 Program counter

Input/output interface System Block Diagram CPU Memory ALU Input/output interface 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 Subtract similar to add but subtracts 5 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 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 7 Halt stop 800 Skip if Negative 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 Jump Tells LMC to change the program counter to the number shown on the address portion

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

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

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