Little Man Computer.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

GCSE Computing Lesson 5.
Learning how to use the Little man computer
The Little man computer
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
19-1 Programming… The Pencil and Paper Computer The Pencil & Paper Instruction Set: (table on p148) The Operand specifies a memory location.
LMC Little Moron Computer
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
An Interactive Web-Based Simulation of a General Computer Architecture
Lecture 3. Diff b/w RAM and Registers Registers are used to hold data immediately applicable to the operation at hand Registers are used to hold data.
LMC Assembly Making Programming Friendlier. Machine Code Issues Have to remember numeric opcodes Have to think about physical memory locations – What.
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
CHAPTER 6: The Little Man Computer
Module 8 Part B Adapted By and Prepared James Tan © 2001.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Computer Organization CSC 405 (VSC) Very Simple Computer.
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.
Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set.
Fetch-execute cycle.
© 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.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
The Little-Man Computer Damian Gordon. The Little-Man Computer Most computer architectures conform to the so-called von Neuman Architecture. This means.
Dale & Lewis Chapter 5 Computing components
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
Binary! Objectives Recap what a instruction is Look at how binary can be used to store – Opcode – data.
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.
Central Processing Unit Decode Cycle. Central Processing Unit Current Instruction Register (CIR) I1 The fetch cycle has transferred an instruction from.
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.
Instruction Memory value Description ADD1xx Add the value stored at memory address xx to the value in the accumulator register SUB2xx Subtract the value.
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
Assembly Language Assembly Language
Lesson Objectives A note about notes: Aims
Starter Read the Feedback Click on Add new Feedback Open Realsmart
Data Representation – Instructions
BASIC COMPUTER ORGANIZATION AND DESIGN
The fetch-execute cycle
The Processor and Machine Language
The Little Man Computer
CHAPTER 6: The Little Man Computer
Introduction to Computing
Systems Architecture I (CS ) Lecture 2: A Simplified Computer
ECEG-3202 Computer Architecture and Organization
Making Programming Friendlier
The Little Man Computer
Sequencing, Selection, and Loops in Machine Language
Do it now – PAGE 10 You will find your do it now task in your workbook – look for the start button! Tuesday, 15 January 2019.
THE FETCH-EXECUTE CYCLE.
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Computer Architecture
Chapter 7 Assembly Language
DO IT NOW The LMC has the following instruction set:
Program Execution.
The Von Neumann Machine
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
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.
A Level Computer Science Topic 5: Computer Architecture and Assembly
THE FETCH-EXECUTE CYCLE.
Information Representation: Machine Instructions
Instruction execution and ALU
Learning how to use the Little man computer
Create Folder Unit 5 (All work for this unit to be stored here)
Presentation transcript:

Little Man Computer

Components Memory (100 cells numbered 0 to 99) Program Counter Holds machine language instructions and data Program Counter Holds the address of the next instruction to be executed Accumulator Holds the result of the most recent ADD / SUB instruction In box Where the computer gets its input Out box Where the computer sends its ouput

Instructions OpCode Mnemonic Description HLT Halt execution 1 ADD HLT Halt execution 1 ADD Add memory cell to accumulator 2 SUB Subtract memory cell from accumulator 3 STA Store accumulator to memory cell 4 LDA Load memory cell to accumulator 5 BRA Set program counter to operand 6 BRZ Set program counter to operand only if accumulator is zero 7 INP Load in box to accumulator 8 OUT Write accumulator to out box

LMC Machine Language Each machine language instruction is a 3-digit number 3 1 9 The opcode specifies which instruction to execute The operand specifies additional information needed by the instruction

3 1 9 LMC Assembly Language STA 19 An assembly language instruction is a decoded machine language instruction 3 1 9 STA 19

Execution Cycle Fetch => Decode => Execute

Example – Add 2 Numbers Get a number from input into calc Copy that number to an unused mailbox (mailbox 99) Get another number from input into calc Add the number we put into a mailbox 99 to calc Copy calc to the output Halt

Example – Add 2 Numbers Address Machine Language Assembly 700 INP 1 700 INP 1 399 STA 99 2 3 199 ADD 99 4 800 OUT 5 000 HLT

Example – Count Down to Zero Address Machine Language Assembly 700 INP 1 605 BRZ 5 2 800 OUT 3 206 SUB 6 4 501 BRA 1 5 000 HLT 6 001 DAT 1

Example – Read / Write Two Numbers But Swap Them Get a number from input into calc Copy the number to an unused mailbox (mailbox 99) Copy the number to an unused mailbox (mailbox 98) Copy the value from mailbox 98 to calc Copy the value in calc to output Copy the value from mailbox 99 to calc

Example – Read / Write Two Numbers But Swap Them INP (700) STA 99 (399) STA 98 (398) LDA 98 (598) OUT (800) LDA 99 (599)

Example – Multiply by 3 if Positive INP (700) STA 99 (399) STA 98 (398) STA 97 (397) LDA 98 (498) ADD 13 (113) BRZ 13 (613) LDA 97 (497) SUB 13 (213) BRZ 17 (617) BRA 04 (504) 1 (this is data, not an instruction) LDA 99 (399) OUT (800) HLT (000) ADD 99 (199)