Introduction to Computer Systems

Slides:



Advertisements
Similar presentations
P.Rajasekar & C.M.T.Karthigeyan Asst.Professor SRM University, Kattankulathur 8/22/2011 School of Computing, Department of IT 1.
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2013 Elsevier Inc. All rights reserved.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
11 January 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
15 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
29 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Chapter 2: Data Manipulation
Processor Data Path and Control Diana Palsetia UPenn
Computer Science Education
SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan
Embedded Software 1. General 8051 features (excluding I/O) CPU 8 bit microcontroller The basic registers include (more discussed later) The 8-bit A (accumulator)
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
CHAPTER 6: The Little Man Computer
The “Little Man Computer” Version
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
Analyzing Genes and Genomes
Execution Cycle. Outline (Brief) Review of MIPS Microarchitecture Execution Cycle Pipelining Big vs. Little Endian-ness CPU Execution Time 1 IF ID EX.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Instruction execution and sequencing
CSC 3210 Computer Organization and Programming
Overheads for Computers as Components 2nd ed.
Chapter 3 โพรเซสเซอร์และการทำงาน The Processing Unit
CPSC 330 Fall 1999 HW #1 Assigned September 1, 1999 Due September 8, 1999 Submit in class Use a word processor (although you may hand-draw answers to Problems.
Stored Program Architecture
KU College of Engineering Elec 204: Digital Systems Design
MIPS Assembly Tutorial
THUMB Instructions: Branching and Data Processing
Princess Sumaya University
Chapter 2 Data Manipulation Dr. Farzana Rahman Assistant Professor Department of Computer Science James Madison University 1 Some sldes are adapted from.
Programming 68HC11.
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.
Lecture 14: Review Intro to IT COSC1078 Introduction to Information Technology Lecture 14 Revision and Review James Harland
Computer Processing CSCE 110 J. Michael Moore.
Chapter 2.2 Machine Language.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
1 Sec (2.3) Program Execution. 2 In the CPU we have CU and ALU, in CU there are two special purpose registers: 1. Instruction Register 2. Program Counter.
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.
1 Programming in Machine Language SCSC 311 Spring 2011.
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.
Chapter 2 Data Manipulation Yonsei University 1 st Semester, 2015 Sanghyun Park.
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.
Lecture 7: 9/17/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Computer Architecture Lecture 03 Fasih ur Rehman.
20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Dale & Lewis Chapter 5 Computing components
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
27 October 2015 Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Programming in Machine Language
CHAPTER 6: The Little Man Computer
The fetch-execute cycle
CS149D Elements of Computer Science
Program Execution.
Computer Concept and Practice
CS 111 – Sept. 16 Machine language examples Instruction execution
Sec (2.3) Program Execution.
Presentation transcript:

Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems sjmaybank@dcs.bbk.ac.uk Autumn 2014 Week 6b: Types of Instruction Official learning outcomes: A knowledge of number systems, computer architectures, data structures, operating systems, algorithms and software engineering fundamentals. 4 November 2014 Birkbeck College, U. London

Machine Architecture Main memory Central processing unit Arithmetic/ logic unit Address | Cells Registers 00 1 Program counter Bus 01 . Control unit . Instruction register FF F 4 November 2014 Brookshear, Section 2.2

Machine Language Concepts Registers (R, S, T…) Memory addresses Number of bytes in a memory cell Instruction Sequence of instructions Branching (choice of next instruction) 4 November 2014 Brookshear, Section 2.2

Properties of the Illustrative Machine No. memory cells: 256 No. bits in a memory cell: 8 (1 byte) No. registers: 16 No. bits in a register: 8 (1 byte) No. bits in the programme counter: 8 (1 byte) No. bits in the instruction register: 16 (2 bytes) 4 November 2014 Birkbeck College, U. London

Illustrative Machine Language Op-code Operand description 1 RXY LOAD R from memory location XY 2 LOAD R with data XY 3 STORE R at memory location XY 4 0RS Move bit pattern in R to S 5 RST Add (2s comp) contents of S,T. Put result in R 6 Add (fp) contents of S,T.Put result in R 4 November 2014 Brookshear, Appendix C

Illustrative Machine Language Op-code Operand Description 7 RST OR contents of S, T. Put result in R 8 AND contents of S, T. Put result in R 9 XOR contents of S, T. Put result in R A R0X Rotate right contents of R for X times. B RXY If contents R=contents register 0, then jump to instruction at address XY, otherwise continue as normal. C 000 Halt 4 November 2014 Brookshear, Appendix C

Types of Instruction Data transfer LOAD, STORE, MOVE Arithmetic/Logic ADD, OR, AND, XOR, ROTATE Control JUMP, HALT 4 November 2014 Brookshear, Section 2.2

Format of an Instruction Instruction=op-code field+operand field Op-code: identifies the elementary operation, e.g. STORE, SHIFT, XOR, JUMP. Operand: additional information, e.g. data or a register address. 4 November 2014 Brookshear, Section 2.2

Instruction 156C 1 5 6 C Op-code 1: load Register with bit pattern in memory at the given address memory address register 4 November 2014 Brookshear, Section 2.3

Op Code 7 (OR) 1 1 1 1st register OR 2nd register = 3rd register 1st register OR 1 2nd register = 1 3rd register 4 November 2014 Brookshear, Section 2.3

Op Code A (Rotate right) 1 register 1 rotate right 1 1 rotate right 2 4 November 2014 Brookshear, Section 2.3

Instruction B258 B 2 5 8 Op-code B: change value of program counter if contents of indicated register = contents of register 0 New contents of program counter Indicated register Brookshear, Fig. 2.9. 4 November 2014 Brookshear, Section 2.3

Machine Cycle Fetch next instruction from memory to the Decode the CPU Execute Execute the instruction 4 November 2014 Brookshear, Section 2.3

First Part of the Fetch Step of the Machine Cycle Main memory CPU address cells program counter 15 6C 16 6D A0 A1 A2 A3 bus A0 instruction register 156C 4 November 2014 Brookshear, Section 2.3

Completion of the Fetch Step Main memory CPU address cells program counter 15 6C 16 6D A0 A1 A2 A3 bus A2 instruction register 156C 4 November 2014 Brookshear, Section 2.3

Updating the Program Counter Fixed length instructions (2 bytes). Instructions stored consecutively in main memory. Each memory cell holds 1 byte. Then pc pc + 2 at the end of each Fetch. memory … 5 6 7 8 9 10 11 12 13 14 … pc=7 4 November 2014 Brookshear, Section 2.3

Program to Add Two Values Get the first value from memory and place it in a register S. Get the second value from memory and place it in another register T. Add the contents of S, T and place the result in a register R. Store the result in R in memory Stop 4 November 2014 Brookshear, Section 2.3

Encoded Program 156C. Load register 5 with the contents of memory cell 6C. 166D. Load register 6 with the contents of memory cell 6D 5056. Add (2s comp) contents of registers 5, 6. Put result in register 0. 306E. Store the contents of Register 0 at memory cell 6E. C000. Halt. 4 November 2014 Brookshear, Section 2.3

Birkbeck College, U. London Without Instruction B A program containing n instructions would run for n-1 machine cycles. The program would be unable to respond to changes in the data. 4 November 2014 Birkbeck College, U. London

Birkbeck College, U. London Fibonacci Numbers 0,1,1,2,3,5,8,13,21,34,55, … N(1)=0, N(2)=1 N(i+1)=N(i)+N(i-1) for i=2,3,4, … 4 November 2014 Birkbeck College, U. London

Program to Find the 10th Fibonacci Number Address Instruction Comment 20 2000 // load register 0 with 0 22 2100 // load register 1 with 0 24 2201 // load register 2 with 1 26 2408 // load register 4 with 8 28 25FF // load register 5 with -1 (Two’s Comp) R0 R1 R2 R3 R4 R5 00 00 01 08 ** FF 4 November 2014 Birkbeck College, U. London

Program to Find the 10th Fibonacci Number Address Instruction Comment 2A 5312 // Add contents of R1, R2. Put result in R3 3C 4021 // Move bit pattern in R2 to R1 2E 4032 // Move bit pattern in R3 to R2 30 5445 // Add contents of R4, R5. Put result in R4 32 B436 // If contents R4=contents R0, go to 36 34 B02A // If contents R0=contents R0, go to 2A 36 C000 // Halt. Result is in R2. 4 November 2014 Birkbeck College, U. London

Assembly Language Mnemonic system for representing machine language 166D 5056 306E C000 Assembly language LD R5, Price LD R6, ShippingCharge ADDI R0, R5, R6 St R0, TotalCost HLT 4 November 2014 Brookshear, Section 6.1