Review: MIPS Addressing Modes/Instruction Formats
|
|
- Priscilla Jacobs
- 7 years ago
- Views:
Transcription
1 Review: Addressing Modes Addressing mode Example Meaning Register Add R4,R3 R4 R4+R3 Immediate Add R4,#3 R4 R4+3 Displacement Add R4,1(R1) R4 R4+Mem[1+R1] Register indirect Add R4,(R1) R4 R4+Mem[R1] Indexed / Base Add R3,(R1+R2) R3 R3+Mem[R1+R2] Direct or absolute Add R1,(11) R1 R1+Mem[11] indirect Add R1,@(R3) R1 R1+Mem[Mem[R3]] Auto-increment Add R1,(R2)+ R1 R1+Mem[R2]; R2 R2+d Auto-decrement Add R1, (R2) R2 R2 d; R1 R1+Mem[R2] Scaled Add R1,1(R2)[R3] R1 R1+Mem[1+R2+R3*d] ECE 2 L3 InstructionSet4 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Review: MIPS Addressing Modes/Instruction Formats All instructions are -bit wide Register (direct) op rs rt rd register Immediate op rs rt immed Base+index op rs rt immed register + PC-relative op rs rt immed PC + Register Indirect? ECE 2 L3 InstructionSet6 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
2 MIPS: Software conventions for registers R $zero constant R1 $at reserved for assembler R2 $v value registers & R3 $v1 function results R4 $a arguments R5 $a1 R6 $a2 R7 $a3 R8 $t temporary: caller saves (callee can clobber) R15 $t7 R $s callee saves R23 $s7 R24 $t8 temporary (cont d) R25 $t9 R26 $k reserved for OS kernel R27 $k1 R28 $gp pointer to global area R29 $sp Stack pointer R3 $fp Frame pointer R $ra return Address ECE 2 L3 InstructionSet19 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers MIPS data transfer instructions Instruction Comment sw 5($r4), $r3 Store word sh 52($r2), $r3 Store half sb 41($r3), $r2 Store byte lw $r1, 3($r2) Load word lh $r1, 4($r3) Load halfword lhu $r1, 4($r3) Load halfword unsigned lb $r1, 4($r3) Load byte lbu $r1, 4($r3) Load byte unsigned lui $r1, 4 Load Upper Immediate ( bits shifted left by ) LUI $r5 $r5 ECE 2 L3 InstructionSet2 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
3 Loading large numbers Pseudo-instruction li $t, big: load -bit constant lui $t, upper ori $t, $t, lower # $t[:] upper # $t ($t Or [extlower]) Or upper 15 lower $to: upper lower -bit constant ECE 2 L3 InstructionSet21 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Processor Design Basics: Outline Design a processor: step-by-step Requirements of the Instruction Set Components and clocking Assembling an adequate path Controlling the path ECE 2 L3 InstructionSet Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
4 The Big Picture: The Performance Perspective Performance of a machine is determined by: Instruction count Clock cycle time Clock cycles per instruction Processor design (datapath and control) will determine: Clock cycle time CPI Clock cycles per instruction Today: Inst Count Single cycle processor: - Advantage: One clock cycle per instruction - Disadvantage: long cycle time Cycle Time ECE 2 L3 InstructionSet Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers How to Design a Processor: step-by-step 1 Analyze instruction set => datapath requirements the meaning of each instruction is given by the register transfers datapath must include storage element for ISA registers - possibly more datapath must support each register transfer 2 Select set of datapath components and establish clocking methodology 3 Assemble datapath meeting the requirements 4 Analyze implementation of each instruction to determine setting of control points that effects the register transfer 5 Assemble the control logic ECE 2 L3 InstructionSet33 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
5 The MIPS Instruction Formats All MIPS instructions are bits long The three instruction formats: R-type op 6 bits rs 5 bits rt 5 bits rd 5 bits shamt 5 bits funct 6 bits I-type op rs rt immediate 6 bits 5 bits 5 bits bits J-type 26 op target address 6 bits 26 bits The different fields are: op: operation of the instruction rs, rt, rd: the source and destination register specifiers shamt: shift amount funct: selects the variant of the operation in the op field address / immediate: address offset or immediate value target address: target address of the jump instruction ECE 2 L3 InstructionSet34 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Step 1a: The MIPS-light Subset ADD and SUB addu rd, rs, rt subu rd, rs, rt OR Immediate: ori rt, rs, imm LOAD and STORE Word lw rt, rs, imm sw rt, rs, imm BRANCH: beq rs, rt, imm op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits op rs rt immediate 6 bits 5 bits 5 bits bits op rs rt immediate 6 bits 5 bits 5 bits bits op rs rt immediate 6 bits 5 bits 5 bits bits ECE 2 L3 InstructionSet35 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
6 Logical Register Transfers RTL gives the meaning of the instructions All start by fetching the instruction op rs rt rd shamt funct = MEM[ PC ] op rs rt Imm = MEM[ PC ] inst Register Transfers ADDU R[rd] < R[rs] + R[rt]; PC < PC + 4 SUBU R[rd] < R[rs] R[rt]; PC < PC + 4 ORi R[rt] < R[rs] + zero_ext(imm); PC < PC + 4 LOAD R[rt] < MEM[ R[rs] + sign_ext(imm)]; PC < PC + 4 STORE MEM[ R[rs] + sign_ext(imm) ] < R[rt]; PC < PC + 4 BEQ if ( R[rs] == R[rt] ) then PC < PC + sign_ext(imm)] else PC < PC + 4 ECE 2 L3 InstructionSet36 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Step 1: Requirements of the Instruction Set instruction & data Registers ( x ) read RS read RT Write RT or RD PC Extender Add and Sub register or extended immediate Add 4 or extended immediate to PC ECE 2 L3 InstructionSet37 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
7 Step 2: Components of the path Combinational Elements Storage Elements Clocking methodology ECE 2 L3 InstructionSet38 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Combinational Logic Elements (Basic Building Blocks) Adder A B CarryIn Adder Sum Carry MUX Selec t A Y B MUX A B O P Result ECE 2 L3 InstructionSet39 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
8 Storage Element: Register (Basic Building Block) Register Write Enable Similar to the D Flip Flop except In Out - N-bit input and output N N - Write Enable input Write Enable: - negated (): Out will not change - asserted (1): Out will become In ECE 2 L3 InstructionSet4 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Storage Element: Register File Register File consists of registers: Two -bit output buses: and busb One -bit input bus: Register is selected by: RA (number) selects the register to put on (data) RB (number) selects the register to put on busb (data) RW (number) selects the register to be written via (data) when Write Enable is 1 Clock input (CLK) Write Enable RWRARB bit Registers The CLK input is a factor ONLY during write operation During read operation, behaves as a combinational logic block: - RA or RB valid => or busb valid after access time busb ECE 2 L3 InstructionSet41 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
9 Storage Element: Idealized (idealized) One input bus: In One output bus: Out word is selected by: Address selects the word to put on Out Write Enable = 1: address selects the memory word to be written via the In bus Clock input (CLK) Write Enable Address In Out The CLK input is a factor ONLY during write operation During read operation, behaves as a combinational logic block: - Address valid => Out valid after access time ECE 2 L3 InstructionSet42 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Clocking Methodology Setup Hold Don t Care Setup Hold All storage elements are clocked by the same clock edge Cycle Time = CLK-to-Q + Longest Delay Path + Setup + Clock Skew (CLK-to-Q + Shortest Delay Path - Clock Skew) > Hold Time ECE 2 L3 InstructionSet43 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
10 Step 3 Register Transfer Requirements > path Assembly Instruction Fetch Read Operands and Execute Operation ECE 2 L3 InstructionSet44 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers 3a: Overview of the Instruction Fetch Unit The common RTL operations Fetch the Instruction: mem[pc] Update the program counter: - Sequential Code: PC <- PC Branch and Jump: PC <- something else PC Next Address Logic Address Instruction Instruction Word ECE 2 L3 InstructionSet45 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
11 3b: Add & Subtract R[rd] <- R[rs] op R[rt] Example: addu rd, rs, rt Ra, Rb, and Rw come from instruction s rs, rt, and rd fields ctr and RegWr: control logic after decoding the instruction op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits RegWr Rd Rs Rt -bit Registers busb ctr Result ECE 2 L3 InstructionSet46 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Register-Register Timing PC Rs, Rt, Rd, Op, Func ctr RegWr, B Old Value -to-q New Value Old Value Old Value Old Value Old Value Old Value Instruction Access Time New Value Delay through Control Logic New Value New Value Register File Access Time New Value Delay New Value RegWr Rd Rs Rt bit Registers busb ctr Result Register Write Occurs Here ECE 2 L3 InstructionSet47 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
12 3c: Logical Operations with Immediate R[rt] <- R[rs] op ZeroExt[imm] ] bits Rd Rt RegDst Rs RegWr ctr imm -bit Registers 26 op rs rt immediate busb ZeroExt 21 6 bits 5 bits 5 bits rd? bits 15 Src Result 11 immediate bits ECE 2 L3 InstructionSet48 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers 3d: Load Operations R[rt] <- Mem[R[rs] + SignExt[imm]] Example: lw rt, rs, imm op rs rt immediate 6 bits 5 bits 5 bits rd bits Rd Rt RegDst Rs RegWr imm -bit Registers busb Extender Src ctr In MemWr WrEn Adr W_Src ExtOp ECE 2 L3 InstructionSet49 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
13 3e: Store Operations Mem[ R[rs] + SignExt[imm] <- R[rt] ] Example: sw rt, rs, imm op rs rt immediate 6 bits 5 bits 5 bits bits RegDst Rd Rt RegWr 5 5 imm Rs Rt 5 -bit Registers busb Extender ctr In MemWr WrEn Adr W_Src ExtOp Src ECE 2 L3 InstructionSet5 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers 3f: The Branch Instruction op rs rt immediate 6 bits 5 bits 5 bits bits beq rs, rt, imm mem[pc] Fetch the instruction from memory Equal <- R[rs] == R[rt] Calculate the branch condition if (COND eq ) Calculate the next instruction s address - PC <- PC ( SignExt(imm) x 4 ) else - PC <- PC + 4 ECE 2 L3 InstructionSet51 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
14 path for Branch Operations beq rs, rt, imm path generates condition (equal) op rs rt immediate 6 bits 5 bits 5 bits bits Inst Address Cond 4 imm PC Ext npc_sel Adder Adder PC Rs Rt RegWr bit Registers busb Equal? ECE 2 L3 InstructionSet52 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Putting it All Together: A Single Cycle path Inst Adr <:15> <11:15> <:2> <21:25> Rs Rt Rd Imm Instruction<:> imm 4 PC Ext Adder Adder npc_sel PC RegDst Rd Rt Equal 1 RegWr Rs Rt bit Registers busb imm Extender 1 ctr = MemWr WrEn Adr In MemtoReg 1 ExtOp Src ECE 2 L3 InstructionSet53 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
15 An Abstract View of the Critical Path Register file and ideal memory: Next Address The CLK input is a factor ONLY during write operation During read operation, behave as combinational logic: - Address valid => Output valid after access time Ideal Instruction Instruction Address PC Rd 5 Instruction Rs 5 Rt 5 -bit Registers Imm A B Critical Path (Load Operation) = PC s -to-q + Instruction s Access Time + Register File s Access Time + to Perform a -bit Add + Access Time + Setup Time for Register File Write + Clock Skew Address In Ideal ECE 2 L3 InstructionSet54 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Step 4: Given path: RTL -> Control Instruction<:> Inst Adr Op <21:25> <21:25> Fun Rt <:15> <11:15> <:2> Rs Rd Imm Control npc_selregwr RegDst ExtOp Src ctr MemWr MemtoReg Equal DATA PATH ECE 2 L3 InstructionSet55 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
16 Meaning of the Control Signals (see slide 28) Rs, Rt, Rd and Imed hardwired into datapath npc_sel: => PC < PC + 4; 1 => PC < PC SignExt(Im) npc_sel Inst Adr 4 imm PC Ext Adder Adder PC ECE 2 L3 InstructionSet56 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Meaning of the Control Signals (see slide 28) ExtOp: zero, sign src: immed => regb; 1 => ctr: add, sub, or RegDst Rd Rt Equal 1 RegWr Rs Rt bit Registers busb imm Extender MemWr: write memory MemtoReg: 1 => Mem RegDst: => rt ; 1 => rd RegWr: write dest register ctr MemWr MemtoReg 1 = WrEn Adr In 1 ExtOp Src ECE 2 L3 InstructionSet57 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
17 Control Signals inst Register Transfer ADD R[rd] < R[rs] + R[rt]; PC < PC + 4 src = RegB, ctr = add, RegDst = rd, RegWr, npc_sel = +4 SUB R[rd] < R[rs] R[rt]; PC < PC + 4 src =, Extop =, ctr =, RegDst =, RegWr(?), MemtoReg(?), MemWr(?), npc_sel = ORi R[rt] < R[rs] + zero_ext(imm); PC < PC + 4 src =, Extop =, ctr =, RegDst =, RegWr(?), MemtoReg(?), MemWr(?), npc_sel = LOAD R[rt] < MEM[ R[rs] + sign_ext(imm)]; PC < PC + 4 src =, Extop =, ctr =, RegDst =, RegWr(?), MemtoReg(?), MemWr(?), npc_sel = STORE MEM[ R[rs] + sign_ext(imm)] < R[rs]; PC < PC + 4 src =, Extop =, ctr =, RegDst =, RegWr(?), MemtoReg(?), MemWr(?), npc_sel = BEQ if ( R[rs] == R[rt] ) then PC < PC + sign_ext(imm)] else PC < PC + 4 src =, Extop =, ctr =, RegDst =, RegWr(?), MemtoReg(?), MemWr(?), npc_sel = ECE 2 L3 InstructionSet58 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Step 5: Logic for each control signal npc_sel <= if (OP == BEQ) then EQUAL else src <= if (OP == ) then regb else immed ctr <= if (OP == ) then funct elseif (OP == ORi) then OR elseif (OP == BEQ) then sub else add ExtOp <= MemWr <= MemtoReg<= RegWr: <= RegDst: <= ECE 2 L3 InstructionSet6 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
18 Example: Load Instruction Inst Adr <:15> <11:15> <:2> <21:25> Rs Rt Rd Imm Instruction<:> imm 4 PC Ext Adder Adder npc_sel +4 PC RegDst ct MemWr MemtoReg rt Rd Rt Equal radd 1 Rs Rt RegWr = -bit Registers busb WrEn Adr 1 1 In imm sign ext ECE 2 L3 InstructionSet62 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Extender ExtOp Src An Abstract View of the Implementation Next Address Ideal Instruction Instruction Address PC Rd 5 Instruction Rs 5 Rt 5 -bit Registers Logical vs Physical Structure A B Control Control Signals path Conditions Address In Ideal Out ECE 2 L3 InstructionSet63 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
19 A Real MIPS path (CNS T) ECE 2 L3 InstructionSet64 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers Summary 5 steps to design a processor 1 Analyze instruction set => datapath requirements 2 Select set of datapath components & establish clock methodology 3 Assemble datapath meeting the requirements 4 Analyze implementation of each instruction to determine setting of control points that effects the register transfer 5 Assemble the control logic MIPS makes it easier Instructions same size Source registers always in same place Immediates same size, location Operations always on registers/immediates Single cycle datapath => CPI=1, CCT => long Next time: implementing control ECE 2 L3 InstructionSet65 Adapted from Patterson 97 UCB Copyright 1998 Morgan Kaufmann Publishers
Reduced Instruction Set Computer (RISC)
Reduced Instruction Set Computer (RISC) Focuses on reducing the number and complexity of instructions of the ISA. RISC Goals RISC: Simplify ISA Simplify CPU Design Better CPU Performance Motivated by simplifying
More informationInstruction Set Architecture. or How to talk to computers if you aren t in Star Trek
Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture
More informationInstruction Set Architecture
Instruction Set Architecture Consider x := y+z. (x, y, z are memory variables) 1-address instructions 2-address instructions LOAD y (r :=y) ADD y,z (y := y+z) ADD z (r:=r+z) MOVE x,y (x := y) STORE x (x:=r)
More informationComputer organization
Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs
More informationPipeline Hazards. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by Arvind and Krste Asanovic
1 Pipeline Hazards Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by and Krste Asanovic 6.823 L6-2 Technology Assumptions A small amount of very fast memory
More informationComputer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.
Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.tw Review Computers in mid 50 s Hardware was expensive
More informationComputer Organization and Components
Computer Organization and Components IS5, fall 25 Lecture : Pipelined Processors ssociate Professor, KTH Royal Institute of Technology ssistant Research ngineer, University of California, Berkeley Slides
More informationIntroduction to MIPS Assembly Programming
1 / 26 Introduction to MIPS Assembly Programming January 23 25, 2013 2 / 26 Outline Overview of assembly programming MARS tutorial MIPS assembly syntax Role of pseudocode Some simple instructions Integer
More informationTypy danych. Data types: Literals:
Lab 10 MIPS32 Typy danych Data types: Instructions are all 32 bits byte(8 bits), halfword (2 bytes), word (4 bytes) a character requires 1 byte of storage an integer requires 1 word (4 bytes) of storage
More informationInstruction Set Design
Instruction Set Design Instruction Set Architecture: to what purpose? ISA provides the level of abstraction between the software and the hardware One of the most important abstraction in CS It s narrow,
More informationDesign of Pipelined MIPS Processor. Sept. 24 & 26, 1997
Design of Pipelined MIPS Processor Sept. 24 & 26, 1997 Topics Instruction processing Principles of pipelining Inserting pipe registers Data Hazards Control Hazards Exceptions MIPS architecture subset R-type
More informationTranslating C code to MIPS
Translating C code to MIPS why do it C is relatively simple, close to the machine C can act as pseudocode for assembler program gives some insight into what compiler needs to do what's under the hood do
More informationStack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.
Code Generation I Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings: 9.1-9.7 Stack Machines A simple evaluation model No variables
More informationCSE 141 Introduction to Computer Architecture Summer Session I, 2005. Lecture 1 Introduction. Pramod V. Argade June 27, 2005
CSE 141 Introduction to Computer Architecture Summer Session I, 2005 Lecture 1 Introduction Pramod V. Argade June 27, 2005 CSE141: Introduction to Computer Architecture Instructor: Pramod V. Argade (p2argade@cs.ucsd.edu)
More informationSolutions. Solution 4.1. 4.1.1 The values of the signals are as follows:
4 Solutions Solution 4.1 4.1.1 The values of the signals are as follows: RegWrite MemRead ALUMux MemWrite ALUOp RegMux Branch a. 1 0 0 (Reg) 0 Add 1 (ALU) 0 b. 1 1 1 (Imm) 0 Add 1 (Mem) 0 ALUMux is the
More informationAssembly Language Programming
Assembly Language Programming Assemblers were the first programs to assist in programming. The idea of the assembler is simple: represent each computer instruction with an acronym (group of letters). Eg:
More informationPipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1
Pipeline Hazards Structure hazard Data hazard Pipeline hazard: the major hurdle A hazard is a condition that prevents an instruction in the pipe from executing its next scheduled pipe stage Taxonomy of
More informationIntroducción. Diseño de sistemas digitales.1
Introducción Adapted from: Mary Jane Irwin ( www.cse.psu.edu/~mji ) www.cse.psu.edu/~cg431 [Original from Computer Organization and Design, Patterson & Hennessy, 2005, UCB] Diseño de sistemas digitales.1
More informationInstruction Set Architecture (ISA) Design. Classification Categories
Instruction Set Architecture (ISA) Design Overview» Classify Instruction set architectures» Look at how applications use ISAs» Examine a modern RISC ISA (DLX)» Measurement of ISA usage in real computers
More informationMore MIPS: Recursion. Computer Science 104 Lecture 9
More MIPS: Recursion Computer Science 104 Lecture 9 Admin Homework Homework 1: graded. 50% As, 27% Bs Homework 2: Due Wed Midterm 1 This Wed 1 page of notes 2 Last time What did we do last time? 3 Last
More informationMIPS Assembly Code Layout
Learning MIPS & SPIM MIPS assembly is a low-level programming language The best way to learn any programming language is to write code We will get you started by going through a few example programs and
More informationLecture Outline. Stack machines The MIPS assembly language. Code Generation (I)
Lecture Outline Code Generation (I) Stack machines The MIPS assembl language Adapted from Lectures b Profs. Ale Aiken and George Necula (UCB) A simple source language Stack- machine implementation of the
More informationChapter 9 Computer Design Basics!
Logic and Computer Design Fundamentals Chapter 9 Computer Design Basics! Part 2 A Simple Computer! Charles Kime & Thomas Kaminski 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode)
More informationChapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC
Chapter 2 Topics 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC See Appendix C for Assembly language information. 2.4
More informationComputer Organization and Architecture
Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats Instruction Set Design One goal of instruction set design is to minimize instruction length Another goal
More informationInstruction Set Architecture (ISA)
Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine
More informationInstruction Set Architecture
Instruction Set Architecture Arquitectura de Computadoras Arturo Díaz D PérezP Centro de Investigación n y de Estudios Avanzados del IPN adiaz@cinvestav.mx Arquitectura de Computadoras ISA- 1 Instruction
More informationAdvanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2
Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of
More informationWinter 2002 MID-SESSION TEST Friday, March 1 6:30 to 8:00pm
University of Calgary Department of Electrical and Computer Engineering ENCM 369: Computer Organization Instructors: Dr. S. A. Norman (L01) and Dr. S. Yanushkevich (L02) Winter 2002 MID-SESSION TEST Friday,
More informationIntel 8086 architecture
Intel 8086 architecture Today we ll take a look at Intel s 8086, which is one of the oldest and yet most prevalent processor architectures around. We ll make many comparisons between the MIPS and 8086
More informationA SystemC Transaction Level Model for the MIPS R3000 Processor
SETIT 2007 4 th International Conference: Sciences of Electronic, Technologies of Information and Telecommunications March 25-29, 2007 TUNISIA A SystemC Transaction Level Model for the MIPS R3000 Processor
More informationDesign of Digital Circuits (SS16)
Design of Digital Circuits (SS16) 252-0014-00L (6 ECTS), BSc in CS, ETH Zurich Lecturers: Srdjan Capkun, D-INFK, ETH Zurich Frank K. Gürkaynak, D-ITET, ETH Zurich Labs: Der-Yeuan Yu dyu@inf.ethz.ch Website:
More informationInstruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010
Instruction Set Architecture Micro-architecture Datapath & Control CIT 595 Spring 2010 ISA =Programmer-visible components & operations Memory organization Address space -- how may locations can be addressed?
More informationA single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc
Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc
More informationl C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language
198:211 Computer Architecture Topics: Processor Design Where are we now? C-Programming A real computer language Data Representation Everything goes down to bits and bytes Machine representation Language
More informationGenerating MIF files
Generating MIF files Introduction In order to load our handwritten (or compiler generated) MIPS assembly problems into our instruction ROM, we need a way to assemble them into machine language and then
More informationMIPS Assembler and Simulator
MIPS Assembler and Simulator Reference Manual Last Updated, December 1, 2005 Xavier Perséguers (ing. info. dipl. EPF) Swiss Federal Institude of Technology xavier.perseguers@a3.epfl.ch Preface MIPS Assembler
More informationEECS 427 RISC PROCESSOR
RISC PROCESSOR ISA FOR EECS 427 PROCESSOR ImmHi/ ImmLo/ OP Code Rdest OP Code Ext Rsrc Mnemonic Operands 15-12 11-8 7-4 3-0 Notes (* is Baseline) ADD Rsrc, Rdest 0000 Rdest 0101 Rsrc * ADDI Imm, Rdest
More informationCPU Organization and Assembly Language
COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:
More informationComputer Systems Architecture
Computer Systems Architecture http://cs.nott.ac.uk/ txa/g51csa/ Thorsten Altenkirch and Liyang Hu School of Computer Science University of Nottingham Lecture 10: MIPS Procedure Calling Convention and Recursion
More informationEE282 Computer Architecture and Organization Midterm Exam February 13, 2001. (Total Time = 120 minutes, Total Points = 100)
EE282 Computer Architecture and Organization Midterm Exam February 13, 2001 (Total Time = 120 minutes, Total Points = 100) Name: (please print) Wolfe - Solution In recognition of and in the spirit of the
More informationCOMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59
COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59 Overview: In the first projects for COMP 303, you will design and implement a subset of the MIPS32 architecture
More informationSMIPS Processor Specification
SMIPS Processor Specification 6.884 Spring 25 - Version: 25215 1 Introduction SMIPS is the version of the MIPS instruction set architecture (ISA) we ll be using for the processors we implement in 6.884.
More information612 CHAPTER 11 PROCESSOR FAMILIES (Corrisponde al cap. 12 - Famiglie di processori) PROBLEMS
612 CHAPTER 11 PROCESSOR FAMILIES (Corrisponde al cap. 12 - Famiglie di processori) PROBLEMS 11.1 How is conditional execution of ARM instructions (see Part I of Chapter 3) related to predicated execution
More information150127-Microprocessor & Assembly Language
Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an
More informationMICROPROCESSOR AND MICROCOMPUTER BASICS
Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit
More informationCS352H: Computer Systems Architecture
CS352H: Computer Systems Architecture Topic 9: MIPS Pipeline - Hazards October 1, 2009 University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell Data Hazards in ALU Instructions
More informationIn the Beginning... 1964 -- The first ISA appears on the IBM System 360 In the good old days
RISC vs CISC 66 In the Beginning... 1964 -- The first ISA appears on the IBM System 360 In the good old days Initially, the focus was on usability by humans. Lots of user-friendly instructions (remember
More informationOverview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX
Overview CISC Developments Over Twenty Years Classic CISC design: Digital VAX VAXÕs RISC successor: PRISM/Alpha IntelÕs ubiquitous 80x86 architecture Ð 8086 through the Pentium Pro (P6) RJS 2/3/97 Philosophy
More informationLecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com
CSCI-UA.0201-003 Computer Systems Organization Lecture 7: Machine-Level Programming I: Basics Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified)
More informationExecution Cycle. Pipelining. IF and ID Stages. Simple MIPS Instruction Formats
Execution Cycle Pipelining CSE 410, Spring 2005 Computer Systems http://www.cs.washington.edu/410 1. Instruction Fetch 2. Instruction Decode 3. Execute 4. Memory 5. Write Back IF and ID Stages 1. Instruction
More informationAddressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)
Addressing The problem Objectives:- When & Where do we encounter Data? The concept of addressing data' in computations The implications for our machine design(s) Introducing the stack-machine concept Slide
More informationSystems I: Computer Organization and Architecture
Systems I: Computer Organization and Architecture Lecture : Microprogrammed Control Microprogramming The control unit is responsible for initiating the sequence of microoperations that comprise instructions.
More informationEE361: Digital Computer Organization Course Syllabus
EE361: Digital Computer Organization Course Syllabus Dr. Mohammad H. Awedh Spring 2014 Course Objectives Simply, a computer is a set of components (Processor, Memory and Storage, Input/Output Devices)
More informationTHUMB Instruction Set
5 THUMB Instruction Set This chapter describes the THUMB instruction set. Format Summary 5-2 Opcode Summary 5-3 5. Format : move shifted register 5-5 5.2 Format 2: add/subtract 5-7 5.3 Format 3: move/compare/add/subtract
More informationCS:APP Chapter 4 Computer Architecture. Wrap-Up. William J. Taffe Plymouth State University. using the slides of
CS:APP Chapter 4 Computer Architecture Wrap-Up William J. Taffe Plymouth State University using the slides of Randal E. Bryant Carnegie Mellon University Overview Wrap-Up of PIPE Design Performance analysis
More informationCentral Processing Unit (CPU)
Central Processing Unit (CPU) CPU is the heart and brain It interprets and executes machine level instructions Controls data transfer from/to Main Memory (MM) and CPU Detects any errors In the following
More informationQ. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:
Pipelining HW Q. Can a MIPS SW instruction executing in a simple 5-stage pipelined implementation have a data dependency hazard of any type resulting in a nop bubble? If so, show an example; if not, prove
More informationEC 362 Problem Set #2
EC 362 Problem Set #2 1) Using Single Precision IEEE 754, what is FF28 0000? 2) Suppose the fraction enhanced of a processor is 40% and the speedup of the enhancement was tenfold. What is the overall speedup?
More informationA s we saw in Chapter 4, a CPU contains three main sections: the register section,
6 CPU Design A s we saw in Chapter 4, a CPU contains three main sections: the register section, the arithmetic/logic unit (ALU), and the control unit. These sections work together to perform the sequences
More informationWAR: Write After Read
WAR: Write After Read write-after-read (WAR) = artificial (name) dependence add R1, R2, R3 sub R2, R4, R1 or R1, R6, R3 problem: add could use wrong value for R2 can t happen in vanilla pipeline (reads
More informationUNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995
UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering EEC180B Lab 7: MISP Processor Design Spring 1995 Objective: In this lab, you will complete the design of the MISP processor,
More informationHow It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals
CPU Architectures Motorola 68000 Several CPU architectures exist currently: Motorola Intel AMD (Advanced Micro Devices) PowerPC Pick one to study; others will be variations on this. Arbitrary pick: Motorola
More informationMICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1
MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable
More informationThe 104 Duke_ACC Machine
The 104 Duke_ACC Machine The goal of the next two lessons is to design and simulate a simple accumulator-based processor. The specifications for this processor and some of the QuartusII design components
More information5 MIPS Assembly Language
103 5 MIPS Assembly Language Today, digital computers are almost exclusively programmed using high-level programming languages (PLs), eg, C, C++, Java The CPU fetch execute cycle, however, is not prepared
More informationSequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )
Sequential Logic (Materials taken from: Principles of Computer Hardware by Alan Clements ) Sequential vs. Combinational Circuits Combinatorial circuits: their outputs are computed entirely from their present
More informationSyscall 5. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas
Syscall 5 System call 5 allows input of numerical data from the keyboard while a program is running. Syscall 5 is a bit unusual, in that it requires the use of register $v0 twice. In syscall 5 (as for
More informationProperty of ISA vs. Uarch?
More ISA Property of ISA vs. Uarch? ADD instruction s opcode Number of general purpose registers Number of cycles to execute the MUL instruction Whether or not the machine employs pipelined instruction
More information(Refer Slide Time: 00:01:16 min)
Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control
More information18-447 Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013
18-447 Computer Architecture Lecture 3: ISA Tradeoffs Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013 Reminder: Homeworks for Next Two Weeks Homework 0 Due next Wednesday (Jan 23), right
More informationPreface. Any questions from last time? A bit more motivation, information about me. A bit more about this class. Later: Will review 1st 22 slides
Preface Any questions from last time? Will review 1st 22 slides A bit more motivation, information about me Research ND A bit more about this class Microsoft Later: HW 1 Review session MD McNally about
More informationMemory Elements. Combinational logic cannot remember
Memory Elements Combinational logic cannot remember Output logic values are function of inputs only Feedback is needed to be able to remember a logic value Memory elements are needed in most digital logic
More informationPART B QUESTIONS AND ANSWERS UNIT I
PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional
More informationPROBLEMS (Cap. 4 - Istruzioni macchina)
98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary
More informationThe Operating System and the Kernel
The Kernel and System Calls 1 The Operating System and the Kernel We will use the following terminology: kernel: The operating system kernel is the part of the operating system that responds to system
More informationChapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine
Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine This is a limited version of a hardware implementation to execute the JAVA programming language. 1 of 23 Structured Computer
More informationLecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle
Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle Contents 3.1. Register Transfer Notation... 2 3.2. HCS12 Addressing Modes... 2 1. Inherent Mode (INH)... 2 2.
More informationA FPGA Implementation of a MIPS RISC Processor for Computer Architecture Education
A FPGA Implementation of a MIPS RISC Processor for Computer Architecture Education By: Victor P. Rubio, B.S. vrubio@gauss.nmsu.edu Advisor: Dr. Jeanine Cook jecook@gauss.nmsu.edu New Mexico State University
More informationMACHINE ARCHITECTURE & LANGUAGE
in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based
More informationCS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions
CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How
More informationSolution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches:
Multiple-Issue Processors Pipelining can achieve CPI close to 1 Mechanisms for handling hazards Static or dynamic scheduling Static or dynamic branch handling Increase in transistor counts (Moore s Law):
More informationInstruction Set Reference
2015.04.02 Set Reference NII51017 Subscribe This section introduces the Nios II instruction word format and provides a detailed reference of the Nios II instruction set. Word Formats There are three types
More informationGiving credit where credit is due
CSCE 230J Computer Organization Processor Architecture VI: Wrap-Up Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due ost of slides for
More informationAn Introduction to Assembly Programming with the ARM 32-bit Processor Family
An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2
More informationCHAPTER 7: The CPU and Memory
CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides
More informationAn Introduction to the ARM 7 Architecture
An Introduction to the ARM 7 Architecture Trevor Martin CEng, MIEE Technical Director This article gives an overview of the ARM 7 architecture and a description of its major features for a developer new
More informationCHAPTER 4 MARIE: An Introduction to a Simple Computer
CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 195 4.2 CPU Basics and Organization 195 4.2.1 The Registers 196 4.2.2 The ALU 197 4.2.3 The Control Unit 197 4.3 The Bus 197 4.4 Clocks
More informationCS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on
CS 61C: Great Ideas in Computer Architecture Finite State Machines Instructors: Krste Asanovic & Vladimir Stojanovic hbp://inst.eecs.berkeley.edu/~cs61c/sp15 1 Levels of RepresentaKon/ InterpretaKon High
More informationDigital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng
Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals of Computer Organization and Design. Introduction
More informationİSTANBUL AYDIN UNIVERSITY
İSTANBUL AYDIN UNIVERSITY FACULTY OF ENGİNEERİNG SOFTWARE ENGINEERING THE PROJECT OF THE INSTRUCTION SET COMPUTER ORGANIZATION GÖZDE ARAS B1205.090015 Instructor: Prof. Dr. HASAN HÜSEYİN BALIK DECEMBER
More informationProcessor Architectures
ECPE 170 Jeff Shafer University of the Pacific Processor Architectures 2 Schedule Exam 3 Tuesday, December 6 th Caches Virtual Memory Input / Output OperaKng Systems Compilers & Assemblers Processor Architecture
More informationChapter 7D The Java Virtual Machine
This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly
More informationChapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language
Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,
More information16-bit ALU, Register File and Memory Write Interface
CS M152B Fall 2002 Project 2 16-bit ALU, Register File and Memory Write Interface Suggested Due Date: Monday, October 21, 2002 Actual Due Date determined by your Lab TA This project will take much longer
More informationTIMING DIAGRAM O 8085
5 TIMING DIAGRAM O 8085 5.1 INTRODUCTION Timing diagram is the display of initiation of read/write and transfer of data operations under the control of 3-status signals IO / M, S 1, and S 0. As the heartbeat
More informationChapter 2 Logic Gates and Introduction to Computer Architecture
Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are
More informationM A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE
M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 1. Introduction 6.004 Computation Structures β Documentation This handout is
More informationSIM-PL: Software for teaching computer hardware at secondary schools in the Netherlands
SIM-PL: Software for teaching computer hardware at secondary schools in the Netherlands Ben Bruidegom, benb@science.uva.nl AMSTEL Instituut Universiteit van Amsterdam Kruislaan 404 NL-1098 SM Amsterdam
More informationMore on Pipelining and Pipelines in Real Machines CS 333 Fall 2006 Main Ideas Data Hazards RAW WAR WAW More pipeline stall reduction techniques Branch prediction» static» dynamic bimodal branch prediction
More information