计算机组织与结构:版8-16_Control Unit_第1页
计算机组织与结构:版8-16_Control Unit_第2页
计算机组织与结构:版8-16_Control Unit_第3页
计算机组织与结构:版8-16_Control Unit_第4页
计算机组织与结构:版8-16_Control Unit_第5页
已阅读5页,还剩47页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1/45,William Stallings Computer Organization and Architecture8th Edition,Chapter 16 Control Unit Operation,2/49,Key Terms,Control bus Control path Control signal Control unit Hardwired implementation Microoperations Control unit operation,3/49,Micro-Operations,A computer executes a program Fetch/exe

2、cute cycle Each cycle has a number of steps see pipelining Called micro-operations Each step does very little Atomic operation of CPU,4/49,Constituent Elements of Program Execution,5/49,Instruction Cycle with Indirect,6/49,Fetch - 4 Registers,Memory Address Register (MAR) Connected to address bus Sp

3、ecifies address for read or write op Memory Buffer Register (MBR) Connected to data bus Holds data to write or last data read Program Counter (PC) Holds address of next instruction to be fetched Instruction Register (IR) Holds last instruction fetched,7/49,Fetch Sequence,Address of next instruction

4、is in PC Address (MAR) is placed on address bus Control unit issues READ command Result (data from memory) appears on data bus Data from data bus copied into MBR PC incremented by 1 (in parallel with data fetch from memory) Data (instruction) moved from MBR to IR MBR is now free for further data fet

5、ches,8/49,Data Flow (Fetch Diagram),9/49,Fetch Sequence (symbolic),t1:MAR - (PC) t2:MBR - (memory) PC - (PC) +1 t3:IR - (MBR) (tx = time unit/clock cycle) or t1:MAR - (PC) t2:MBR - (memory) t3:PC - (PC) +1 IR - (MBR),10/49,Rules for Clock Cycle Grouping,Proper sequence must be followed MAR - (PC) mu

6、st precede MBR - (memory) Conflicts must be avoided Must not read & write same register at same time MBR - (memory) & IR - (MBR) must not be in same cycle Also: PC - (PC) +1 involves addition Use ALU May need additional micro-operations,11/49,Data Flow (Indirect Diagram),12/49,Indirect Cycle,MAR - (

7、IRaddress) - address field of IR MBR - (memory) IRaddress - (MBRaddress) MBR contains an address IR is now in same state as if direct addressing had been used (What does this say about IR size?),13/49,Data Flow (Indirect Diagram),t1:MAR - (PC) t2:MBR - (memory) PC - (PC) +1 t3:IR - (MBR) MAR - (IRad

8、dress) - address field of IR MBR - (memory) IRaddress - (MBRaddress),14/49,Data Flow (Interrupt Diagram),(2),(3),(1),(4),(5),t1:MBR -(PC) t2:MAR - save-address PC - routine-address t3:memory - (MBR),15/49,Interrupt Cycle,t1:MBR -(PC) t2:MAR - save-address PC - routine-address t3:memory - (MBR) This

9、is a minimum May be additional micro-ops to get addresses N.B. saving context is done by interrupt handler routine, not micro-ops,16/49,Data Flow (Execute),May take many forms Depends on instruction being executed May include Memory read/write Input/Output Register transfers ALU operations,17/49,Exe

10、cute Cycle (ADD),Different for each instruction e.g. ADD R1,X - add the contents of location X to Register 1 , result in R1 t1:MAR - (IRaddress) t2:MBR - (memory) t3:R1 - R1 + (MBR) Note no overlap of micro-operations,18/49,Execute Cycle (ISZ),ISZ X - increment and skip if zero t1:MAR - (IRaddress)

11、t2:MBR - (memory) t3:MBR - (MBR) + 1 t4:memory - (MBR) if (MBR) = 0 then PC - (PC) + 1 Notes: if is a single micro-operation Micro-operations done during t4,19/49,Execute Cycle (BSA),BSA X - Branch and save address Address of instruction following BSA is saved in X Execution continues from X+1 t1:MA

12、R - (IRaddress) MBR - (PC) t2:PC - (IRaddress) memory - (MBR) t3:PC - (PC) + 1,20/49,Instruction Cycle,Each phase decomposed into sequence of elementary micro-operations E.g. fetch, indirect, and interrupt cycles Execute cycle One sequence of micro-operations for each opcode Need to tie sequences to

13、gether Assume new 2-bit register Instruction cycle code (ICC) designates which part of cycle processor is in 00: Fetch 01: Indirect 10: Execute 11: Interrupt,21/49,Flowchart for Instruction Cycle,22/49,Functional Requirements,Define basic elements of processor Describe micro-operations processor per

14、forms Determine functions control unit must perform,23/49,Basic Elements of Processor,ALU Registers Internal data pahs External data paths Control Unit,24/49,Types of Micro-operation,Transfer data between registers Transfer data from register to external Transfer data from external to register Perfo

15、rm arithmetic or logical ops,25/49,Functions of Control Unit,Sequencing Causing the CPU to step through a series of micro-operations Execution Causing the performance of each micro-op This is done using Control Signals,26/49,Control Signals,Clock One micro-instruction (or set of parallel micro-instr

16、uctions) per clock cycle Instruction register Op-code for current instruction Determines which micro-instructions are performed Flags State of CPU Results of previous operations From control bus Interrupts Acknowledgements,27/49,Model of Control Unit,28/49,Control Signals - output,Within CPU Cause d

17、ata movement Activate specific functions Via control bus To memory To I/O modules,29/49,Example Control Signal Sequence - Fetch,MAR - (PC) Control unit activates signal to open gates between PC and MAR MBR - (memory) Open gates between MAR and address bus Memory read control signal Open gates betwee

18、n data bus and MBR,30/49,Data Paths and Control Signals,31/49,Data Paths and Control Signals,Execute Cycle (ADD) Execute Cycle (ISZ) Execute Cycle (BSA),32/49,Internal Organization,Usually a single internal bus Gates control movement of data onto and off the bus Control signals control data transfer

19、 to and from external systems bus Temporary registers needed for proper operation of ALU t1:MAR(IR(address) t2:MBRMemory t3:Y(MBR) t4:Z(AC)+(Y) t5:AC(Z),33/49,CPU withInternalBus,c1,c2,c10,c7,c8,c9,c11,c3,c4,c5,c6,34/49,Intel 8085 CPU Block Diagram,35/49,Intel 8085 Pin Configuration,36/49,Intel 8085

20、 OUT InstructionTiming Diagram,37/49,Hardwired Implementation (1),Control unit inputs Flags and control bus Each bit means something Instruction register Op-code causes different control signals for each different instruction Unique logic for each op-code Decoder takes encoded input and produces sin

21、gle output n binary inputs and 2n outputs,38/49,Hardwired Implementation (2),Clock Repetitive sequence of pulses Useful for measuring duration of micro-ops Must be long enough to allow signal propagation Different control signals at different times within instruction cycle Need a counter with differ

22、ent control signals for t1, t2 etc.,39/49,Control Unit with Decoded Inputs,PQ=00 Fetch Cycle PQ=01 Indirect Cycle PQ=10 Execute Cycle PQ=11 Interrupt Cycle,40/49,Load Acc Store Acc Add to Acc AND to Acc Jump Jump if AC=0,41/49,Problems With Hard Wired Designs,Complex sequencing & micro-operation log

23、ic Difficult to design and test Inflexible design Difficult to add new instructions,42/49,Required Reading,Stallings chapter 16,43/49,计算机结构与逻辑设计 黄正瑾编著,第七章 控制单元 7.1 计算机中的寄存器及其控制信号 7.2 指令的执行过程 7.3 控制电路的硬件结构 7.4 其他类型指令的执行过程 7.5 微程序控制方式 7.6 全硬件数字系统控制器的设计,44/49,P291 7.5 微程序控制方式,每条指令的执行过程可以认为是按照一定的“微程序”进行的,这个“微程序”可以用硬件实现,也可以用软件实现。 所谓微程序控制,就是将执行指令的微程序用一条条二进制代码编写的微指令组成,成为真正意义上的程序,并用此程序来控制指令的执行。,45/49,图 7.9 微程序控制系统框图,IAR: 微指令地址寄存器 (uPC) OP: 刚才存在操作码寄存器中的数据,46/49,图7.10所示是某个计算机微程序控制器中的ROM,它的每条指令的解释与表7.4相同。现在以此ROM为例,说明微程序系统中指令的执行情况。 设起始时微指令地址寄存器IAR中的数据为0,计算机运行后从ROM中取的第一条微指令是0号微指令,其代码为0000 0000 0000

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论