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.

Slides:



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

Computer Architecture and the Fetch-Execute Cycle
Central Processing Unit
CS364 CH16 Control Unit Operation
The Little man computer
CPS 101 Introduction to Computational Science Wensheng Shen Department of Computational Science SUNY Brockport.
LMC Little Moron Computer
Assembly Language Programming. CPU The CPU contains a Control Unit, Arithmetic Logic Unit (ALU) and a small number of memory locations called Registers.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Lecture 13 - Introduction to the Central Processing Unit (CPU)
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
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.
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)
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Lesson 5-4 Example Example 2 Find 14 ÷ 4. Show the remainder. 1.Rewrite the problem in vertical format.
School of Computer Science G51CSA 1 The Little Man Computer.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Lecture 14 Today’s topics MARIE Architecture Registers Buses
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.
Fetch-execute cycle.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
Computer Systems - Registers. Starter… Discuss in pairs the definition of the following Control Unit Arithmetic and Logic Unit Registers Internal clock.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Computer Systems Organization
System Unit Working of CPU. The CPU CPU The CPU CPU stands for central processing unit. it is brain of computer It is most important component of the.
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
Dale & Lewis Chapter 5 Computing components
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Structure and Role of a Processor
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
Unit 1 Rational Numbers Integers.
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.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
Mastering LMC Coding Part #1 Introduction to Low Level Languages Introduction to Little Man computer Simple examples (demos) with video tutorials included.
Lec 4-2 Five operations of the machine cycle Fetch- fetch the next program instruction from memory. (PC+1); instruction to IR Decode- decode the instruction.
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.
3.1.4 Hardware a. describe the function and purpose of the control unit, memory unit and ALU (arithmetic logic unit) as individual parts of a computer;
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.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
The Little man computer
Von Neumann architecture
Lecture 13 - Introduction to the Central Processing Unit (CPU)
CHAPTER 6: The Little Man Computer
Lesson Objectives A note about notes: Aims
The Processor and Machine Language
Design of the Control Unit for One-cycle Instruction Execution
Instruction and Control II
MARIE: An Introduction to a Simple Computer
The Little Man Computer
Sequencing, Selection, and Loops in Machine Language
Donuts Make Students Bright
THE FETCH-EXECUTE CYCLE.
LMC Little Man Computer What do you know about LMC?
GCSE OCR 1 The CPU Computer Science J276 Unit 1
Little Man Computer (continued).
A Level Computer Science Topic 5: Computer Architecture and Assembly
THE FETCH-EXECUTE CYCLE.
Information Representation: Machine Instructions
Computer Architecture
Little Man Computer.
Presentation transcript:

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. value 293-Store acc. as z 192-Load y in to acc. 499-Minus one from acc. 292-Store acc. as y 801-Skip next if acc. is zero 905-Jump to instruction Load z in to acc. 600-Output acc. 700-Halt 1xx Load 2xxStore 3xx Add 4xx Subtract 500 Input 600 Output 700 Halt 800 Skip If Negative 801 Skip If Zero 802 Skip If Positive 9xx Jump

Choose one program

Little Man Computer Really Tricky Task Write a program to divide two numbers. Write the program in word, or on paper before using the LMC program. The program should output the quotient, and then the remainder. e.g. for the calculation 10/3 the program would output 3 and 1. If you finish the program this lesson, use the LMC program to help you answer the exam question on the last slide of this file.

The addition method take the divisor and add it to itself. update a counter. Check if it equals the number that is being divided. If not, do the same addition, and update your counter again. keep going till you see that the sum is equal to or greater than the number that is to be divided. Then the value of your counter is the quotient. To get the remainder, (divisor - (final sum - divident)) for example. take 10/ = 6 counter = = 9 counter = = 12 counter = 3 (now 12 > 10 hence quotient = counter = 3) remainder = 3 - ( ) = 1

The addition method take 22/ = 10 counter = = 15 counter = = 20 counter = = 25 counter = 4 (now 25 > 22 hence quotient = counter = 4) remainder = 5 - ( ) = 2

The subtraction method take the divident and subtract the divisor from it. update a counter. Check if it equals the number that is being divided. If not, do the same addition, and update your counter again. keep going till you see that the sum is equal to or greater than the number that is to be divided. Then the value of your counter is the quotient. To get the remainder, (divisor - (final sum - divident)) for example. take 10/ = 7 counter = = 4 counter = = 1 counter = 3 (now 1 < 3 hence quotient = counter = 3) remainder = final value = 1

The subtraction method take 22/ = 17 counter = = 12 counter = = 7 counter = = 2 counter = 4 (now 4 < 5 hence quotient = counter = 4) remainder = final value = 2

Registers Different CPU designs have different numbers and types of registers. The following four types of registers, however, are found in all designs: PC, the program counter. The PC tells the CPU which memory location contains the next instruction to be executed. Typically, the PC is incremented by 1 so that it points to the next instruction in memory. But branch instructions can set the PC to another value. – In the LMC, the "program counter" is represented as the Location Counter. IR, the instruction register. This register is important because it holds the instruction that is currently being executed. – In the LMC, the "instruction register" is shown as the Instruction Display. To visualize the LMC operation, we can picture the Little Man holding the instruction written on a slip of paper he has taken from a mailbox, and reading what needs to be done. MAR, the memory address register. This register tells the CPU which location in memory is to be accessed. – The MAR is not shown in the LMC. MDR, the memory data register. This register holds the data being put into or taken out of the memory location identified by the MAR. It is sometimes called the memory buffer register, or MBR.

Exam Question