Instruction Set Architectures. Part 1

Similar documents
Chapter 2: Instructions How we talk to the computer

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

Instruction Set Architecture. "Speaking with the computer"

Outline. What Makes a Good ISA? Programmability. Implementability

Outline. What Makes a Good ISA? Programmability. Implementability. Programmability Easy to express programs efficiently?

RISC, CISC, and ISA Variations

Instruction Set Principles and Examples. Appendix B

Typical Processor Execution Cycle

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Evolution of ISAs. Instruction set architectures have changed over computer generations with changes in the

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

Lecture 4: RISC Computers

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Processor Architecture

Processing Unit CS206T

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

Lecture 4: Instruction Set Architecture

Lecture 4: Instruction Set Design/Pipelining

Chapter 2 Instruction: Language of the Computer

Computer Organization CS 206 T Lec# 2: Instruction Sets

COS 140: Foundations of Computer Science

RISC Principles. Introduction

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

INTEL Architectures GOPALAKRISHNAN IYER FALL 2009 ELEC : Computer Architecture and Design

Lecture 4: RISC Computers

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

Introduction to Computers & Programming

Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University. See P&H Appendix , and 2.21

COSC 6385 Computer Architecture. Instruction Set Architectures

Alternate definition: Instruction Set Architecture (ISA) What is Computer Architecture? Computer Organization. Computer structure: Von Neumann model

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

CHAPTER 5 A Closer Look at Instruction Set Architectures

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10

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

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

Micro-programmed Control Ch 15

Reduced Instruction Set Computers

16.1. Unit 16. Computer Organization Design of a Simple Processor

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4)

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

Review of instruction set architectures

Micro-programmed Control Ch 15

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

EC-801 Advanced Computer Architecture

Instruction Set Architecture (ISA)

New Advances in Micro-Processors and computer architectures

Computer Architectures

CISC Attributes. E.g. Pentium is considered a modern CISC processor

CSE Introduction to Computer Architecture. Jeff Brown

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

Multicycle conclusion

CHAPTER 5 A Closer Look at Instruction Set Architectures

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

Instruction Set Principles. (Appendix B)

Virtual Machines and Dynamic Translation: Implementing ISAs in Software

COMPUTER ORGANIZATION & ARCHITECTURE

Computer Systems Laboratory Sungkyunkwan University

Micro-programmed Control Ch 17

Computer Architecture

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

Topic Notes: MIPS Instruction Set Architecture

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Instruction Set Design

What is Computer Architecture?

RISC & Superscalar. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 12. Instruction Pipeline no hazard.

VAX. Agenda. VAX and its History VAX ISA VAX Virtual Address Microcode

Computer Architecture

We briefly explain an instruction cycle now, before proceeding with the details of addressing modes.

General Purpose Processors

UNIT- 5. Chapter 12 Processor Structure and Function

Instruction content (2/2) Instruction content (1/2) The Instruction Set. Chapter 9. Each instruction must contain 4 basic pieces of information

Computer Architecture

Instructions: Language of the Computer

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

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

CENG3420 Lecture 03 Review

CA226 Advanced Computer Architecture

Chapter 2. lw $s1,100($s2) $s1 = Memory[$s2+100] sw $s1,100($s2) Memory[$s2+100] = $s1

COMPUTER ORGANIZATION & ARCHITECTURE

ECE232: Hardware Organization and Design

EECE 417 Computer Systems Architecture

RISC Processors and Parallel Processing. Section and 3.3.6

omputer Design Concept adao Nakamura

Instruction Set Architectures

Chapter 4. The Processor

More advanced CPUs. August 4, Howard Huang 1

Addressing Modes. Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack

ECE232: Hardware Organization and Design

Chapter 12. CPU Structure and Function. Yonsei University

Advanced Computer Architecture

Chapter 3 : Control Unit

Lecture 4: MIPS Instruction Set

Computer Architecture and Organization. Instruction Sets: Addressing Modes and Formats

Instruction Set Architectures. CS301 Prof. Szajda

Transcription:

Instruction Set Architectures Part 1 Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture Digital Design Circuit Design 1/9/02

Some ancient history Earliest (1940 s) computers were one-of-a-kind. Early commercial computers (1950 s), each new model had entirely different instruction set. Programmed at machine code or assembler level 1957 IBM introduced FORTRAN Much easier to write programs. Remarkably, code wasn t much slower than hand-written. Possible to use a new machine without reprogramming. Algol, PL/I, and other high-level languages followed performance not quite as good as Fortran 2

Impact of High-Level Languages Customers were delighted Computer makers weren t so happy Needed to write new compilers (and OS s) for each new model Written in assembly code Portable compilers didn t exist 3

4 IBM 360 architecture The first ISA used for multiple models IBM invested $5 billion 6 models introduced in 1964 Performance varied by factor of 50 24-bit addresses (huge for 1964) largest model only had 512 KB memory Huge success! Architecture still in use today Evolved to 370 (added virtual addressing) and 390 (32 bit addresses).

Let s learn from our successes... Early 70 s, IBM took another big gamble FS a new layer between ISA and highlevel language Put a lot of the OS function into hardware Huge failure Moral: Getting right abstraction is hard! 5

The Instruction Set Architecture The agreed-upon interface between: the software that runs on a computer and the hardware that executes it. Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture Digital Design Circuit Design 6

The Instruction Set Architecture that part of the architecture that is visible to the programmer instruction formats opcodes (available instructions) number and types of registers storage access, addressing modes exceptional conditions 7

Overall goals of ISA Can be implemented by simple hardware Can be implemented by fast hardware Instructions do useful things Easy to write (or generate) machine code 8

Key ISA decisions 9 instruction length are all instructions the same length? how many registers? where do operands reside? e.g., can you add contents of memory to a register? instruction format operands operations which bits designate what?? how many? how big? how are memory addresses computed? what operations are provided??

Running examples We ll look at four example ISA s: Digital s VAX (1977) - elegant Intel s x86 (1978) - ugly, but successful (IBM PC) MIPS focus of text, used in assorted machines PowerPC used in Mac s, IBM supercomputers,... VAX and x86 are CISC ( Complex Instruction Set Computers ) 10 MIPS and PowerPC are RISC ( Reduced Instruction Set Computers ) almost all machines of 80 s and 90 s are RISC including VAX s successor, the DEC Alpha

Instruction Length Variable: x86 Instructions vary from 1 to 17 Bytes long VAX from 1 to 54 Bytes Fixed: MIPS, PowerPC, and most other RISC s: all instruction are 4 Bytes long 11

Instruction Length Variable-length instructions (x86, VAX): - require multi-step fetch and decode. + allow for a more flexible and compact instruction set. Fixed-length instructions (RISC s) + allow easy fetch and decode. + simplify pipelining and parallelism. - instruction bits are scarce. 12

What s going on?? How is it possible that ISA s of 70 s were much more complex than those of 90 s? Doesn t everything get more complex? Today, transistors are much smaller & cheaper, and design tools are better, so building complex computer should be easier. How could IBM make two models of 370 ISA in the same year that differed by 50x in performance?? 13

Microcode Another layer - between ISA and hardware 1 instruction sequence of microinstructions µ-instruction specifies values of individual wires Each model can have different micro-language low-end (cheapest) model uses simple HW, long microprograms. We ll look at rise and fall of microcode later Meanwhile, back to ISA s... 14

How many registers? All computers have a small set of registers Memory to hold values that will be used soon Typical instruction will use 2 or 3 register values Advantages of a small number of registers: It requires fewer bits to specify which one. Less hardware Faster access (shorter wires, fewer gates) Faster context switch (when all registers need saving) Advantages of a larger number: Fewer loads and stores needed Easier to do several operations at once In 141, load means moving data from memory to register, store is reverse 15

VAX 16 registers How many registers? R15 is program counter (PC) Elegant! Loading R15 is a jump instruction x86 8 general purpose regs Fine print some restrictions apply Plus floating point and special purpose registers Most RISC s have 32 int and 32 floating point regs Plus some special purpose ones PowerPC has 8 four-bit condition registers, a count register (to hold loop index), and others. Itanium has 128 fixed, 128 float, and 64 predicate registers 16

Stack machine: Where do operands reside? Push loads memory into 1 st register ( top of stack ), moves other regs down Pop does the reverse. Add combines contents of first two registers, moves rest up. Accumulator machine: Only 1 register (called the accumulator ) Instruction include store and acc acc + mem Register-Memory machine : Arithmetic instructions can use data in registers and/or memory 17 Load-Store Machine (aka Register-Register Machine): Arithmetic instructions can only use data in registers.

Load-store architectures can do: add r1=r2+r3 can t do: add r1=r2+m(address) load r3, M(address) store r1, M(address) forces heavy dependence on registers, which is exactly what you want in today s CPUs - more instructions + fast implementation (e.g., easy pipelining) 18

Where do operands reside? VAX: register-memory Very general. 0, 1, 2, or 3 operands can be in registers x86: register-memory... But floating-point registers are a stack. Not as general as VAX instructions RISC machines: Always load-store machines I m not aware of any accumulator machines in last 20 years. But they may be used by embedded processors, and might conceivable be appropriate for 141L project. 19

Comparing the Number of Instructions Code sequence for C = A + B Stack Accumulator Register-Memory Load-Store Push A Load A Add C, A, B Load R1,A Push B Add B Load R2,B Add Store C Add R3,R1,R2 Pop C Store C,R3 20

Alternate ISA s A = X*Y + X*Z Stack Accumulator Reg-Mem Load-store 21

Computer of the day Jacquard loom late 1700 s for weaving silk Program on punch cards Microcode : each hole lifts a set of threads Or gate : thread lifted if any controlling hole punched 22

Card Punch Early programmers were well-paid (compared to loom operators) 23