Instruction Set Architecture & Design

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

CH10 Instruction Sets: Characteristics and Functions
INSTRUCTION SET ARCHITECTURES
Instruction Set Architecture
TK 2633 Microprocessor & Interfacing
Execution of an instruction
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Memory - Registers Instruction Sets
What is an instruction set?
Computer Architecture
Chapter 10 Instruction Sets: Characteristics and Functions.
Lecture 18 Last Lecture Today’s Topic Instruction formats
GROUP #4 CHAPTER 10 JOEL FRAGA JAIME J.OCON DEISY HERNANDEZ.
Machine Instruction Characteristics
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Homework Problems 1. M1 runs the program P in 1.4 * 9 * ns or ns M2 runs the program P in 1.6*9800*10ns or ns Hence M2 is faster by.
Module 3 Instruction Set Architecture (ISA): ISA Level Elements of Instructions Instructions Types Number of Addresses Registers Types of Operands.
Execution of an instruction
Computer Architecture and Organization
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
Computer Architecture EKT 422
CSE 241 Computer Organization Lecture # 8 Ch. 7 Control Unit Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
Lecture 5 A Closer Look at Instruction Set Architectures Lecture Duration: 2 Hours.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Overview von Neumann Architecture Computer component Computer function
What is a program? A sequence of steps
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
EKT 422/4 COMPUTER ARCHITECTURE SoME-0809-I 1 Chapter 3a Instruction Sets: Characteristics and Functions.
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 2)
Instruction Sets. Instruction set It is a list of all instructions that a processor can execute. It is a list of all instructions that a processor can.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
CSC 221 Computer Organization and Assembly Language Lecture 06: Machine Instruction Characteristics.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Displacement (Indexed) Stack
Control Unit Lecture 6.
Computer Organization and ASSEMBLY LANGUAGE
Architecture Review Instruction Set Architecture
Microcomputer Programming
A Closer Look at Instruction Set Architectures: Expanding Opcodes
William Stallings Computer Organization and Architecture 8th Edition
Computer Organization and Assembly Language (COAL)
BIC 10503: COMPUTER ARCHITECTURE
Central Processing Unit
Computer Organization and ASSEMBLY LANGUAGE
Chapter 1 Introduction.
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
William Stallings Computer Organization and Architecture 8 th Edition Chapter 10 (Chap 12 edition 9) Instruction Sets: Characteristics and Functions.
ECEG-3202 Computer Architecture and Organization
COMPUTER ORGANIZATION AND ARCHITECTURE
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Instruction Set Architecture & Design CSE 241 Computer Engineering (1) هندسة الحاسبات (1) Lecture # 5 Ch. 3 Instruction Set Architecture & Design Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering

Course Web Page http://www.tsgaafar.faculty.zu.edu.eg Email: tsgaafar@yahoo.com

Instruction Set Architecture & Design

Machine Instruction Characteristics Outline Machine Instruction Characteristics Elements of machine instructions, instruction representation, number of Addresses, … etc. Types of Operands Numbers, characters, logical data Types of Operations

Instruction Cycle State Diagram

Elements of an instruction Instructions Instruction set Complete collection of instructions that are understood by a CPU, i.e., the set of all machine instructions. Instructions are represented in a binary form (machine language), or a symbolic form (assembly language). Elements of an instruction Operation code (op code) Do this … (e.g., ADD, I/O). Source operand reference To this … Result operand reference Put the answer here … Next instruction reference When you have done that, do this next ... Usually implicit (from PC). Immediate: value. Main memory: address. CPU register: register number. Implicit if one register exists. I/O device: I/O module & device. MM address if memory-mapped I/O. 2

Instruction Representation Within computer, each Instruction is represented by a sequence of bits, divided into fields. During the execution phase, an instruction is read from the IR register. CPU extracts the data from these fields to perform the required operation. For programmers, a symbolic representation is used. Opcodes  mnemonics, e.g., ADD, SUB, LOAD. Operands  symbolic names, e.g., Y = 514. Example: ADD R1, Y 5

Instruction Types Data processing Data storage Data movement Arithmetic and logic instructions. Arithmetic: computations (processing) on numeric data. Logic: operate on the bits of a word (any data type). Data storage Memory instructions. Data movement I/O instructions. Program flow control Test and branch instructions. 6

Number of Addresses (1) What is the maximum number of addresses would be needed in an instruction? “addresses” here means “explicit operand references”. Arithmetic & logic instructions would need the most # of addresses. Arithmetic & logic operations are either unary (one operand) or binary (two operands). Two addresses are needed to reference operands. One more address to store the result. One for next instruction (usually implicit). Most instructions are one-, two-, or three-operand. 7

Program to Execute: Y = (A–B)/(C+D×E) 3-address instructions 1-address instructions 2-address instructions MPY D, E would alter D 10

Number of Addresses (2) 3 addresses 2 addresses Operand 1, Operand 2, Result a = b + c; Needs very long words to hold everything. 2 addresses One address doubles as operand and result a = a + b Reduces length of instruction 8

Number of Addresses (3) 1 address 0 (zero) addresses Implicit second address Usually a register (accumulator: AC) Common on early machines 0 (zero) addresses All addresses implicit Uses a stack Last-in-first-out set of locations. Top of stack. e.g. push a push b add pop c c = a + b push 3 pop a pop b pop c Top of stack push 5 3 Top of stack 19 Top of stack Stack (Last-in first-out) 745 5 Top of stack . . . 9

Types of Operands Addresses Numbers Characters Logical Data A form of data. Unsigned integers. Numbers Characters IRA (ASCII): 7-bit code. An 8th bit may be used for parity. Logical Data Bit-oriented view of data (true/false). Store an array of logical data, manipulate bits of a data item. 14

Transfer of Control (Sequencing) Types of Operations Data Movement Arithmetic Logical I/O Transfer of Control (Sequencing) 18

Instruction must specify: 1. Data Transfer Instruction must specify: Location of source operand. Location of destination operand. Location of operand and amount of data could be specified as part of opcode or operand fields: Memory. Register. Top of stack. 19

1. Data Transfer – Common Operations 19

1. Data Transfer – CPU Actions In terms of CPU action, data transfer operations are perhaps the simplest type. If both source and destination are registers: Issue a command to transfer data from a register to another, which is completely internal. If one or both operands are in memory: Calculate memory address(es) of operand(s). Translate adress(es) from virtual to physical. Check the cache. If miss, issue a command to the memory module. 19

Types of Operations Data Transfer Arithmetic Logical I/O Transfer of Control 18

Add, Subtract, Multiply, Divide 2. Arithmetic Add, Subtract, Multiply, Divide Signed Integer (fixed-point) numbers Floating point numbers. May include Increment (a++) Decrement (a--) Negate (-a) Absolute (if a<0 then -a else a) May involve data transfer Desired arithmetic operation is performed by ALU 20

3. Logical – Common Operations 21

3. Logical – AND, OR, NOT, XOR, … To manipulate individual bits  bit twiddling. Could be used for bit masking: Reset a specific group of bits: Operation: AND Mask: 0 for each bit to be reset and 1 otherwise. Set a specific group of bits: Operation: OR Mask: 1 for each bit to be set and 0 otherwise. Toggle a specific group of bits: Operation: XOR Mask: 1 for each bit to be inverted and 0 otherwise. 21

3. Logical – Shift and Rotate Operations Logical right shift Logical left shift Arithmetic right shift Arithmetic left shift Right rotate Left rotate

May be done using data movement instructions (memory-mapped). 4. Input/Output May be done using data movement instructions (memory-mapped). May be using specific i/o instructions. May be done by a separate controller (DMA). 23

4. Input/Output – Common Operations 23