ICC Module 3 Lesson 1 – Computer Architecture 1 / 26 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 1 – Assembler.

Slides:



Advertisements
Similar presentations
ITEC 352 Lecture 13 ISA(4).
Advertisements

CPU Review and Programming Models CT101 – Computing Systems.
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
Computing Machinery Chapter 7: Register Transfers.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
Execution of an instruction
Chapter 6 In introduction to System Software and Virtual Machine ***Assembly Language.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
Chapter 6: An Introduction to System Software and Virtual Machines Invitation to Computer Science, C++ Version, Third Edition.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Henry Hexmoor1 Chapter 10- Control units We introduced the basic structure of a control unit, and translated assembly instructions into a binary representation.
The Processor Data Path & Control Chapter 5 Part 1 - Introduction and Single Clock Cycle Design N. Guydosh 2/29/04.
9/15/09 - L25 Registers & Load Enable Copyright Joanne DeGroat, ECE, OSU1 Registers & Load Enable.
©Brooks/Cole, 2003 Foundations of Computer Science from Data Manipulation to Theory of Computation Behrouz A. Forouzan, Brooks/Cole — Thomson Learning,
Computer Systems Organization CS 1428 Foundations of Computer Science.
Lecture #30 Page 1 ECE 4110– Sequential Logic Design Lecture #30 Agenda 1.von Neumann Stored Program Computer Architecture Announcements 1.N/A.
Computer Science 101 How the Assembler Works. Assembly Language Programming.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
Computer Organization - 1. INPUT PROCESS OUTPUT List different input devices Compare the use of voice recognition as opposed to the entry of data via.
Invitation to Computer Science 6th Edition Chapter 5 Computer Systems Organization.
The structure COMPUTER ARCHITECTURE – The elementary educational computer.
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
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.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale.
Computer Science 101 Computer Systems Organization.
Indira Gandhi National Open University presents. A Video Lecture Course: Computer Platforms.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 12 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 6 – Logic parallelism.
ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 13 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 9 – Locality School.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 9 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 7 – Architectural.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 12 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 5 – Memory Circuits.
Register Transfer Languages (RTL)
ICC Module 3 Lesson 1 – Computer Architecture 1 / 13 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 2 – Von Neumann.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 6 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 3 – Instruction.
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.
ICC Module 3 Lesson 4 – Networking 1 / 4 © 2015 Ph. Janson Information, Computing & Communication Networking – Clip 0 – Introduction School of Computer.
Computer Organization Instructions Language of The Computer (MIPS) 2.
ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 14 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 5 – Reading School.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 11 © 2015 Ph. Janson Information, Computing & Communication Module 3 : Systems.
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
Chapter 5: Computer Systems Organization Invitation to Computer Science,
ICC Module 3 Lesson 2 – Memory Hierarchies 1 / 25 © 2015 Ph. Janson Information, Computing & Communication Memory Hierarchies – Clip 8 – Example School.
Computer Systems Architecture Edited by Original lecture by Ian Sunley Areas: Computer users Basic topics What is a computer?
BITS Pilani Pilani Campus Pawan Sharma ES C263 Microprocessor Programming and Interfacing.
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
Chapter I: Introduction to Computer Science. Computer: is a machine that accepts input data, processes the data and creates output data. This is a specific-purpose.
Invitation to Computer Science 6th Edition
Control Unit Lecture 6.
Chapter 4 The Von Neumann Model
CHAPTER 6: The Little Man Computer
Prof. Sirer CS 316 Cornell University
Chapter 4 The Von Neumann Model
The Processor and Machine Language
Functional Units.
Arithmetic Logical Unit
Computer Architecture and Design Lecture 6
Introduction to Micro Controllers & Embedded System Design
Sequencing, Selection, and Loops in Machine Language
Fundamental Concepts Processor fetches one instruction at a time and perform the operation specified. Instructions are fetched from successive memory locations.
Chapter 4 The Von Neumann Model
Branch instructions We’ll implement branch instructions for the eight different conditions shown here. Bits 11-9 of the opcode field will indicate the.
Prof. Sirer CS 316 Cornell University
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
COMS 361 Computer Organization
CPSC 171 Introduction to Computer Science
Chapter 4 The Von Neumann Model
Presentation transcript:

ICC Module 3 Lesson 1 – Computer Architecture 1 / 26 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 1 – Assembler Language School of Computer Science & Communications P. Ienne (charts), Ph. Janson (commentary)

ICC Module 3 Lesson 1 – Computer Architecture 2 / 26 © 2015 Ph. Janson Outline ►Clip 0 – IntroductionClip 0 ►Clip 1 – Software technology – Assembler languageClip 1  Algorithms  Registers  Data instructions  Instruction numbering  Control instructions ►Clip 2 – Hardware architecture – Von Neumann’s stored program computer architectureClip 2  Data storage and processing  Control storage and processing ►Clip 3 – Hardware design – Instruction encodingClip 3 ►Harware implementation – Transistor technology  Clip 4 – Computing circuits Clip 4  Clip 5 – Memory circuits Clip 5 ►Hardware performance  Clip 6 – Logic parallelism Clip 6  Clip 7 – Architecture parallelism Clip 7 First clipPrevious clipNext clip

ICC Module 3 Lesson 1 – Computer Architecture 3 / 26 © 2015 Ph. Janson An algorithm – Step 0 ►An algorithm can be expressed in some intuitive « language » close to natural language People can understand and even execute that but computers cannot Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s

ICC Module 3 Lesson 1 – Computer Architecture 4 / 26 © 2015 Ph. Janson Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s Sum of the n first integers Input : 3 Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s Execution of this algorithm

ICC Module 3 Lesson 1 – Computer Architecture 5 / 26 © 2015 Ph. Janson Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s Sum of the n first integers Input : 3 Output: m s ← 0 as long as 3 > 0 s ← n ← 3 – 1 m ← s Execution of this algorithm

ICC Module 3 Lesson 1 – Computer Architecture 6 / 26 © 2015 Ph. Janson Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s Sum of the n first integers Input : 3 Output: m s ← 0 as long as 2 > 0 s ← n ← 2 – 1 m ← s Execution of this algorithm

ICC Module 3 Lesson 1 – Computer Architecture 7 / 26 © 2015 Ph. Janson Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s Sum of the n first integers Input : 3 Output: m s ← 0 as long as 1 > 0 s ← n ← 1 – 1 m ← s Execution of this algorithm

ICC Module 3 Lesson 1 – Computer Architecture 8 / 26 © 2015 Ph. Janson Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s Sum of the n first integers Input : 3 Output: m s ← 0 as long as 0 > 0 s ← s + n n ← n – 1 m ← 6 Execution of this algorithm

ICC Module 3 Lesson 1 – Computer Architecture 9 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 1: load r3, 0 2: cont_lte r1, 0, 6 3: add r3, r3, r1 4: add r1, r1, -1 5: cont 2 6: load r2, r3 From algorithms to computers – Step 1 Hardware Software Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s

ICC Module 3 Lesson 1 – Computer Architecture 10 / 26 © 2015 Ph. Janson Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s To get to computers let us first rewrite the algorithm We need to manipulate values such as s for instance For this purpose we restrict ourselves to variables such as r1, r2, r3,…

ICC Module 3 Lesson 1 – Computer Architecture 11 / 26 © 2015 Ph. Janson ►Such variables are called « registers » ►They are represented as r1, r2, r3,… ►The names of all algorithm variables must be replaced by such register names  n  r1  m  r2  s  r3 « Registers »

ICC Module 3 Lesson 1 – Computer Architecture 12 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 r3 ← 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 r2 ← r3 Sum of the n first integers Input : n Output: m s ← 0 as long as n > 0 s ← s + n n ← n – 1 m ← s Step 1.1

ICC Module 3 Lesson 1 – Computer Architecture 13 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 r3 ← 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 r2 ← r3 Let us continue … We need to assign values to these registers So we write that in a very regular way, for instance, « load r3, 0 » to mean r3  0 ou « load r2, r3 » to mean r2  r3

ICC Module 3 Lesson 1 – Computer Architecture 14 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 load r3, 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 load r2, r3 Sum of the n first integers Input : r1 Output: r2 r3 ← 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 r2 ← r3 Step 1.2

ICC Module 3 Lesson 1 – Computer Architecture 15 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 r3 ← 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 r2 ← r3 Let us continue … We need to perform arithmetic operations on these registers We rewrite those also in a more regular way, for instance, « add r3, r3, r1 » to mean r3  r3 + r1

ICC Module 3 Lesson 1 – Computer Architecture 16 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 load r3, 0 as long as r1 > 0 add r3, r3, r1 add r1, r1, -1 load r2, r3 Sum of the n first integers Input : r1 Output: r2 r3 ← 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 r2 ← r3 Step 1.3

ICC Module 3 Lesson 1 – Computer Architecture 17 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 r3 ← 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 r2 ← r3 Let us continue …

ICC Module 3 Lesson 1 – Computer Architecture 18 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 load r3, 0 if r1 <= 0 continue add r3, r3, r1 add r1, r1, -1 continue load r2, r3 Sum of the n first integers Input : r1 Output: r2 r3 ← 0 as long as r1 > 0 r3 ← r3 + r1 r1 ← r1 – 1 r2 ← r3 Watch out: a somewhat contorted transformation!

ICC Module 3 Lesson 1 – Computer Architecture 19 / 26 © 2015 Ph. Janson To enable that let us introduce line numbers We need to be able to specify targets for these « continue there » Instead of arrows we use line numbers, for instance, 1:, 2:, 3: Sum of the n first integers Input : r1 Output: r2 load r3, 0 if r1 <= 0 continue add r3, r3, r1 add r1, r1, -1 continue load r2, r3

ICC Module 3 Lesson 1 – Computer Architecture 20 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 1: load r3, 0 2: if r1 <= 0 continue at 6 3: add r3, r3, r1 4: add r1, r1, -1 5: continue at 2 6: load r2, r3 Sum of the n first integers Input : r1 Output: r2 load r3, 0 if r1 <= 0 continue add r3, r3, r1 add r1, r1, -1 continue load r2, r3 Step 1.4

ICC Module 3 Lesson 1 – Computer Architecture 21 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 1: load r3, 0 2: if r1 <= 0 continue at 6 3: add r3, r3, r1 4: add r1, r1, -1 5: jump 2 6: load r2, r3 JUMP instructions We introduce a new type of action / instruction, for instance, « jump 2 » to mean continue at 2 So now we need to specify jumps to given line numbers

ICC Module 3 Lesson 1 – Computer Architecture 22 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 1: load r3, 0 2: jump_lte r1, 0, 6 3: add r3, r3, r1 4: add r1, r1, -1 5: jump 2 6: load r2, r3 Conditional JUMP instructions We introduce new conditional actions / instructions, for instance, « jump_lte r1, 0, 6 » to mean if r1<= 0 continue at 6 We also need to be able to react to conditions

ICC Module 3 Lesson 1 – Computer Architecture 23 / 26 © 2015 Ph. Janson Sum of the n first integers Input : r1 Output: r2 1: load r3, 0 2: jump_lte r1, 0, 6 3: add r3, r3, r1 4: add r1, r1, -1 5: jump 2 6: load r2, r3 Sum of the n first integers Input : r1 Output: r2 1: load r3, 0 2: if r1 <= 0 continue 6 3: add r3, r3, r1 4: add r1, r1, -1 5: continue 2 6: load r2, r3 Step 1.5 This is what is called a program in “Assembler” language, which is already a lot closer to what computers can understand

ICC Module 3 Lesson 1 – Computer Architecture 24 / 26 © 2015 Ph. Janson ►Bottom line: we have defined a limited number of instructions; for instance  Load for assigning values to registers  Add for adding values into registers …… ►All these instructions  Have one single result …  And operate on 1 or 2 operands …  Which are either registers or constants ►One writes all these instructions as operation result, operand1, operand2 « Instructions »

ICC Module 3 Lesson 1 – Computer Architecture 25 / 26 © 2015 Ph. Janson ►Jump instructions specify that the next instruction to execute is not becessarily at the next line but may be at a line specified by the instruction ►One defines a limited number of jump instructions, for instance  jump 2 for an unconditionnal jump to line 2  jump_eq r1, r2, 6 for a conditional jump to line 6 if r1 = r2  jump_lte r1, r2, 6 for a conditional jump to line 6 if r1 ≤ r2  jump_gte r1, 14, 6 for a conditional jump to line 6 if r1 ≥ 14  jump_neg r1, 6 … r1 < 0  jump_pos r1, 6 … r1 > 0 JUMP instructions

ICC Module 3 Lesson 1 – Computer Architecture 26 / 26 © 2015 Ph. Janson ►One uses « registers » such as r1, r2, r3, in stead of freely named variables ►One writes programs as sequences of « instructions »  instructions for loading registers  instructions for arithmetic operations on registers  instructions for jumping (un)conditionally to other instructions ►i.e. one uses a restricted set of predefined instructions Brief summary