Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions

Similar documents
Instruction Set Principles and Examples. Appendix B

CS4617 Computer Architecture

COSC 6385 Computer Architecture. Instruction Set Architectures

Lecture 4: Instruction Set Architecture

Instruction Set Design

Chapter 2. Instruction Set Principles and Examples. In-Cheol Park Dept. of EE, KAIST

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

Typical Processor Execution Cycle

COSC 6385 Computer Architecture - Instruction Set Principles

CSCE 5610: Computer Architecture

CPU Architecture and Instruction Sets Chapter 1

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Lecture 4: Instruction Set Design/Pipelining

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

COSC 6385 Computer Architecture. Defining Computer Architecture

Chapter 2A Instructions: Language of the Computer

Graduate Computer Architecture. Chapter 2. Instruction Set Principles

Instruction Set Architecture (ISA)

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

Chapter 2. Instruction Set Design. Computer Architectures. software. hardware. Which is easier to change/design??? Tien-Fu Chen

Chapter 2: Instructions How we talk to the computer

55:132/22C:160, HPCA Spring 2011

COMPUTER ORGANIZATION & ARCHITECTURE

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

CHAPTER 2: INSTRUCTION SET PRINCIPLES. Prepared by Mdm Rohaya binti Abu Hassan

Review of instruction set architectures

Instruction Sets: Characteristics and Functions

Instruction Set Architecture. "Speaking with the computer"

EC 413 Computer Organization

CHAPTER 5 A Closer Look at Instruction Set Architectures

ECE331: Hardware Organization and Design

Computer Organization CS 206 T Lec# 2: Instruction Sets

CHAPTER 5 A Closer Look at Instruction Set Architectures

Instruction Sets: Characteristics and Functions Addressing Modes

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

ECE 486/586. Computer Architecture. Lecture # 7

Computer Organization MIPS ISA

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set?

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design

CS/ECE/752 Chapter 2 Instruction Sets Instructor: Prof. Wood

CPE 631 Lecture 08: Virtual Memory

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10

17. Instruction Sets: Characteristics and Functions

ECE232: Hardware Organization and Design

CENG3420 Lecture 03 Review

CHAPTER 5 A Closer Look at Instruction Set Architectures

Chapter 1. Computer Abstractions and Technology. Lesson 3: Understanding Performance

Chapter 5. A Closer Look at Instruction Set Architectures

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

ECE232: Hardware Organization and Design

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types

EC-801 Advanced Computer Architecture

Lecture 3 Machine Language. Instructions: Instruction Execution cycle. Speaking computer before voice recognition interfaces

Instruction Set Architecture ISA ISA

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Instruction Set Architecture

Instruction Set Principles. (Appendix B)

COS 140: Foundations of Computer Science

Instructions: Language of the Computer

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3

Instruction Set Architecture

CA226 Advanced Computer Architecture

Computer Architecture

ECE 486/586. Computer Architecture. Lecture # 8

CISC 662 Graduate Computer Architecture. Classifying ISA. Lecture 3 - ISA Michela Taufer. In a CPU. From Source to Assembly Code

Cpu Architectures Using Fixed Length Instruction Formats

Chapter 4. The Processor

Lecture Topics. Branch Condition Options. Branch Conditions ECE 486/586. Computer Architecture. Lecture # 8. Instruction Set Principles.

Instructions: Language of the Computer

Chapter 13 Reduced Instruction Set Computers

Reduced Instruction Set Computer (RISC)

Computer Systems Architecture I. CSE 560M Lecture 3 Prof. Patrick Crowley

Overview. EE 4504 Computer Organization. Much of the computer s architecture / organization is hidden from a HLL programmer

Data Types. Numeric Data Types

CSE 141 Computer Architecture Spring Lecture 3 Instruction Set Architecute. Course Schedule. Announcements

Computer Architecture

General Purpose Processors

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017

Reduced Instruction Set Computer (RISC)

Understand the factors involved in instruction set

Chapter 2 Instruction: Language of the Computer

Computer Architecture. The Language of the Machine

Chapter 5. A Closer Look at Instruction Set Architectures. Chapter 5 Objectives. 5.1 Introduction. 5.2 Instruction Formats

When an instruction is initially read from memory it goes to the Instruction register.

Universität Dortmund. ARM Architecture

Chapter 4. The Processor

Chapter 5. A Closer Look at Instruction Set Architectures

Unsigned Binary Integers

Unsigned Binary Integers

ISA: The Hardware Software Interface

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points]

Real instruction set architectures. Part 2: a representative sample

CS3350B Computer Architecture MIPS Instruction Representation

Chapter 2 Instruction Set Principles and Examples

EN164: Design of Computing Systems Topic 03: Instruction Set Architecture Design

Assembly Language Design

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Transcription:

Structure of von Nuemann machine Arithmetic and Logic Unit Input Output Equipment Main Memory Program Control Unit 1 1 Instruction Set - the type of Instructions Arithmetic + Logical (ADD, SUB, MULT, DIV, SHIFT, AND, OR,XOR, NOT) Control - branch, jump, call, return Data Transfer - copy, load, store String - move, compare, search + Floating Point - the same as arithmetic but usually take bigger operands + System - OS and memory management + Decimal special purposes (for example COBOL) 2 2 Instruction Set Influences Everything Instructions Source Code Optimizing Compiler Object Code CPI + Cycle time + CPI and Datapath Complexity + Instruction Decode + Instruction Encode 3 3 Page 1 1

Classifying Instruction Set Architecture 4 4 The code sequence for C=A+B Stack Push A Push B Add Pop C Accumulator Load A Add B Store C Register (register memory) Load R1, A Add R3,R1, B Store C, R1 Register (load - store) Load R1, A Load R2, B Add R3,R1,R2 Store R3,C 5 5 Typical combinations of memory operands Number of memory addr. Max number of operands Type of architecture 0 3 Registerregister 1 2 Registermemory 2 2 Memorymemory 3 3 Memorymemory Examples Alpha, MIPS, SPARK Intel 80x86, Motorola68000 VAX VAX 6 6 Page 2 2

Comparing different architectures Type Advantages Disadvantages Registerregister Registermemory Memorymemory Simple, fixed-length instruction encoding. Simple code generation model. Instruction take similar number of clocks to execute Data can be accessed without a separate load instruction first. Instruction format tends to be easy to encode and yields good density. Most compact. Doesn t waste registers for temporaries Higher instruction count than architectures with memory references. More instructions and lower instruction density leads to larger programs. Clock per instruction vary by operand location. Operands are not equivalent since a source operand in a binary operation is destroyed. Encoding may restrict the number of registers. Large variation in instruction size. Large variation in work per instruction. Memory accesses create memory bottleneck 7 7 Interpreting Memory Addresses Most of the computers are byte addressed and provide access for bytes, half words (16 bits), words (32 bits) and double words (64 bits). There are two different conventions for ordering the bytes within larger object: - Little Endian Big Endian 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 Accesses to object larger than a byte must be aligned in many computers. 8 8 Aligned and misaligned addresses of byte An access to an objects of size s bytes at byte address A is aligned if A mod s = 0. Misaligned causes hardware complications, the memory is typically aligned on a multiple of a word or double word boundary, then such memory access may take multiple aligned memory references. Even if data are aligned, supporting byte, half-word and word accesses requires an alignment network to align bytes, half words and words in 64-bits registers. width of object Value of 3 low-order bits of byte address 0 1 2 3 4 5 6 7 1 byte aligned aligned aligned aligned aligned aligned aligned aligned 2 bytes misaligned misaligned misaligned misaligned 9 9 Page 3 3

Addresing Modes Addressing modes specify constants and registers in addition to locations in memory When a memory location is used, the actual memory address specified by the addressing mode is called the effective address. Addressing modes have the ability to significantly reduce instruction counts; they also add to the complexity of building a computer and may increase the average CPI of computers that implements those modes. 10 10 Memory addressing modes I 11 11 Memory addressing modes II 12 12 Page 4 4

Type and Size of Operands Encoding in the opcode designates the type of an operand (computers with tagged data are not use currently). Usually the type of an operand gives its size Common operand type include: Characters (8 bits) Half word (16 bits) Word (32 bits) Single-precision floating point (32 bits) Double-precision floating points( 2 words) + decimal format (packet, unpacked) Integers are almost represented as two s complement binary numbers Characters are usually in ASCII (+ Unicode in Java) Floating point IEEE standard 754 13 13 Operation in the Instruction Set Operator type Arithmetic and logical Data transfer Control System Floating point Decimal String Graphics Examples add, subtract, and, or, multiple, etc. load/store, move (on computers with memory addressing) branch jump, procedure call and return virtual memory management, operating system call add, multiply, divide, compare decimal add/multiply, decimal-to-character conversions string move, string compare pixel and vertex operation, compression/decompression operations 14 14 Instructions for Control Flow Four different types of control flow changes Conditional branches Jumps Procedure calls Procedure returns 15 15 Page 5 5

Addressing for Control Flow Instructions PC-relative destination is specified by supplying a displacement that is added to the program counter it enables position independence Dynamic addressing for example by naming a register that contains the target address; alternatively, the jump may permit any addressing mode to be used to supply the target address it enables register indirect jumps) Case or switch statements Virtual functions or methods Function pointers 16 16 Conditional Branch Options Name Condition code Condition register Examples How condition Advantages Disadvantages is tested 80x86, PowerPC, SPARK Alpha, MIPS Tests special bits set by ALU operations, possible under program control Tests arbitrary register with the result of a comparison Sometimes condition set is free Simple CC is extra state. Condition codes constraints the ordering of instruction since they pass information from one instruction to a branch Uses up a register Compare PA-RISC, Compare is part One My be too much work and branch VAX of the branch. instruction per instruction for Often compare rather than pipeline execution is limited to two for a subset branch 17 17 Procedure Invocation Options Procedure calls and returns include control transfer and possibly some state saving; at a minimum the return address must be saved somewhere, sometimes in a special link register or just a GPR There are two basic conventions in use to save registers Caller saving the calling procedure must save the register that it wants preserved for access after the call, and thus the called procedure need not worry about registers. Callee saving the called procedure must save the registers it wants to use, leaving the caller unrestrained. 18 18 Page 6 6

Encoding an Instruction Set The architect must balance several competing forces when encoding the instruction set: The desire to have as many registers and addressing modes as possible. The impact of the size of the register and addressing mode fields on the average instruction size and hence on the average program size. A desire to have instructions encoded into lengths that will be easy to handle in a pipelined implementation. 19 19 Encoding an Instruction Set - Variable It virtually allows all addressing modes to be with all operations. It is the best when there are many addressing modes and operations. It is used on VAX, Intel 80xx86, etc. 20 20 Encoding an Instruction Set - Fixed It combines the operation and the addressing mode into the opcode. Often fixed encoding will have only a single size for all instructions. It works the best when there are few addressing modes and operations. It is used on Alpha, MIPS, PowerPC, etc. 21 21 Page 7 7

Encoding an Instruction Set - Hybrid Reduce the variability in size and work of the variable architecture but provide multiple instruction lengths to reduce code size. It is used on IBM 360/70, Thumb, etc. 22 22 Page 8 8