Machine Instruction Characteristics

Slides:



Advertisements
Similar presentations
CH10 Instruction Sets: Characteristics and Functions
Advertisements

Instruction Set Design
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
INSTRUCTION SET ARCHITECTURES
Computer Organization and Architecture
Instruction Set Architecture
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
Instruction Set Architecture & Design
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Memory - Registers Instruction Sets
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
What is an instruction set?
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.
COMPUTER ORGANIZATIONS CSNB123 May 2014Systems and Networking1.
Instruction Set Architecture
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.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
CSC 3210 Computer Organization and Programming Chapter 1 THE COMPUTER D.M. Rasanjalee Himali.
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
Module 3 Instruction Set Architecture (ISA): ISA Level Elements of Instructions Instructions Types Number of Addresses Registers Types of Operands.
Execution of an instruction
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Computer Architecture and Organization
Computer Architecture EKT 422
COMPUTER ORGANIZATIONS CSNB123 NSMS2013 Ver.1Systems and Networking1.
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.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
What is a program? A sequence of steps
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
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.
Basic Computer The following discussions are based on a fictitious computer called “Basic Computer” by the author of the textbook It’s a much better way.
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,
Computer Organization and Architecture Dr. B T P Madhav Professor & CSRG Head Department of ECE, K L University.
Control Unit Lecture 6.
Microcomputer Programming
Computer Organization and Assembly Language (COAL)
Processor Organization and Architecture
BIC 10503: COMPUTER ARCHITECTURE
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
Central Processing Unit
Computer Organization and ASSEMBLY LANGUAGE
Processor Organization and Architecture
Asst. Prof. Dr. Gazi Erkan BOSTANCI Slides are mainly based on
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:

Machine Instruction Characteristics

Machine Instruction Characteristics Machine Instructions- are instructions executed by the processor. Instruction set- a collection of instructions that the processor can execute

Elements of a machine instruction Opcode- uses a binary code which specifies the operation to be preformed. Source operand reference- the input for the operation Result operand reference- the result produced by the operation Next instruction reference- tells the processor where to get the next instruction

Source and result operands can be found in Main or virtual memory Processor register- contains registers that can be used by machine instructions Immediate- the operand value is being contained when the instruction is being executed I/O devices- instruction specifies I/O module and device but if memory mapped then just another main or virtual memory address

Representation of instruction OPCODE (4 Bits) Ref to Operand 1 (6 Bits) Ref to Operand 2 (6 Bits) An instruction format is used to define the layout of the bits allocated to these elements of instructions. The instruction format explicitly or implicitly indicates the addressing Modes used for each operand in that instruction.

Instruction format Instruction length: - The longer instruction length gives: More Opcodes More operands More addressing modes Greater address range.

Factors considered for instruction length Memory Size. Memory organization. Bus structure Processor speed Processor complexity.

Allocation of Bits for different fields in an instruction Number of addressing modes. Number of operands. Register versus memory. Number of register sets. Address range. Address granularity.

Variable length instructions Advantages: - Provides flexibility in addressing modes. Provides complex addressing modes. Reduces number of instruction fetch cycles. Reduces amount of space taken by a program. Disadvantages: - Requires more complex CPU. Decoding of instruction becomes difficult.

Instruction Sets Instruction Characteristics Types of Operands Types of Operations

Instruction Representation Are represented by a sequence of bits It is common to use “symbolic representation” of machine instructions Op codes and operands are represented by abbreviations called “mnemonics”

Mnemonics ADD add SUB subtract MUL multiply DIV divide LOAD load data from memory STOR store data to memory

Instruction types Data processing- arithmetic and logic instructions Data storage- moving data into or out of register or memory locations Data movement- I/O instructions Control- test and branch instructions

Number of Addresses A traditional way of describing processor architecture What is the maximum number of addresses one might need in an instruction? An instruction could be required to contain four addresses

Number of Addresses 3 addresses instructions Operand 1, Operand 2, Result a = b + c; May be a forth - next instruction (usually implicit) Not common Needs very long words to hold everything

Number of Addresses 2 addresses instructions One address doubles as operand and result a = a + b; Reduces length of instruction Requires some extra work Temporary storage to hold some results

Number of Addresses 1 address instructions Implicit second address Usually a register (accumulator) Common on early machines E.g. ADD B

Number of Addresses Zero address instruction: Special memory organization Last in first out (Stack) Stack is a known location E.g. CMA

Utilization of Instruction Addresses (Nonbranching Instructions) Number of Addresses Utilization of Instruction Addresses (Nonbranching Instructions)

Number of Addresses 1 address instructions 2 Or 3 address instructions One general purpose register Multiple general purpose registers

Instruction Set Design Operation Repertoire- How many and which operations to provide, and how complex the operations should be. Data Types- The various types of data upon which operations are performed. Instruction Format- Instruction length (in bits), number of addresses and size of fields.

Instruction Set Design Registers- Number of processor registers that can be referenced by instructions, and their use Addressing- The mode or modes by which the address of an operand is specified.

Types of operands

TYPES OF OPERANDS Addresses Numbers Characters Logical Data Specialized Data Types Data Structures First 4 are the most important general categories of data Last 2: Ex: list or string of characters

Addresses Main or Virtual memory address Unsigned Integers By calculating on the operand reference we can determine the main or Virtual memory address. This can be considered an unsigned integer and therefore data.

Numbers All machine languages include numeric types Non-numeric processing: counters, field widths, etc Numbers in a machine are limited by magnitude and precision Consequences: rounding, overflow, underflow

Numerical Data Binary integer or Binary fixed point Binary floating point Decimal

Decimal Majority of users deal with decimals Necessity to convert from decimal to binary on input and binary to decimal on output Packed decimal

Packed Decimal Used when there is a great deal of I/O and simple computation Each decimal digit is represented by a 4-bit code. Ex: 0 = 0000, 1 = 0001 Numbers are formed by a string of 4-bit codes usually in multiples of 8-bit 246 = 0000 0010 0100 0110 Positive: 1100 Negative: 1101 Clearly less compact than a straight binary representation Negative numbers can be represented by putting a 4-bit sign digit at either left or right end of a string

Characters Text or character strings Represented by a sequence of bits Morse Code International Reference Alphabet (IRA) American Standard Code for Information Interchange (ASCII) Extended Binary Coded Decimal Interchange Code (EBCDIC) Data processing and Communication Systems Each character is represented in a 7-bit pattern. Thus, 128 characters can be represented. Some of these are control characters maybe for printing and whatnot Transmitted using 8-bit per characters. 8th bit may be a 0 or used as parity error check EBCDIC: IBM mainframes, 8-bit code, compatible with packed decimals as well

Logical Data Consider n-bit unit as consisting of n 1-bit items of data, each having a value of 0 or 1 Advantages: Store array of Boolean or Binary data items Manipulating bits of data items Ex: Convert from IRA to packed decimals (only need the first four bits), Floating point Operations (you might want to round)

Types of Operations Data Transfer Arithmetic Logical Conversion Input/output System Control Transfer of Control

Data Transfer Operation Name Description Move(Transfer) Store Load (Fetch) Exchange Clear ( Reset) Set Push Pop Transfer word from source to destination From processor to memory From memory to processor Swap contents of source and destination Transfer 0s to destination Transfer 1s to destination Word from source to top of stack From top of stack to destination

Arithmetic Operation Name Description Add Subtract Multiply Divide Absolute Negate Increment Decrement Compute sum of two operands Difference of two operands Product of two operands Quotient of two operands Replace by its absolute value Change sign Add 1 to operand Subtract 1 to operand

Logical Operation Name Description AND; OR; NOT; OR Test Compare Set Control Variables Shift Variables Perform the specified logical operation bitwise Test specified condition; set flags based on outcome Make logical and arithmetic comparison of two operands Class of instructions to set controls for protection purposes, interrupt handling, timer control. Left/right operand introducing constants at end. Left/right with wraparound end

Conversion Operation Name Description Translate Convert Translate values in a section of memory based on a table of correspondences Convert the contents of a word from one form to another. E.g(packed decimal to binary

I/O Operation Name Description Input (Read) Output ( Write) Start I/O End I/O Transfer data from specified I/O port or device to destination From specified source to I/O port or device Transfer instructions to I/O processor to initiate I/O operation Transfer status info from I/O system to specified destination

System Of Control Can be executed only while the processor is in a certain privileged state or is executing a program in a special privileged area of memory. These instructions, are reserved for the use of the operating system. Examples: A system control instruction may read or alter a control register An instruction to read or modify a storage protection key Access to process control blocks in multiprogramming system

Transfer Of Control Description Operation Name Jump (Branch) Unconditional Transfer: load PC with specified address Test condition: either load PC with specified address or do nothing. Place current program control info in known location; jump to specified address Replace contents of PC and other register from known location Fetch operand from location and execute as instructed Increment PC to skip next instruction Either skip or do nothing based on condition Stop program execution Test specified repeatedly and resume condition No operation is performed; but program execution is continued. Jump (Branch) Jump Conditional Jump to Subroutine Return Execute Skip Skip conditional Halt Wait (Hold) No Operation

QUESTIONS How many different address designs are there? Name two types of operations. What are the most general categories of data? What type of endian mode does x86 use? What are the most used Character Codes nowadays? What are the elements of machine instruction? What are the advantages of Logical Data?