© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.

Slides:



Advertisements
Similar presentations
GCSE Computing Lesson 5.
Advertisements

Computer Architecture and the Fetch-Execute Cycle
Stored Program Architecture
Processor System Architecture
The Little man computer
LMC Little Moron Computer
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
Overview The von Neumann Machine - the programmable digital computer Introducing the LC-3 Computer - A “toy” computer for us to learn from Computer machine.
The central processing unit and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
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
LMC Assembly Making Programming Friendlier. Machine Code Issues Have to remember numeric opcodes Have to think about physical memory locations – What.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
Computer Architecture and the Fetch-Execute Cycle
Computer Architecture and the Fetch-Execute Cycle
Microcode Source: Digital Computer Electronics (Malvino and Brown)
CSC 3210 Computer Organization and Programming Chapter 1 THE COMPUTER D.M. Rasanjalee Himali.
Week 2.  Understand what the processor is and what it does.  Execute basic LMC programs.  Understand how CPU characteristics affect performance.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
CHAPTER 6: The Little Man Computer
Chapter 8: The Very Simple Computer
The Central Processing Unit (CPU) and the Machine Cycle.
Chapter 5 Computing Components. 5-2 Chapter Goals List the components and their function in a von Neumann machine Describe the fetch-decode-execute cycle.
PHY 201 (Blum)1 Microcode Source: Digital Computer Electronics (Malvino and Brown)
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 ORGANISATION I HIGHER STILL Computing Computer Systems Higher Marr College Computing Department 2002.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
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.
1.4 Representation of data in computer systems Instructions.
The Little-Man Computer Damian Gordon. The Little-Man Computer Most computer architectures conform to the so-called von Neuman Architecture. This means.
Computer Organization 1 Instruction Fetch and Execute.
Dale & Lewis Chapter 5 Computing components
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Session 4 Teaching Computing to GCSE Level with Python.
Binary! Objectives Recap what a instruction is Look at how binary can be used to store – Opcode – data.
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.
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
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.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
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.
CPIT Program Execution. Today, general-purpose computers use a set of instructions called a program to process data. A computer executes the.
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
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
CHAPTER 6: The Little Man Computer
Review of computer processing and the basic of Operating system
Lesson Objectives A note about notes: Aims
Starter Read the Feedback Click on Add new Feedback Open Realsmart
Teaching Computing to GCSE
Intro to Architecture & Organization
CHAPTER 6: The Little Man Computer
Making Programming Friendlier
Computer Architecture
MARIE: An Introduction to a Simple Computer
DO IT NOW The LMC has the following instruction set:
GCSE OCR 1 The CPU Computer Science J276 Unit 1
Program Execution.
The Von Neumann Machine
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.
Little work is accurate
Little Man Computer.
Presentation transcript:

© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1

© GCSE Computing  LMC stands for Little Man Computer.  The LMC is a CPU simulator that models a simple computer using the von Neumann architecture and memory use  a central processing unit consisting of an arithmetic logic unit and registers  a control unit containing an instruction register and program counter  input and output mechanisms  RAM to store both data and instructions  external secondary storage  The simulation uses the idea of a ‘Little Man’ inside the computer fetching instructions from RAM and executing them.  The LMC can be programmed directly by entering machine code (but in decimal) directly into RAM.  However, the LMC is usually programmed in assembly code.  An assembler then translates the assembly code into machine code (but in decimal) and loads it into RAM. Slide 2

© GCSE Computing  RAM consisting of 100 memory addresses (0-99). Each address can hold a decimal format number up to 999.  INPUT using a 0-9 digit keypad.  OUTPUT using a multi-line display.  A PROGRAM COUNTER that stores the address of the next instruction in RAM.  An INSTRUCTION REGISTER that stores the OPP CODE of the current instruction.  An ADDRESS REGISTER that stores the address part of the current instruction (if it has one).  An ACCUMULATOR that stores the results of any calculations. Slide 3

© GCSE Computing  As the simulation runs the ‘Little Man’ inside the computer carries out the following steps: 1. Check the Program Counter to find the RAM address with the program instruction to be fetched. 2. Fetch the INSTRUCTION from that RAM address. 3. Increment the Program Counter (so that it contains the RAM address of the next instruction). 4. Decode the instruction (this might include finding the RAM address for the data it will work on). 5. If necessary, fetch the DATA from the RAM address found in the previous step. 6. Execute the instruction. 7. Repeat the cycle or halt. Slide 4

© GCSE Computing Slide 5 Memory addresses 0-99 A program in ASSEMBLY LANGUAGE ready to be translated into machine code INPUT, allowing number data input OUTPUT, displaying number data output An explanation of the instruction to be executed next

© GCSE Computing Slide 6 The ADDRESS REGISTER, containing the ADDRESS that the current instruction code refers to The program in ASSEMBLY LANGUAGE without LABELS The contents of the ACCUMULATOR The PROGRAM COUNTER The INSTRUCTION REGISTER, containing the current INSTRUCTION CODE

© GCSE Computing Slide 7 DATA stored in RAM MACHINE CODE instructions stored in RAM DATA The program in ASSEMBLY LANGUAGE

© GCSE Computing  Labels can be used to label a memory address that contains DATA. Being able to refer to the data as a label is much easier than having to refer to the address the data is stored at.  Example :  data1 DAT  Explanation: The memory address where this data is stored is labelled data1. No data would initially be stored at this location. If this was the 7th line of assembly code to be compiled then the label would refer to memory address 6 (RAM addresses start at 0)  data1 DAT 50  Explanation: The memory address where this data is stored is labelled data1 and stores the data 50. If this was the 7th line of assembly code to be compiled then the data 50 would be stored at memory address 6 (RAM addresses start at 0)  STA data1  Explanation: The contents of the accumulator would be stored at memory address 6.  LDA data1  Explanation: The data which is stored at memory address 6 would be loaded into the accumulator. Slide 8

© GCSE Computing  Labels can be used to label a memory address that contains an INSTRUCTION. Being able to refer to the label rather than the address of the instruction makes it much easier when using BRANCH instructions such as BRA, BRP and BRZ.  Example:  loop1 INP  Explanation: The memory address where this instruction is stored would be labelled loop1.  BRZ loop1  Explanation: If the contents of the accumulator were zero, the program would branch to the memory address labelled loop1 and carry out the instruction there.  To achieve this, the Program Counter would be set to the memory address labelled loop1.  If the contents of the accumulator were not zero then the Program Counter would simply be incremented by one. Slide 9

© GCSE Computing Slide 10 Labels used with BRANCH instructions Labels used with DATA

© GCSE Computing  After a program is assembled into machine code the Program Counter is always reset to memory address The ‘Little Man’ checks the Program Counter to find the RAM address with the instruction to be fetched ( in this case address 0 ). 2. Here, the instruction 523 is fetched from RAM address The Program Counter is incremented ( to RAM address 1 ). 4. The instruction part (5) is loaded into the INSTRUCTION REGISTER and the address part ( 23, the RAM address for the data the instruction will work on ) is loaded into the ADDRESS REGISTER. 5. The instruction is then decoded. 6. The instruction is executed ( 5 = LOAD into ACCUMULATOR so the 0 stored at RAM address 23 is loaded into the ACCUMULATOR ). 7. Back to step 1 to repeat the cycle until a HALT instruction is reached. Slide 11

© GCSE Computing  An instruction starting with a 9 (901 or 902) means the instruction is an INPUT/OUTPUT command.  The ‘address’ part of the instruction (01 or 02) decides if the instruction is actually an INPUT or an OUTPUT.  01 means INPUT - entered using the number keypad and stored in the ACCUMULATOR when the Enter key is pressed.  02 means OUTPUT – the value stored in the ACCUMULATOR is passed to the OUTPUT box. Slide 12

© GCSE Computing InstructionMnemonicMachine Code LoadLDA5xx StoreSTA3xx AddADD1xx SubtractSUB2xx InputINP901 OutputOUT902 EndHLT000 Branch alwaysBRA6xx Branch if zeroBRZ7xx Branch if zero or positiveBRP8xx Data storageDAT Slide 13 NOTE: xx represents a memory address between 0 and 99.