Designing an Instruction Set

Size: px
Start display at page:

Download "Designing an Instruction Set"

Transcription

1 Designing an Instruction Set Lab 4 due today NEXT TUESDAY, /22! 6.4 Fall 22 /7/ L2 Instruction Set

2 Let s Build a Simple Computer Data path for computing N*(N-) N A SEL B SEL A LE L.E. A B LE L.E. B * - ANSWER L.E. = load enable. Register only loads new value when LE= 6.4 Fall 22 /7/ L2 Instruction Set 2

3 A Programmable Control System Computing N*(N-) with this data path is a multi-step process. We can control the processing at each step with a FSM. If we allow different control sequences to be loaded into the control FSM, then we allow the machine to be programmed. A B N A A * B Control FSM A SEL B SEL A LE B LE B B - A A * B 6.4 Fall 22 /7/ L2 Instruction Set 3

4 A First Program A B N S Once more, writing a control program is nothing more than filling in a table: A A * B S B B - A A * B S2 S3 S S N N S N+ S N AA sel sel AA LE LE B sel sel B LE LE S Fall 22 /7/ L2 Instruction Set 4

5 An Optimized Program A B N S Some parts of the program can be computed simultaneously: A A * B S N S N+ A sel A LE B sel B LE B B - S 2 A A * B S2 S Fall 22 /7/ L2 Instruction Set 5

6 Computing Factorial The advantage of a programmable control system is that we can reconfigure it to compute new functions. In order to compute N! we will need to add some new logic and an input to our control FSM: A SEL A LE L.E. A * N B SEL B LE L.E. B - ANSWER =? Control FSM A sel B sel A le B le 6.4 Fall 22 /7/ L2 Instruction Set 6

7 Control Structure for Factorial B N A A A * B B B - Z= DONE S Z= S S2 Programmability allows us to reuse data paths to solve new problems. What we need is a general purpose data path, which can be used to efficiently solve most problems as well as a easier way to control it. Z - - Z - - S S N+ S N A sel N S N+ A sel A A LE LE B sel sel B LE LE 6.4 Fall 22 /7/ L2 Instruction Set 7

8 A LE A SEL ANSWER L.E. A * Control FSM A Programmable Engine N B SEL B LE L.E. A SEL B SEL A LE B LE B - =? We ve used the same data paths for computing N*(N-) and Factorial; there are a variety of other computations we might implement simply by re-programming the control FSM. Although our little machine is programmable, it falls short of a practical general-purpose computer and fails the Turing Universality test for three primary reasons:. It has very limited storage: it lacks the expandable memory resource of a Turing Machine. 2. It has a tiny repertoire of operations. 3. The program is fixed. It lacks the power, e.g., to generate a new program and then execute it. 6.4 Fall 22 /7/ L2 Instruction Set 8

9 A General-Purpose Computer The von Neumann Model Many architectural approaches to the general purpose computer have been explored. The one on which nearly all modern, practical computers is based was proposed by John von Neumann in the late 94s. Its major components are: Input/ Output Central Processing Unit Main Memory Central Processing Unit (CPU): containing several registers, as well as logic for performing a specified set of operations on their contents. Memory: storage of N words of W bits each, where W is a fixed architectural parameter, and N can be expanded to meet needs. I/O: Devices for communicating with the outside world. 6.4 Fall 22 /7/ L2 Instruction Set 9

10 The Stored Program Computer The von Neumann architecture easily addresses the first two limitations of our simple programmable machine example: A richer repertoire of operations, and An expandable memory. Main Memory But how does it achieve programmability? Key idea: Memory holds not only data, but coded instructions that make up a program. CPU fetches and executes interprets successive instructions of the program... Central Processing Unit instruction instruction instruction data data data Program is simply data for the interpreter as in a Universal Turing Machine! Single expandable resource pool main memory constrains both data and program size. 6.4 Fall 22 /7/ L2 Instruction Set

11 Anatomy of a von Neumann Computer Internal storage Data Paths control status Control Unit address data MEMORY address instructions dest registers + PC R R2+R3 INSTRUCTIONS coded as binary data asel bsel PROGRAM COUNTER or PC: Address of next instruction to be executed operations fn ALU Cc s logic to translate instructions into control signals for data path 6.4 Fall 22 /7/ L2 Instruction Set

12 Instruction Set Architecture Coding of instructions raises some interesting choices... Tradeoffs: performance, compactness, programmability Uniformity. Should different instructions Be the same size? Take the same amount of time to execute? Trend: Uniformity. Affords simplicity, speed, pipelining. Complexity. How many different instructions? What level operations? Level of support for particular software operations: array indexing, procedure calls, polynomial evaluate, etc Reduced Instruction Set Computer (RISC) philosophy: simple instructions, optimized for speed Mix of engineering & Art... Trial (by simulation) is our best technique for making choices! Our representative example: the β architecture! 6.4 Fall 22 /7/ L2 Instruction Set 2

13 β Programming Model a representative, simple, contemporary RISC Processor State Main Memory PC Fetch/Execute loop: loop: r r r bit words 32 bit words (4 bytes) next instruction fetch Mem[PC] PC PC = PC PC + 4 execute fetched instruction (may (may change PC!) PC!) repeat! r3... General Registers Even though each memory word is 32-bits wide, for historical reasons the β uses byte memory addresses. Since each word contains four 8-bit bytes, addresses of consecutive words differ by Fall 22 /7/ L2 Instruction Set 3

14 β Instruction Formats All Beta instructions fit in a single 32-bit word, whose fields encode combinations of a 6-bit OPCODE (specifying one of < 64 operations) several 5-bit OPERAND locations, each one of the 32 registers an embedded 6-bit constant ( literal ) There are two instruction formats: Opcode, 3 register operands OPCODE (2 sources, destination) r c r a r b unused Opcode, 2 register operands, OPCODE r c r a 6-bit signed constant 6-bit literal constant 6.4 Fall 22 /7/ L2 Instruction Set 4

15 β ALU Operations Sample coded operation: ADD instruction unused OPCODE =, dictating ADD r c =3, dictating R3 as destination r a =, r b =2 dictating R and R2 as source locations What we prefer to write: ADD(r, r2, r3) ( assembly language ) ADD(ra, rb, rc): Reg[rc] = Reg[ra] + Reg[rb] Add the contents of ra to the contents of rb; store the result in rc Similar instructions for other ALU operations: arithmetic: ADD, SUB, MUL, DIV compare: CMPEQ, CMPLT, CMPLE boolean: AND, OR, XOR shift: SHL, SHR, SAR 6.4 Fall 22 /7/ L2 Instruction Set 5

16 β ALU Operations with Constant ADDC instruction: adds constant, register contents: OPCODE =, dictating ADDC r c =3, dictating R3 as destination Symbolic version: ADDC(r, -3, r3) ADDC(ra, const, rc): Reg[rc] = Reg[ra] + sxt(const) Add the contents of ra to const; store the result in rc r a =, dictating R as first operand constant field, indicating -3 as second operand (sign-extended!) Similar instructions for other ALU operations: arithmetic: ADDC, SUBC, MULC, DIVC compare: CMPEQC, CMPLTC, CMPLEC boolean: ANDC, ORC, XORC shift: SHLC, SHRC, SARC 6.4 Fall 22 /7/ L2 Instruction Set 6

17 Do We Need Built-in Constants? From Hennessy & Patterson Percentage of the operations that use a constant operand One One way way to to answer architectural questions is is to to evaluate the the consequences of of different choices using carefully chosen representative benchmarks (programs and/or code code sequences). Make choices that that are are best according to to some metric (cost, performance, ). ). 6.4 Fall 22 /7/ L2 Instruction Set 7

18 Baby s First Beta Program (fragment) Suppose we have N in r, and want to compute N*(N-), leaving the result in r2: SUBC(r,,r2) MUL(r2,r,r2) put N- into r2 leave N*(N-) in r2 These two instructions do what our little ad-hoc machine did. Of course, limiting ourselves to registers for storage falls short of our ambitions... it amounts to the finite storage limitations of an FSM! Needed: instruction-set support for reading and writing locations in main memory Fall 22 /7/ L2 Instruction Set 8

19 β Loads & Stores OPCODE r c r a 6-bit signed constant LD(ra, const, rc) ST(rc, const, ra) Reg[rc] = Mem[Reg[ra] + sxt(const)] Fetch into rc the contents of the memory location whose address is C plus the contents of ra Abbreviation: LD(C, rc) for LD(R3, C, rc) Mem[Reg[ra] + sxt(const)] = Reg[rc] Store the contents of rc into the memory location whose address is C plus the contents of ra Abbreviation: ST(rc, C) for ST(rc, C, R3) BYTE ADDRESSES, but but only only 32-bit word word accesses to to word-aligned addresses are are supported. Low Low two two address bits bits are are ignored! 6.4 Fall 22 /7/ L2 Instruction Set 9

20 Operations done on registers Registers hold Temporary values : 4: 8: C: : Storage Conventions Addr assigned at compile time int x, y; Variables live in memory y = x * 37; n r x y translates to or, more humanely, to Compilation approach: LOAD, COMPUTE, STORE LD(r3, x8, r) MULC(r, 37, r) ST(r, xc, r3) x=x8 y=xc LD(x, r) MULC(r, 37, r) ST(r, y) Ra defaults to R3 () 6.4 Fall 22 /7/ L2 Instruction Set 2

21 Absolute: (constant) Common Addressing Modes β can do these with appropriate choices for Ra and const Value = Mem[constant] Use: accessing static data Indirect (aka Register deferred): (Rx) Value = Mem[Reg[x]] Use: pointer accesses Displacement: constant(rx) Value = Mem[Reg[x] + constant] Use: access to local variables Indexed: (Rx + Ry) Value = Mem[Reg[x] + Reg[y]] Use: array accesses (base+index) Memory Value = Mem[Mem[Reg[x]]] Use: access thru pointer in mem Autoincrement: (Rx)+ Value = Mem[Reg[x]]; Reg[x]++ Use: sequential pointer accesses Autodecrement: -(Rx) Value = Reg[X]--; Mem[Reg[x]] Use: stack operations Scaled: constant(rx)[ry] Value = Mem[Reg[x] + c + d*reg[y]] Use: array accesses (base+index) 6.4 Fall 22 /7/ Argh! Is the complexity worth the cost? Need a cost/benefit analysis! L2 Instruction Set 2

22 Memory Operands: Usage From Hennessy & Patterson Usage of different memory operand modes 6.4 Fall 22 /7/ L2 Instruction Set 22

23 Capability so far: Expression Evaluation Translation of an Expression: int x, y; y = (x-3)*(y+23456) x: long() y: long() c: long(23456)... LD(x, r) SUBC(r,3,r) LD(y, r2) LD(c, r3) ADD(r2,r3,r2) MUL(r2,r,r) ST(r,y) 6.4 Fall 22 /7/ VARIABLES are are allocated storage in in main main memory VARIABLE references translate to to LD LD or or ST ST OPERATORS translate to to ALU ALU instructions SMALL CONSTANTS translate to to ALU ALU instructions w/ w/ built-in constant LARGE CONSTANTS translate to to initialized variables NB: Here we assume that variable addresses fit into 6-bit constants! L2 Instruction Set 23

24 Model thus far: Can We Run Any Algorithm? Executes instructions sequentially Number of operations executed = number of instructions in our program! Good news: programs can t loop forever! Halting problem is solvable for our current Beta subset! Bad news: can t compute Factorial: Only supports bounded-time computations; Can t do a loop, e.g. for Factorial! 6.4 Fall 22 /7/ NOT Universal! Needed: ability to change the PC. L2 Instruction Set 24

25 Beta Branch Instructions The Beta s branch instructions provide a way of conditionally changing the PC to point to some nearby location and, optionally, remembering (in Rc) where we came from (useful for procedure calls). OPCODE r c r a 6-bit signed constant NB: offset is a SIGNED CONSTANT encoded as part of the instruction! BEQ(Ra, label, Rc): Branch if equal PC = PC + 4; if (REG[RA] == ) { Reg[RC] = PC; PC = PC + 4*offset; } else Reg[RC] = PC; BNE(Ra, label, Rc): Branch if not equal PC = PC + 4; if (REG[RA]!= ) { Reg[RC] = PC; PC = PC + 4*offset; } else Reg[RC] = PC; 6.4 Fall 22 /7/ L2 Instruction Set 25

26 Now we can do Factorial... Synopsis (in C): Input in n, output in ans r, r2 used for temporaries follows algorithm of our earlier data paths. int n, ans; r = ; r2 = n; while (r2!= ) do { r = r * r2; r2 = r2 } ans = r; Beta code, in assembly language: n: long(23) ans: long()... ADDC(r3,, r) r = LD(n, r2) r2 = n loop: BEQ(r2, done, r3) while (r2!= ) MUL(r, r2, r) r = r * r2 SUBC(r2,, r2) r2 = r2 - BEQ(r3, loop, r3) Always branches! done: ST(r, ans, r3) ans = r 6.4 Fall 22 /7/ L2 Instruction Set 26

27 Summary Programmable data paths provide some algorithmic flexibility, just by changing control structure. Interesting control structure optimization questions e.g., what operations can be done simultaneously? von Neumann model for general-purpose computation: need support for sufficiently powerful operation repertoire Expandable Memory Interpreter for program stored in memory ISA design requires tradeoffs, usually based on benchmark results: art, engineering, evaluation & incremental optimizations Compilation strategy runtime discipline for software implementation of a general class of computations Typically enforced by compiler, run-time library, operating system. We ll see more of these! 6.4 Fall 22 /7/ L2 Instruction Set 27

6.004 Computation Structures Spring 2009

6.004 Computation Structures Spring 2009 MIT OpenCourseWare http://ocw.mit.edu 6.4 Computation Structures Spring 29 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Designing an Instruction Set

More information

Designing an Instruction Set

Designing an Instruction Set Designing an Instruction Set Nerd Chef at work. move flour,bowl add milk,bowl add egg,bowl move bowl,mixer rotate mixer... WARD & HALSTEAD 6.004 NERD KIT Handouts: Lecture Slides, β docs L12 Instruction

More information

9. Programmable Machines

9. Programmable Machines 9. Programmable Machines 6.004x Computation Structures Part 2 Computer Architecture Copyright 2015 MIT EECS 6.004 Computation Structures L09: Programmable Machines, Slide #1 Example: Factorial factorial(n)

More information

Concocting an Instruction Set

Concocting an Instruction Set Concocting an Instruction Set Nerd Chef at work. move flour,bowl add milk,bowl add egg,bowl move bowl,mixer rotate mixer... Read: Chapter 2.1-2.7 L03 Instruction Set 1 A General-Purpose Computer The von

More information

A General-Purpose Computer The von Neumann Model. Concocting an Instruction Set. Meaning of an Instruction. Anatomy of an Instruction

A General-Purpose Computer The von Neumann Model. Concocting an Instruction Set. Meaning of an Instruction. Anatomy of an Instruction page 1 Concocting an Instruction Set Nerd Chef at work. move flour,bowl add milk,bowl add egg,bowl move bowl,mixer rotate mixer... A General-Purpose Computer The von Neumann Model Many architectural approaches

More information

Concocting an Instruction Set

Concocting an Instruction Set Concocting an Instruction Set Nerd Chef at work. move flour,bowl add milk,bowl add egg,bowl move bowl,mixer rotate mixer... Read: Chapter 2.1-2.7 L04 Instruction Set 1 A General-Purpose Computer The von

More information

Concocting an Instruction Set

Concocting an Instruction Set Concocting an Instruction Set Nerd Chef at work. move flour,bowl add milk,bowl add egg,bowl move bowl,mixer rotate mixer... Read: Chapter 2.1-2.6 L04 Instruction Set 1 A General-Purpose Computer The von

More information

A Bit of History. Program Mem Data Memory. CPU (Central Processing Unit) I/O (Input/Output) Von Neumann Architecture. CPU (Central Processing Unit)

A Bit of History. Program Mem Data Memory. CPU (Central Processing Unit) I/O (Input/Output) Von Neumann Architecture. CPU (Central Processing Unit) Memory COncepts Address Contents Memory is divided into addressable units, each with an address (like an array with indices) Addressable units are usually larger than a bit, typically 8, 16, 32, or 64

More information

Concocting an Instruction Set

Concocting an Instruction Set Concocting an Instruction Set Nerd Chef at work. move flour,bowl add milk,bowl add egg,bowl move bowl,mixer rotate mixer... Lab is posted. Do your prelab! Stay tuned for the first problem set. L04 Instruction

More information

How Computers Work Lecture 2. Assembly Tools Calling Conventions. Review: β Model of Computation Processor State

How Computers Work Lecture 2. Assembly Tools Calling Conventions. Review: β Model of Computation Processor State How Computers Work Lecture 2 Assembly Tools Calling Conventions How Computers Work Lecture 2 Page 1 PC r0 r1 r2 Review: β Model of Computation Processor State Instruction Memory 32 bits (4 bytes) Fetch/Execute

More information

6.004 Computation Structures Spring 2009

6.004 Computation Structures Spring 2009 MIT OpenCourseWare http://ocw.mit.edu 6.004 Computation Structures Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Machine Language, Assemblers,

More information

Computation structures

Computation structures Computation structures Pierre Wolper Email: Pierre.Wolper@ulg.ac.be URL: http: //www.montefiore.ulg.ac.be/~pw/ http: //www.montefiore.ulg.ac.be/ ~pw/cours/struct.html References Stephen A. Ward and Robert

More information

Operands and Addressing Modes

Operands and Addressing Modes Operands and Addressing Modes Where is the data? Addresses as data Names and Values Indirection L5 Addressing Modes 1 Last Time - Machine Language 32-bit (4-byte) ADD instruction: 000000001000001000011

More information

Operands and Addressing Modes

Operands and Addressing Modes Operands and Addressing Modes Where is the data? Addresses as data Names and Values Indirection L5 Addressing Modes 1 Last Time - Machine Language 32-bit (4-byte) ADD instruction: 00000 0 00 100 00 0 1

More information

Programmable Machines. One More Functional Unit

Programmable Machines. One More Functional Unit Comp, Spring 5 / Lecture page Programmable Machines + In order to compute we need only storage, data paths, and control Help! A General Purpose computer requires one additional thing PROGRAMMABILITY Comp

More information

Operands and Addressing Modes

Operands and Addressing Modes Operands and Addressing Modes Where is the data? Addresses as data Names and Values Indirection L5 Addressing Modes 1 Assembly Exercise Let s write some assembly language programs Program #1: Write a function

More information

D. Suppose the following code were running on a Beta implementation with a 5 -stage pipeline, full bypassing and 1 branch delay slot with annulment.

D. Suppose the following code were running on a Beta implementation with a 5 -stage pipeline, full bypassing and 1 branch delay slot with annulment. Page 1 of 18 Pipelined Beta indicates problems that have been selected for discussion in section, time permitting. Problem 1. Beta quickies. A. In a 5 -stage pipelined Beta, when does the hardware use

More information

indicates problems that have been selected for discussion in section, time permitting.

indicates problems that have been selected for discussion in section, time permitting. Page 1 of 11 Building the Beta indicates problems that have been selected for discussion in section, time permitting. Problem 1. Beta quickies: A. In an unpipelined Beta implementation, when is the signal

More information

indicates problems that have been selected for discussion in section, time permitting.

indicates problems that have been selected for discussion in section, time permitting. Page 1 of 12 Machine language indicates problems that have been selected for discussion in section, time permitting. Problem 1. Hand-compile the following C fragments into Beta assembly language. You can

More information

ANEXA la Cursul CN2_2 Procesorul RISC (Beta, fara banda de asamblare) (

ANEXA la Cursul CN2_2 Procesorul RISC (Beta, fara banda de asamblare) ( ANEXA la Cursul CN2_2 Procesorul RISC (Beta, fara banda de asamblare) (http://6004.csail.mit.edu/) 1 2 3 // Beta PC logic module pc(clk,reset,pcsel,offset,jump_addr,branch_addr,pc,pc_plus_4); input clk;

More information

Building the Beta. Handouts: Lecture Slides, PS 7, Lab 6. I wonder where this goes? Spring /5/01. L15- Building the Beta 1 A B

Building the Beta. Handouts: Lecture Slides, PS 7, Lab 6. I wonder where this goes? Spring /5/01. L15- Building the Beta 1 A B Building the Beta I wonder where this goes? B LU Beta Kit 0 1 Instruction Handouts: Lecture Slides, PS 7, Lab 6 L15- Building the Beta 1 CPU esign Tradeoffs Maximum Performance: measured by the numbers

More information

Programmable Machines

Programmable Machines Programmable Machines Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. Quiz 1: next week Covers L1-L8 Oct 11, 7:30-9:30PM Walker memorial 50-340 L09-1 6.004 So Far Using Combinational

More information

Programmable Machines

Programmable Machines Programmable Machines Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. Quiz 1: next week Covers L1-L8 Oct 11, 7:30-9:30PM Walker memorial 50-340 L09-1 6.004 So Far Using Combinational

More information

6.004 Computation Structures Spring 2009

6.004 Computation Structures Spring 2009 MIT OpenCourseWare http://ocw.mit.edu 6.004 Computation Structures Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. M A S S A C H U S E T T

More information

3.0 Instruction Set. 3.1 Overview

3.0 Instruction Set. 3.1 Overview 3.0 Instruction Set 3.1 Overview There are 16 different P8 instructions. Research on instruction set usage was the basis for instruction selection. Each instruction has at least two addressing modes, with

More information

COMPUTER ORGANIZATION & ARCHITECTURE

COMPUTER ORGANIZATION & ARCHITECTURE COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5a 1 What are Instruction Sets The complete collection of instructions that are understood by a CPU Can be considered as a functional

More information

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

ISA and RISCV. CASS 2018 Lavanya Ramapantulu ISA and RISCV CASS 2018 Lavanya Ramapantulu Program Program =?? Algorithm + Data Structures Niklaus Wirth Program (Abstraction) of processor/hardware that executes 3-Jul-18 CASS18 - ISA and RISCV 2 Program

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA) Encoding of instructions raises some interesting choices Tradeoffs: performance, compactness, programmability Uniformity. Should different instructions Be the same size

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

10. Assembly Language, Models of Computation

10. Assembly Language, Models of Computation 10. Assembly Language, Models of Computation 6.004x Computation Structures Part 2 Computer Architecture Copyright 2015 MIT EECS 6.004 Computation Structures L10: Assembly Language, Models of Computation,

More information

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

Lecture 3 Machine Language. Instructions: Instruction Execution cycle. Speaking computer before voice recognition interfaces Lecture 3 Machine Language Speaking computer before voice recognition interfaces 1 Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow Very

More information

EC-801 Advanced Computer Architecture

EC-801 Advanced Computer Architecture EC-801 Advanced Computer Architecture Lecture 5 Instruction Set Architecture I Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC University Taxila!1 Instruction Set Architecture

More information

RTN (Register Transfer Notation)

RTN (Register Transfer Notation) RTN (Register Transfer Notation) A formal means of describing machine structure & function. Is at the just right level for machine descriptions. Does not replace hardware description languages. RTN is

More information

What is TOY? An imaginary machine similar to: ! Ancient computers. ! Today's microprocessors.

What is TOY? An imaginary machine similar to: ! Ancient computers. ! Today's microprocessors. 5. The TOY Machine Introduction to Programming in Java: An Interdisciplinary Approach Robert Sedgewick and Kevin Wayne Copyright 3// 5:3 AM! What is TOY? An imaginary machine similar to:! Ancient computers.!

More information

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

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types Instruction Sets Ch 10-11 Characteristics Operands Operations Addressing Instruction Formats Instruction Set Collection of instructions that CPU understands Only interface to CPU from outside CPU executes

More information

Pipelining the Beta. I don t think they mean the fish...

Pipelining the Beta. I don t think they mean the fish... Pipelining the Beta bet ta ('be-t&) n. ny of various species of small, brightly colored, long-finned freshwater fishes of the genus Betta, found in southeast sia. be ta ( b-t&, be-) n. 1. The second letter

More information

Instruction Set Architecture. "Speaking with the computer"

Instruction Set Architecture. Speaking with the computer Instruction Set Architecture "Speaking with the computer" The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture Digital Design

More information

COSC 6385 Computer Architecture. Instruction Set Architectures

COSC 6385 Computer Architecture. Instruction Set Architectures COSC 6385 Computer Architecture Instruction Set Architectures Spring 2012 Instruction Set Architecture (ISA) Definition on Wikipedia: Part of the Computer Architecture related to programming Defines set

More information

6.004 Computation Structures Spring 2009

6.004 Computation Structures Spring 2009 MIT OpenCourseWare http://ocw.mit.edu 6.004 Computation Structures Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. M A S S A C H U S E T T

More information

CMSC Computer Architecture Lecture 2: ISA. Prof. Yanjing Li Department of Computer Science University of Chicago

CMSC Computer Architecture Lecture 2: ISA. Prof. Yanjing Li Department of Computer Science University of Chicago CMSC 22200 Computer Architecture Lecture 2: ISA Prof. Yanjing Li Department of Computer Science University of Chicago Administrative Stuff! Lab1 is out! " Due next Thursday (10/6)! Lab2 " Out next Thursday

More information

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

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions 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,

More information

How Computers Work Problem Set 2

How Computers Work Problem Set 2 Issued: December 7, 2000 How Computers Work Problem Set 2 Problem 1: Warm up Exercises to be done without collaboration. A. Fill in the values of the given control signals for the for the following Beta

More information

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

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1 CSIS1120A 10. Instruction Set & Addressing Mode CSIS1120A 10. Instruction Set & Addressing Mode 1 Elements of a Machine Instruction Operation Code specifies the operation to be performed, e.g. ADD, SUB

More information

I ve been getting this a lot lately So, what are you teaching this term? Computer Organization. Do you mean, like keeping your computer in place?

I ve been getting this a lot lately So, what are you teaching this term? Computer Organization. Do you mean, like keeping your computer in place? I ve been getting this a lot lately So, what are you teaching this term? Computer Organization. Do you mean, like keeping your computer in place? here s the monitor, here goes the CPU, Do you need a class

More information

COS 140: Foundations of Computer Science

COS 140: Foundations of Computer Science COS 140: Foundations of Computer Science CPU Organization and Assembly Language Fall 2018 CPU 3 Components of the CPU..................................................... 4 Registers................................................................

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA)... the attributes of a [computing] system as seen by the programmer, i.e. the conceptual structure and functional behavior, as distinct from the organization of the data

More information

The Stored Program Computer

The Stored Program Computer The Stored Program Computer 1 1945: John von Neumann Wrote a report on the stored program concept, known as the First Draft of a Report on EDVAC also Alan Turing Konrad Zuse Eckert & Mauchly The basic

More information

Understand the factors involved in instruction set

Understand the factors involved in instruction set A Closer Look at Instruction Set Architectures Objectives Understand the factors involved in instruction set architecture design. Look at different instruction formats, operand types, and memory access

More information

Instruction Set Design

Instruction Set Design Instruction Set Design software instruction set hardware CPE442 Lec 3 ISA.1 Instruction Set Architecture Programmer's View ADD SUBTRACT AND OR COMPARE... 01010 01110 10011 10001 11010... CPU Memory I/O

More information

Instruction Set Architectures Part I: From C to MIPS. Readings:

Instruction Set Architectures Part I: From C to MIPS. Readings: Instruction Set Architectures Part I: From C to MIPS Readings: 2.1-2.14 1 Goals for this Class Understand how CPUs run programs How do we express the computation the CPU? How does the CPU execute it? How

More information

Instruction Set Principles and Examples. Appendix B

Instruction Set Principles and Examples. Appendix B Instruction Set Principles and Examples Appendix B Outline What is Instruction Set Architecture? Classifying ISA Elements of ISA Programming Registers Type and Size of Operands Addressing Modes Types of

More information

CSEE 3827: Fundamentals of Computer Systems

CSEE 3827: Fundamentals of Computer Systems CSEE 3827: Fundamentals of Computer Systems Lecture 15 April 1, 2009 martha@cs.columbia.edu and the rest of the semester Source code (e.g., *.java, *.c) (software) Compiler MIPS instruction set architecture

More information

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

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 Lecture 5: Instruction Set Architectures II Announcements Turn in Homework #1 XSPIM tutorials in PAI 5.38 during TA office hours Tue Feb 2: 2-3:30pm Wed Feb 3: 1:30-3pm Thu Feb 4: 3-4:30pm Take QUIZ 2

More information

378: Machine Organization and Assembly Language

378: Machine Organization and Assembly Language 378: Machine Organization and Assembly Language Spring 2010 Luis Ceze Slides adapted from: UIUC, Luis Ceze, Larry Snyder, Hal Perkins 1 What is computer architecture about? Computer architecture is the

More information

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer

1 5. Addressing Modes COMP2611 Fall 2015 Instruction: Language of the Computer 1 5. Addressing Modes MIPS Addressing Modes 2 Addressing takes care of where to find data instruction We have seen, so far three addressing modes of MIPS (to find data): 1. Immediate addressing: provides

More information

CPE 323 MSP430 INSTRUCTION SET ARCHITECTURE (ISA)

CPE 323 MSP430 INSTRUCTION SET ARCHITECTURE (ISA) CPE 323 MSP430 INSTRUCTION SET ARCHITECTURE (ISA) Aleksandar Milenković Email: milenka@uah.edu Web: http://www.ece.uah.edu/~milenka Objective Introduce MSP430 Instruction Set Architecture (Class of ISA,

More information

The MIPS Instruction Set Architecture

The MIPS Instruction Set Architecture The MIPS Set Architecture CPS 14 Lecture 5 Today s Lecture Admin HW #1 is due HW #2 assigned Outline Review A specific ISA, we ll use it throughout semester, very similar to the NiosII ISA (we will use

More information

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Hakim Weatherspoon CS 3410 Computer Science Cornell University Hakim Weatherspoon CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, McKee, and Sirer. Prelim today Starts

More information

CPU Design Tradeoffs. Building the Beta. Performance Measure. The Beta ISA MIPS = C.P.I. Clock Frequency (MHz) PUSHING PERFORMANCE...

CPU Design Tradeoffs. Building the Beta. Performance Measure. The Beta ISA MIPS = C.P.I. Clock Frequency (MHz) PUSHING PERFORMANCE... uilding the eta CPU esign Tradeoffs I wonder where this goes? Maximum Performance: measured by the numbers of instructions executed per second Minimum Cost : measured by the size of the circuit. Lab #5

More information

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

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture Computer Science 324 Computer Architecture Mount Holyoke College Fall 2009 Topic Notes: MIPS Instruction Set Architecture vonneumann Architecture Modern computers use the vonneumann architecture. Idea:

More information

Lecture 04: Machine Instructions

Lecture 04: Machine Instructions CSCI2510 Computer Organization Lecture 04: Machine Instructions Ming-Chang YANG mcyang@cse.cuhk.edu.hk Reading: Chap. 2.3~2.4, 2.10~2.11 Recall: Instructions & Program A computer is governed by instructions.

More information

CPSC 213. Introduction to Computer Systems. Scalars and Arrays. Unit 1b

CPSC 213. Introduction to Computer Systems. Scalars and Arrays. Unit 1b CPSC 213 Introduction to Computer Systems Unit 1b Scalars and Arrays 1 Reading Companion 2.2.3, 2.3, 2.4.1-2.4.3, 2.6 Textbook Array Allocation and Access 1ed: 3.8 2ed: 3.8 2 Design Plan 3 Examine Java

More information

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle

More information

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2)

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2) ELEC 5200-001/6200-001 Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2) Victor P. Nelson, Professor & Asst. Chair Vishwani D. Agrawal, James J. Danaher Professor Department

More information

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor. COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor The Processor - Introduction

More information

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface 5 th Edition The Processor - Introduction

More information

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

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set? COMP 212 Computer Organization & Architecture Quiz COMP 212 Fall 2008 Lecture 7 Fill in your student number only, do NOT write down your name Open book, but NO calculator, NO discussions, Relax and have

More information

Supplement for MIPS (Section 4.14 of the textbook)

Supplement for MIPS (Section 4.14 of the textbook) Supplement for MIPS (Section 44 of the textbook) Section 44 does a good job emphasizing that MARIE is a toy architecture that lacks key feature of real-world computer architectures Most noticable, MARIE

More information

Instructions: Language of the Computer

Instructions: Language of the Computer Instructions: Language of the Computer Tuesday 22 September 15 Many slides adapted from: and Design, Patterson & Hennessy 5th Edition, 2014, MK and from Prof. Mary Jane Irwin, PSU Summary Previous Class

More information

CS 24: INTRODUCTION TO. Spring 2018 Lecture 3 COMPUTING SYSTEMS

CS 24: INTRODUCTION TO. Spring 2018 Lecture 3 COMPUTING SYSTEMS CS 24: INTRODUCTION TO Spring 2018 Lecture 3 COMPUTING SYSTEMS LAST TIME Basic components of processors: Buses, multiplexers, demultiplexers Arithmetic/Logic Unit (ALU) Addressable memory Assembled components

More information

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

Computer Architecture and Organization. Instruction Sets: Addressing Modes and Formats Computer Architecture and Organization Instruction Sets: Addressing Modes and Formats Addressing Modes Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack Immediate Addressing

More information

Computer Organization

Computer Organization Computer Organization (Instruction set Architecture & Assembly Language Programming) KR Chowdhary Professor & Head Email: kr.chowdhary@gmail.com webpage: krchowdhary.com Department of Computer Science

More information

! Ancient computers. ! Today's microprocessors. Memory. ! Stores data and programs. ! 256 "words." (16 bits each) ! Special word for stdin / stdout.

! Ancient computers. ! Today's microprocessors. Memory. ! Stores data and programs. ! 256 words. (16 bits each) ! Special word for stdin / stdout. What is TOY?. The TOY Machine An imaginary machine similar to:! Ancient computers.! Today's microprocessors. Introduction to Computer Science Sedgewick and Wayne Copyright http://www.cs.princeton.edu/introcs

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

RISC, CISC, and ISA Variations

RISC, CISC, and ISA Variations RISC, CISC, and ISA Variations CS 3410 Computer System Organization & Programming These slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. iclicker

More information

CS4617 Computer Architecture

CS4617 Computer Architecture 1/27 CS4617 Computer Architecture Lecture 7: Instruction Set Architectures Dr J Vaughan October 1, 2014 2/27 ISA Classification Stack architecture: operands on top of stack Accumulator architecture: 1

More information

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA CISC 662 Graduate Computer Architecture Lecture 4 - ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

Lecture 4: ISA Tradeoffs (Continued) and Single-Cycle Microarchitectures

Lecture 4: ISA Tradeoffs (Continued) and Single-Cycle Microarchitectures Lecture 4: ISA Tradeoffs (Continued) and Single-Cycle Microarchitectures ISA-level Tradeoffs: Instruction Length Fixed length: Length of all instructions the same + Easier to decode single instruction

More information

Typical Processor Execution Cycle

Typical Processor Execution Cycle Typical Processor Execution Cycle Instruction Fetch Obtain instruction from program storage Instruction Decode Determine required actions and instruction size Operand Fetch Locate and obtain operand data

More information

Instruction Sets: Characteristics and Functions Addressing Modes

Instruction Sets: Characteristics and Functions Addressing Modes Instruction Sets: Characteristics and Functions Addressing Modes Chapters 10 and 11, William Stallings Computer Organization and Architecture 7 th Edition What is an Instruction Set? The complete collection

More information

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures CHAPTER 5 A Closer Look at Instruction Set Architectures 5.1 Introduction 5.2 Instruction Formats 5.2.1 Design Decisions for Instruction Sets 5.2.2 Little versus Big Endian 5.2.3 Internal Storage in the

More information

Real instruction set architectures. Part 2: a representative sample

Real instruction set architectures. Part 2: a representative sample Real instruction set architectures Part 2: a representative sample Some historical architectures VAX: Digital s line of midsize computers, dominant in academia in the 70s and 80s Characteristics: Variable-length

More information

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

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: MIPS Instruction Set Architecture vonneumann Architecture Modern computers use the vonneumann architecture. Idea:

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 2: Hardware/Software Interface Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Basic computer components How does a microprocessor

More information

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization CISC 662 Graduate Computer Architecture Lecture 4 - ISA MIPS ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

CPSC 213. Introduction to Computer Systems. Static Scalars and Arrays. Unit 1b

CPSC 213. Introduction to Computer Systems. Static Scalars and Arrays. Unit 1b CPSC 213 Introduction to Computer Systems Unit 1b Static Scalars and Arrays 1 Reading for Next 3 Lectures Companion 2.4.1-2.4.3 Textbook Array Allocation and Access 3.8 2 The Big Picture Build machine

More information

Topic Notes: MIPS Instruction Set Architecture

Topic Notes: MIPS Instruction Set Architecture Computer Science 220 Assembly Language & Comp. Architecture Siena College Fall 2011 Topic Notes: MIPS Instruction Set Architecture vonneumann Architecture Modern computers use the vonneumann architecture.

More information

CSC 252: Computer Organization Spring 2018: Lecture 11

CSC 252: Computer Organization Spring 2018: Lecture 11 CSC 252: Computer Organization Spring 2018: Lecture 11 Instructor: Yuhao Zhu Department of Computer Science University of Rochester Action Items: Assignment 3 is due March 2, midnight Announcement Programming

More information

Lecture 4: Instruction Set Architecture

Lecture 4: Instruction Set Architecture Lecture 4: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation Reading: Textbook (5 th edition) Appendix A Appendix B (4 th edition)

More information

THE MICROPROCESSOR Von Neumann s Architecture Model

THE MICROPROCESSOR Von Neumann s Architecture Model THE ICROPROCESSOR Von Neumann s Architecture odel Input/Output unit Provides instructions and data emory unit Stores both instructions and data Arithmetic and logic unit Processes everything Control unit

More information

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

Evolution of ISAs. Instruction set architectures have changed over computer generations with changes in the Evolution of ISAs Instruction set architectures have changed over computer generations with changes in the cost of the hardware density of the hardware design philosophy potential performance gains One

More information

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing UNIVERSIDADE TÉCNICA DE LISBOA INSTITUTO SUPERIOR TÉCNICO Departamento de Engenharia Informática for Embedded Computing MEIC-A, MEIC-T, MERC Lecture Slides Version 3.0 - English Lecture 03 Title: Processor

More information

Concepts Introduced in Chapter 3

Concepts Introduced in Chapter 3 Concepts Introduced in Chapter 3 basic instruction set design principles subset of the MIPS assembly language correspondence between high-level language constructs and MIPS assembly code how MIPS assembly

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

Computer Architecture

Computer Architecture Computer Architecture Chapter 2 Instructions: Language of the Computer Fall 2005 Department of Computer Science Kent State University Assembly Language Encodes machine instructions using symbols and numbers

More information

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

Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University. See P&H Appendix , and 2.21 Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See P&H Appendix 2.16 2.18, and 2.21 There is a Lab Section this week, C Lab2 Project1 (PA1) is due next Monday, March

More information

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss Grundlagen Microcontroller Processor Core Günther Gridling Bettina Weiss 1 Processor Core Architecture Instruction Set Lecture Overview 2 Processor Core Architecture Computes things > ALU (Arithmetic Logic

More information

Chapter 3. Z80 Instructions & Assembly Language. Von Neumann Architecture. Memory. instructions. program. data

Chapter 3. Z80 Instructions & Assembly Language. Von Neumann Architecture. Memory. instructions. program. data Von Neumann Architecture The von Neumann architecture is a computer design model that uses a processing unit and a separate storage to hold both instructions and data To run a machine, program and data

More information

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2)

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2) Introduction to the MIPS ISA Overview Remember that the machine only understands very basic instructions (machine instructions) It is the compiler s job to translate your high-level (e.g. C program) into

More information