INSTRUCTION SET ARCHITECTURES

Slides:



Advertisements
Similar presentations
CH10 Instruction Sets: Characteristics and Functions
Advertisements

Instruction Set Design
Chapter 3 Instruction Set Architecture Advanced Computer Architecture COE 501.
CEG3420 Lec2.1 ©UCB Fall 1997 ISA Review CEG3420 Computer Design Lecture 2.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
RISC / CISC Architecture By: Ramtin Raji Kermani Ramtin Raji Kermani Rayan Arasteh Rayan Arasteh An Introduction to Professor: Mr. Khayami Mr. Khayami.
Computer Organization and Architecture
Instruction Set Architecture
Chapter 11 Instruction Sets
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.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Memory - Registers Instruction Sets
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
What is an instruction set?
Lecture 18 Last Lecture Today’s Topic Instruction formats
GROUP #4 CHAPTER 10 JOEL FRAGA JAIME J.OCON DEISY HERNANDEZ.
Lecture 17 Today’s Lecture –Instruction formats Little versus big endian Internal storage in the CPU: stacks vs. registers Number of operands and instruction.
Machine Instruction Characteristics
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,
Classifying GPR Machines TypeNumber of Operands Memory Operands Examples Register- Register 30 SPARC, MIPS, etc. Register- Memory 21 Intel 80x86, Motorola.
Chapter 5 A Closer Look at Instruction Set Architectures.
Chapter 5 A Closer Look at Instruction Set Architectures.
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
Computer Architecture and Organization
Microprocessors The ia32 User Instruction Set Jan 31st, 2002.
Computer Architecture EKT 422
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 19 & 20 Instruction Formats PDP-8,PDP-10,PDP-11 & VAX Course Instructor: Engr. Aisha Danish.
Chapter 11 Instruction Sets: Addressing Modes and Formats Gabriel Baron Sydney Chow.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Lecture 5 A Closer Look at Instruction Set Architectures Lecture Duration: 2 Hours.
What is a program? A sequence of steps
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 7, 8 Instruction Set Architecture.
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.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
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,
A Closer Look at Instruction Set Architectures
A Closer Look at Instruction Set Architectures
A Closer Look at Instruction Set Architectures: Expanding Opcodes
William Stallings Computer Organization and Architecture 8th Edition
Processor Organization and Architecture
Chapter 8 Central Processing Unit
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
A Closer Look at Instruction Set Architectures Chapter 5
Computer Architecture
ECEG-3202 Computer Architecture and Organization
Evolution of ISA’s ISA’s have changed over computer “generations”.
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

INSTRUCTION SET ARCHITECTURES Chapter 5

Introduction High-level languages hide it So, why do we need? Efficient programming Understanding the machine architecture

Instruction Formats Architectures can be differenced by the following: Number of bits (16, 32, 64) Operand storage in CPU (data in stack or registers) Number of explicit operands per instruction (0-3) Operand location (register-to-register, register-to- memory, memory-to-memory) Operations (types and access restrictions) Type and size of operands

Designing decisions for instruction sets Define the instruction set format is very important Factors to consider: Amount of space required by program Complexity of the instruction set Length of instructions Number of instructions

Continuing… How to choose the design? Short instructions are typically better (but reduces possibilities) Instructions of fixed length (easy to decode but waste space) Byte addressable Fixed length does not imply fixed number of operands Addressing modes Little or big endian? Registers (how many, and how to use)

Little versus big endian The way that computer stores bytes from multiple- byte data element Little endian = store lower significant byte at lower address) Big endian = guess… UNIX usually big, PCs usually little Intel always little, Motorola always big

OK, but what does it mean? If you have an integer: Byte 3 Byte 2 Base address + Little endian Big endian Byte 0 Byte 3 1 Byte 1 Byte 2 2 3

Pros | Cons Characteristic Little endian Big endian Negative values Know the size and skip bytes to find out Just look to the first byte String operations --- A bit faster Bitmap Uses the same idea (most significant bits on the lower addresses) 32-bit to 16 bit address conversion Requires addition High precision arithmetic Faster and easier Allow words to be written in non-word address boundaries Yes, do not waste space and makes programming easy No, wastes space. Networks are big endian Have to convert “Speak” same language

Internal storage in CPU Stack Use stack to execute instructions Operands found on top Don’t allow random access (Of course, it is a stack) Accumulator Minimize complexity Short Instructions General Purpose Register (GPR) Most widely accepted Fast Easy to deal

Continuing… GPR architecture can be broken in three Memory-memory Digital Equipment’s VAX Register-memory Intel, Motorola Load-store Data must be stored in register before operations are performed SPARC, MIPS, Alpha, PowerPC

Number of operands and instruction length Fixed length Wastes space but is fast Variable length More complex, but saves storage space Instruction need to be aligned with words Common formats OPCODE only OPCODE + 1 address (usually a memory) OPCODE + 2 addresses (usually registers, or one register, one memory) OPCODE + 3 addresses (usually registers, or combination of registers and memory)

Continuing… Machine instructions that have no operands must have a stack (where operations are made from top) to perform a operation that require one or two operands Instructions READ STO X STO Y LOAD X LOAD Y ADD STO Z Stack POS Memory X Y Z 5 2 3 2 3 3 5

Continuing… The same algorithm before would be like this according to the number of addresses: Note that in the examples I presume that Z is initially 0 Three addresses Two addresses One address READ X READ Y ADD Z, X, Y ADD Z, X LOAD X ADD Z, Y ADD Z LOAD Y

Expanding opcodes If you have a machine with “short opcodes”, you can use part of the “memory addressing bits” to expand opcodes (some opcodes do not need addresses), here is an example: You have a machine with 16-bit instructions and 16 registers, you can use 4 bits to opcodes with 12 bits to addresses or 8 bits to opcodes and 8 bits to addresses or 12 bits to opcodes and 4 bits to address or only opcodes

Continuing… 15 3-addresses codes (4 bits to opcodes, 12 bits to addresses) 0000 R1 R2 R3 1110 R1 R2 R3 14 2-addresses codes (8 bits to opcodes, 8 bits to addresses) 1111 0000 R1 R2 1111 1101 R1 R2 31 1-addresses codes (12 bits to opcodes, 4 bits to addresses) 1111 1110 0000 R1 1111 1111 1110 R2 16 0-addresses codes (16 bits to opcodes, 0 bits to addresses) 1111 1111 1111 0000 1111 1111 1111 1111

Instruction types Data movement Arithmetic Boolean Bit manipulation Transfer of control Special purpose

Data Movement Most frequently used instructions. Data is moved from memory into registers, registers to registers, registers to memory. May be instructions to move between memory and register, one only for registers RISC limits the instructions that can move to memory Many machines have different instructions to bytes and words MOVE, LOAD, PUSH, POP, EXCHANGE and variations

Arithmetic operations Instruction that deal with numbers (integer and float) Many instructions sets provides different instructions for different data sizes (improve performance) Many times operands are implied Use the flag register (to report errors like overflow, underflow, use as carry) ADD, SUBTRACT, MULTIPLY, DIVIDE, INCREMENT, DECREMENT, NEGATE

Boolean logic instructions Perform Boolean operations Allow bits to set, cleared and complemented Commonly used to control I/O devices Affect flag register AND, NOT, OR, XOR, TEST, COMPARE

Bit manipulation instructions Used for setting and resetting a bit or a group of bits within a given data word Include arithmetic and logical SHIFT and ROTATE instructions (to left and right)

Input/Output instructions Input – transports data from a device or port to a register or memory Output – transports data from register or memory to a device or port May be different for characters and numbers

Instructions for transfer of control Alter the normal sequence of program execution Branches, skips, procedure calls, returns, program termination Jump, conditional jump

Special purpose instructions String processing, high-level language support, protection, flag control, word/byte conversions, cache management, register access, address calculation, no-ops, any other instructions that don’t fit in the previously mentioned

Instruction set orthogonality Don’t create instructions that duplicate other instructions, that would be a waste Makes writing a language compiler easier, but have quite long words, with means the programs will be bigger and use more memory

Addressing Data types Addressing modes

Data types Numeric data (integers and floating point numbers) Signed / Unsigned Various lengths Might be different instructions for different lengths Nonnumeric (strings, Booleans, pointers) String Copy, move, search, modify Boolean AND, OR, XOR, NOT Pointers are addresses in memory

Address modes Allow specify where instructions operands are located Immediate addressing Direct addressing Register addressing Indirect addressing Indexed addressing Stack addressing (the operand is assumed to be on stack)

Immediate addressing Data to be operated is part of instruction Very fast because it is included with instruction Not very flexible because it is loaded at compile time

Direct addressing The value to be referenced is obtained by specifying its memory address directly to instruction Fast, not part of instruction, but the value in the address is loaded to the register Much more flexible

Register addressing A register, instead of memory, is used to specify the operand. Very similar to direct addressing but the address is from a register, so it is faster

Indirect addressing Very powerful Very flexible Bits in address field specify a memory address of a pointer, the actual address of the operand is found by going to the address referenced by the pointer There is also register indirect addressing, which is quite similar, but uses a register to point the data

Indexed addressing There is an index register and the address of the data we want is found by the sum of the value in the register to the address in the instruction There is also based addressing, which is very similar, but the opposite, the register holds the base address and the value given is the index Very useful to access arrays, and strings