Computer Systems 2009-2010 Week 7: Looping and Input/Output with 3-bit Alma Whitfield.

Slides:



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

ARITHMETIC LOGIC SHIFT UNIT
The Little man computer
19-1 Programming… The Pencil and Paper Computer The Pencil & Paper Instruction Set: (table on p148) The Operand specifies a memory location.
Computer Systems. Computer System Components Computer Networks.
Execution of an instruction
Computer Systems Week 8: 3-bit – The Display Amanda Oddie.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Systems Environment 3 Quick Revision Review of Exercises Introduction to TOM TOM Exercises.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
EET 2261 Unit 2 HCS12 Architecture
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Computer Architecture
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Computer Systems CS208. Major Components of a Computer System Processor (CPU) Runs program instructions Main Memory Storage for running programs and current.
0 What is a computer?  Simply put, a computer is a sophisticated electronic calculating machine that:  Accepts input information,  Processes the information.
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
The CPU The Central Presentation Unit Main Memory and Addresses Address bus and Address Space Data Bus Control Bus The Instructions set Mnemonics Opcodes.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
Computer Architecture and the Fetch-Execute Cycle
Computer Architecture and the Fetch-Execute Cycle
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Chapter 4 The Von Neumann Model
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Execution of an instruction
Computer Science Illuminated Programming: Controlling the Hardware.
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.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
COMPUTER ORGANISATION I HIGHER STILL Computing Computer Systems Higher Marr College Computing Department 2002.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Electronic Analog Computer Dr. Amin Danial Asham by.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Computer Systems Week 6: The Computer System Alma Whitfield.
Computer Architecture2  Computers are comprised of three things  The physical computer  The operating system  The user and programs running on the.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Structure and Role of a Processor
Computer Organization Instructions Language of The Computer (MIPS) 2.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Block diagram of a computer system Basic components of a computer system using block diagrams: Cpu Memory Input and output unit Evolution of microprocessor.
The Little man computer
Basic Computer Organization and Design
The 8085 Microprocessor Architecture
Control Unit Lecture 6.
Chapter 4 The Von Neumann Model
The 8085 Microprocessor Architecture
Introduction of microprocessor
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering
Computer Architecture
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
MARIE: An Introduction to a Simple Computer
Computer Architecture
The 8085 Microprocessor Architecture
Chapter 4 The Von Neumann Model
CPU has 6 special locations called registers
The Stored Program Computer
Course Code 114 Introduction to Computer Science
Introduction to Computer Engineering
Computer Operation 6/22/2019.
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
COMPUTER ARCHITECTURE
Chapter 4 The Von Neumann Model
Presentation transcript:

Computer Systems Week 7: Looping and Input/Output with 3-bit Alma Whitfield

2 Quick Quiz 1. How many different instructions does 3- bit use? a) 3 b) 8 c) 10 d) 16 3 bits are available for the op-codes with which 8 different patterns of 0s and 1s are possible

3 Quick Quiz 2. How many bits can each memory location hold? a) 3 b) 8 c) 10 d) 16 Each location can hold one instruction. Each instruction is 8 bits long

4 Quick Quiz 3. Each instruction is split into two sections, the first section is known as what? a) The operand b) The opinstruction c) The op-code d) The opexecute Abbreviation for operation code

5 Quick Quiz 4. Each instruction is split into two sections, the second section is known as what? a) The operand b) The opinstruction c) The op-code d) The opexecute The part that identifies what the op-code is to act upon

6 Quick Quiz 5. Which CPU register contains the address of the next instruction to be executed? a) Accumulator b) Instruction Register c) Program Counter d) Index Register

7 Quick Quiz 5. Which CPU register contains values brought from memory and perhaps added to or subtracted from by ADD and SUB instructions? a) Accumulator b) Instruction Register c) Program Counter d) Index Register

8 Quick Quiz 5. Which CPU register holds a copy of the instruction currently being executed? a) Accumulator b) Instruction Register c) Program Counter d) Index Register

9 Repetition in 3-bit programs The instructions considered so far are: LDD LDI STD ADD SUB None of these enable instructions to be executed repeatedly inside loops

10 Repetition and selection in 3-bit programs These next instructions provide these facilities JMP- repetition JEZ- repetition and selection

11 Repetition in 3-bit programs An infinite loop Demo ADD 16 START Flow chart

12 JMP JMP is the Jump command. It changes the sequence of execution of the program by changing the contents of the program counter to the address specified E.g. JMP 10, will cause the next instruction to be fetched from location with address 10 instead of the next one after the current address

13 Repetition and selection in 3-bit programs An finite loop Demo jez.tbt

14 Flow chart Repetition and selection in 3-bit programs LDD 16 START SUB 17 STD 16 AC = 0? STP True False

15 JEZ JEZ is similar to JMP but it will only jump if the AC is equal to zero Jump if Equal to Zero Thus selection is determined by whether the accumulator contains zero All computers make decisions by comparing numbers. 3-bit does it by comparing the number in the accumulator with zero

16 JEZ Given the following program what will happen?

17 We have now covered all eight instructions: the instruction set MnemonicBrief meaning 000STPhalt 001LDDload accumulator direct 010LDIload accumulator immediate 011STDstore accumulator direct 100ADDadd to accumulator 101SUBsubtract from accumulator 110JMPjump to next instruction 111JEZjump to next instruction if contents of accumulator is zero

18 CPU The CPUs processing power is measured with a clock speed. The higher the speed the quicker the CPU will process instructions MHz GHz

19 3-bit and the clock speed 3-bit has a clock speed too. By default it is set to 0.3 Hz 1 Hz is a frequency of one instruction per second so 0.3 Hz means each instruction takes about 3 seconds Very slow, this is deliberate so that you can see the instructions being executed real computers can execute billions of instructions per second The clock speed can be set to: 0.2 Hz 0.3 Hz 10 Hz 50 Hz

20 Inputting and outputting data Outputting Data Inputting Data Using the hard disc Saving / Opening

21 Memory mapped input and output Input concerns getting data into the computer Output concerns getting data/information out of the computer 3-bit uses memory mapping to provide input and output Input is achieved by reading from a specific memory locations Output is achieved by writing to specific memory locations

22 Memory mapped locations Memory location addresses Purpose Display memory 26Sets display mode 27-28Network interface card 29Hard disc buffer 30Printer buffer 31Keyboard

23 Today Location 31Keyboard Location 30Printer Location 29Disk Buffer

24 Next Week Location 18 – 25 Display memory Location 26Screen Mode

25 Week after Next Location 27 and 28Network Interface Card

26 Keyboard LDD 31 will copy what is in address 31 to the accumulator. 31 is mapped to an input device, in this case the keyboard

27 LDD 31 Effectively, LDD 31 will: ask the user for a value store the value in address 31 copy the value from memory address 31 to the accumulator

28 STD 31? Memory Address 31 is mapped to an input device, what happens if you try STD 31? a) 3BIT will perform an illegal operation and close down b) Nothing will happen c) The value in the accumulator will be copied to address location 31 as normal d) 31 will be copied into the accumulator

29 LDD 31 If there is a value already present in location 31, will it still ask the user for input or will it use the value already there? a) Ask b) Use

30 Outputting: STD 30

31 Outputting: STD 30 Use STD 30 to send the contents of the accumulator to the printer

32 Outputting: STD 30 Effectively, STD 30 will: copy what is currently in the accumulator to memory address 30 copy what is in memory address 30 to the printer This button will clear any output occurred

33 LDD 30? Memory Address 30 is mapped to an output device, what happens if you try LDD 30? a) 3BIT will perform an illegal operation and close down b) Nothing will happen c) The value in the accumulator will be copied to address 30 d) The value in memory address 30 will be copied into the accumulator

34 The Hard Disc Your 3-bit programs can be saved and loaded as required You can also edit and open data files Contents of the data file are shown in this window

35 LDD 29 Data file input memory is mapped to: Location 29 Data files work using positional pointers For the purpose of 3-bit, the pointer starts at the beginning of the file and moves down one line each time data is fetched

36 Data LDD 29 This will fetch data from the data file Put the data into memory address 29 Copy the value in location 29 into the accumulator

37 STD 29? Memory Address 29 is mapped to an input device, what happens if you try STD 29? a) 3BIT will perform an illegal operation and close down b) Nothing will happen c) The value in the accumulator will be copied to address 29 as normal d) 29 will be copied into the accumulator

38 What ends up in the AC? 0 LDD 29 1 STD 30 2 STP a) 29 b) 0 c) 15 d) 30 Data File

39 What about now? 0 LDD 29 1 STD 30 2 JEZ 4 3 JMP 0 4 STP a) 29 b) 0 c) 15 d) Data File

40 What have we covered? STD 30 sends to printer LDD 31 gets data from keyboard We can save programs to hard disc We can load programs from hard disc We can read a data file with LDD 29

41 3-bit is not so complicated?