上海交通大学:《计算机组成原理 Computer Organization》课程教学资源(PPT课件讲稿)Chapter 4A The Processor, Part A

Computer Organization Fa12017 Chapter 4A: The Processor, Part A [Adapted from Computer Organization and Design, 4th Edition, Patterson Hennessy, C 2012, MKI 日209 Chapter4A.1 CSE SJTU, 2017
EI209 Chapter 4A.1 CSE, SJTU, 2017 Computer Organization Fall 2017 Chapter 4A: The Processor, Part A [Adapted from Computer Organization and Design, 4th Edition, Patterson & Hennessy, © 2012, MK]

Review: MIPS(RISC)Design Principles a Simplicity favors regularity fixed size instructions small number of instruction formats opcode always the first 6 bits 口 Smaller is faster limited instruction set limited number of registers in register file limited number of addressing modes o Make the common case fast arithmetic operands from the register file(load-store machine allow instructions to contain immediate operands a Good design demands good compromises three instruction formats 日209 Chapter4A2 CSE SJTU, 2017
EI209 Chapter 4A.2 CSE, SJTU, 2017 Review: MIPS (RISC) Design Principles ❑ Simplicity favors regularity fixed size instructions small number of instruction formats opcode always the first 6 bits ❑ Smaller is faster limited instruction set limited number of registers in register file limited number of addressing modes ❑ Make the common case fast arithmetic operands from the register file (load-store machine) allow instructions to contain immediate operands ❑ Good design demands good compromises three instruction formats

The Processor: Datapath Control a Our implementation of the miPs is simplified memory-reference instructions: lw, sw arithmetic-logical instructions: add, sub, and, or, slt control flow instructions: beg, j a generic implementation use the program counter(PC)to supply Fetch the instruction address and fetch the =PC+4 instruction from memory(and update the PC) Exec Decode decode the instruction (and read registers) execute the instruction a All instructions(except j)use the ALU after reading the registers How? memory-reference? arithmetic? control flow? 日209 Chapter4A.3 CSE SJTU, 2017
EI209 Chapter 4A.3 CSE, SJTU, 2017 ❑ Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions: add, sub, and, or, slt control flow instructions: beq, j ❑ Generic implementation use the program counter (PC) to supply the instruction address and fetch the instruction from memory (and update the PC) decode the instruction (and read registers) execute the instruction ❑ All instructions (except j) use the ALU after reading the registers How? memory-reference? arithmetic? control flow? The Processor: Datapath & Control Fetch PC = PC+4 Exec Decode

Aside: Clocking Methodologies a The clocking methodology defines when data in a state element is valid and stable relative to the clock State elements-a memory element such as a register Edge-triggered-all state changes occur on a clock edge a Typical execution read contents of state elements - send values through combinational logic -> write results to one or more state elements State Combinational State element logic element 2 clock one clock cycle O Assumes state elements are written on every clock cycle; if not, need explicit write control signal write occurs only when both the write control is asserted and the clock edge occurs 日209 Chapter4A.4 CSE SJTU, 2017
EI209 Chapter 4A.4 CSE, SJTU, 2017 Aside: Clocking Methodologies ❑ The clocking methodology defines when data in a state element is valid and stable relative to the clock State elements - a memory element such as a register Edge-triggered – all state changes occur on a clock edge ❑ Typical execution read contents of state elements -> send values through combinational logic -> write results to one or more state elements State element 1 State element 2 Combinational logic clock one clock cycle ❑ Assumes state elements are written on every clock cycle; if not, need explicit write control signal write occurs only when both the write control is asserted and the clock edge occurs

How to Design a Processor: step-by-step o 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 a 2. Select set of datapath components and establish clocking methodology a 3. Assemble datapath meeting the requirements a 4. Analyze implementation of each instruction to determine setting of control points that effects the register transfer 0 5 Assemble the control logic 日209 Chapter4A.5 CSE SJTU, 2017
EI209 Chapter 4A.5 CSE, SJTU, 2017 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

The MiPs Instruction Formats o Al MIPS instructions are 32 bits long the three instruction formats 21 16 R-type rs shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits 26 21 16 I-type rs immediate 6 bits 5 bits 5 bits 16 bits J-type 31 26 target address 6 bits 26 bits o 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 日209 Chapter4A.6 CSE SJTU, 2017
EI209 Chapter 4A.6 CSE, SJTU, 2017 The MIPS Instruction Formats ❑ All MIPS instructions are 32 bits long. The three instruction formats: R-type I-type J-type ❑ 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 op target address 31 26 0 6 bits 26 bits op rs rt rd shamt funct 31 26 21 16 11 6 0 6 bits 5 bits 5 bits 5 bits 5 bits 6 bits op rs rt immediate 31 26 21 16 0 6 bits 5 bits 5 bits 16 bits

Logical Register Transfers a rtl gives the meaning of the instructions a All start by fetching the instruction op rs rt rd shamt funct= MEM[ PC] op rs rt Imm16 MEM PC inst Register Transfers ADDU Rrd] <-R[rs]+ rrt PC <-PC +4 SUBU R[rd]<-R[rs-R[rt PC <-PC +4 ORi R[rt]<-R[rs] zero_ext(Imm16 PC <-PC +4 LOAD R[rt]<-MEMI R[rs]+ sign ext(Imm16)]: PC <-PC+4 STORE MEM[ R[s]+ sign ext(mm16)]<-Rrt]; PC <-PC+ 4 BEQ if( r[rs]== Rirt] then PC <-PC 4 +sign ext(Imm16)100 else pc <-PC +4 日209 Chapter4A7 CSE SJTU, 2017
EI209 Chapter 4A.7 CSE, SJTU, 2017 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 | Imm16 = 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(Imm16); PC <– PC + 4 LOAD R[rt] <– MEM[ R[rs] + sign_ext(Imm16)]; PC <– PC + 4 STORE MEM[ R[rs] + sign_ext(Imm16) ] <– R[rt]; PC <– PC + 4 BEQ if ( R[rs] == R[rt] ) then PC <– PC + 4 +sign_ext(Imm16)] || 00 else PC <– PC + 4

Step 1: Requirements of the Instruction Set 口 Memory instruction data a Registers(32×32) read Rs read rt Write rt or rd 口PC 口 Extender a Add and Sub register or extended immediate D Add 4 or extended immediate to pc 日209 Chapter4A.8 CSE SJTU, 2017
EI209 Chapter 4A.8 CSE, SJTU, 2017 Step 1: Requirements of the Instruction Set ❑ Memory instruction & data ❑ Registers (32 x 32) read RS read RT Write RT or RD ❑ PC ❑ Extender ❑ Add and Sub register or extended immediate ❑ Add 4 or extended immediate to PC

Step 1: Requirements of the Instruction Set 口 Memory(MEM) Instructions data (will use one for each: really caches) 口 Registers(R:32X32) Read rs Read rt Write rt orr 口PC a Extender (sign/zero extend) a Add/Sub/ORunit for operation on register(s)or extended immediate a Add 4(+ maybe extended immediate)to PC a Compare if registers equal? 日209 Chapter4A.9 CSE SJTU, 2017
EI209 Chapter 4A.9 CSE, SJTU, 2017 Step 1: Requirements of the Instruction Set ❑ Memory (MEM) Instructions & data (will use one for each: really caches) ❑ Registers (R: 32 x 32) Read rs Read rt Write rt or rd ❑ PC ❑ Extender (sign/zero extend) ❑ Add/Sub/OR unit for operation on register(s) or extended immediate ❑ Add 4 (+ maybe extended immediate) to PC ❑ Compare if registers equal?

Generic Steps of Datapath rd Loc①E rs ALU 0点 Imm 1. Instruction 2. Decode/ 3. EXecute 4. Memory 5. Register Fetch Register Write Read 日209 Chapter4A.10 CSE SJTU, 2017
EI209 Chapter 4A.10 CSE, SJTU, 2017 Generic Steps of Datapath instruction memory +4 rt rs rd registers ALU Data memory imm 1. Instruction Fetch 2. Decode/ Register Read 3. Execute 4. Memory5. Register Write PC mux
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 香港城市大学:PERFORMANCE ANALYSIS OF CIRCUIT SWITCHED NETWORKS(PPT讲稿).pptx
- 《结构化程序设计》课程教学资源(PPT课件讲稿)第4章 VB控制结构.ppt
- 安徽理工大学:《算法设计与分析 Algorithm Design and Analysis》课程教学资源(PPT课件讲稿)第一章 导引与基本数据结构.ppt
- 四川大学:《操作系统 Operating System》课程教学资源(PPT课件讲稿)Chapter 1 Computer System Overview.ppt
- 南京大学:《面向对象技术 OOT》课程教学资源(PPT课件讲稿)分布对象 Distributed Objects(1).ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第10章 指针.ppt
- 北京大学:《高级软件工程》课程教学资源(PPT课件讲稿)第九讲 静态代码的可信性分析概述.ppt
- 澳门大学:统计机器翻译领域适应性研究 Domain Adaptation for Statistical Machine Translation Master Defense.pptx
- 山东大学:《数据结构》课程教学资源(PPT课件讲稿)第5章 堆栈(STACKS)Restricted version of a linear list.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第2章 数据类型与常用库函数.ppt
- 南京大学:《面向对象技术 OOT》课程教学资源(PPT课件讲稿)设计模式 Design Pattern(3).ppt
- 安徽理工大学:《汇编语言》课程教学资源(PPT课件讲稿)第二章 80x86计算机组织.ppt
- SVM原理与应用(PPT讲稿).pptx
- MSC Software Corporation:Dynamic System Modeling, Simulation, and Analysis Using MSC.EASY5(Advanced Class).ppt
- 《程序设计语言原理》课程教学资源(PPT课件讲稿)形式语义学 Formal Semantics.ppt
- 中国科学技术大学:《算法设计与分析》课程教学资源(PPT课件讲稿)第一部分 概率算法(黄刘生).ppt
- 《计算机组成原理》课程教学资源(PPT课件讲稿)第二章 电子计算机中信息的表示及其运算.ppt
- 虚拟存储(PPT课件讲稿)Virtual Memory.ppt
- Network Alignment(PPT讲稿)Treating Networks as Wireless Interference Channel.pptx
- 中国科学技术大学:《高级操作系统 Advanced Operating System》课程教学资源(PPT课件讲稿)第四章 分布式进程和处理机管理.ppt
- 清华大学出版社:《计算机网络安全与应用技术》课程教学资源(PPT课件讲稿)第5章 Windows NT/2000的安全与保护措施.ppt
- 《人工智能》课程教学资源(PPT课件讲稿)第13章 智能优化计算简介.ppt
- 《计算机网络技术及应用》课程教学资源(PPT课件讲稿)第十一章 网络安全.ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第八章 形态学处理.ppt
- 北京师范大学现代远程教育:《计算机应用基础》课程教学资源(PPT课件讲稿)第四篇 数据处理与数据分析.ppsx
- 《ARM Cortex-M3权威指南》课程教学资源(PPT课件讲稿)Cortex M3 存储系统访问.pptx
- 《人工智能》课程教学资源(PPT课件讲稿)Ch10 Auto-encoders(Auto and variational encoders v.9r6).pptx
- 西安电子科技大学:《操作系统 Operating Systems》课程教学资源(PPT课件讲稿)Chapter 05 输入输出 Input/Output.ppt
- 《计算机应用基础》课程教学资源(PPT课件讲稿)第5章 文件文档工具.ppt
- 南京大学:《面向对象技术 OOT》课程教学资源(PPT课件讲稿)敏捷软件开发 Agile Software Development.ppt
- 《信息安全工程》课程教学资源(PPT课件讲稿)第3章 密码学基础.ppt
- 中国科学技术大学:《计算机体系结构》课程教学资源(PPT课件讲稿)RISC-V指令集及简单实现.pptx
- 电子科技大学:《计算机操作系统》课程教学资源(PPT课件讲稿)第三章 存储管理 Memory Management.ppt
- 《C语言教程》课程教学资源(PPT课件讲稿)第三章 C语言程序设计初步.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第十章 内部排序.ppt
- 清华大学:A Pivotal Prefix Based Filtering Algorithm for String Similarity Search(PPT讲稿).pptx
- 河南中医药大学(河南中医学院):《计算机文化》课程教学资源(PPT课件讲稿)第四章 计算机软件系统(主讲:许成刚、阮晓龙).ppt
- 《人工智能技术导论》课程教学资源(PPT课件讲稿)第1章 人工智能概述.ppt
- 山东大学:《微机原理及单片机接口技术》课程教学资源(PPT课件讲稿)第八章 数据通信.ppt
- 信息和通信技术ICT(PPT讲稿)浅谈信息技术和低碳经济(中国科学技术大学:王煦法).ppt