(8.4.3)--Ch_03-System Buses计算机组成原理.ppt
《(8.4.3)--Ch_03-System Buses计算机组成原理.ppt》由会员分享,可在线阅读,更多相关《(8.4.3)--Ch_03-System Buses计算机组成原理.ppt(75页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 计算机组成原理 -双语教学课件双语教学课件William Stallings Computer Organization and Architecture6th EditionChapter 3System Buses3.1 computer component Program ConceptHardwired systems are inflexibleProgrammed manually by setting switches and plugging&unplugging cables General purpose hardware can do different tasks,g
2、iven correct control signals(go to)Instead of re-wiring,supply a new set of control signalsWhat is a program?A sequence of stepsFor each step,an arithmetic or logical operation is doneFor each operation,a different set of control signals is needed一系列的步骤一系列的步骤每一步,完成一个算术或逻辑操作每一步,完成一个算术或逻辑操作每一次操作,需要一组不
3、同的控制信号每一次操作,需要一组不同的控制信号Function of Control UnitFor each operation a unique code is providede.g.ADD,MOVEA hardware segment accepts the code and issues the control signalsWe have a computer!要为每一个操作提供一个唯一的编码要为每一个操作提供一个唯一的编码(相互区别相互区别)硬件部分接受该编码并发布控制信号硬件部分接受该编码并发布控制信号ComponentsThe Control Unit and the Ari
4、thmetic and Logic Unit constitute the Central Processing UnitData and instructions need to get into the system and results outInput/outputTemporary storage of code and results is neededMain memory控制器和运算器构成控制器和运算器构成CPU系统要输入数据和指令,输出结果系统要输入数据和指令,输出结果需要暂时存储需要暂时存储(数据的和指令的数据的和指令的)编码和结果编码和结果Computer Compon
5、ents:Top Level ViewStructure of components(charter 2 page 19)Memory structure:Memory contains of N storage locations,called word,of M digits(bits).Both data and instructions are stored there.Data(numbers)are represented in binary form.Instructions also are binary code form.Each storage location has
6、a serial number to sign its position,the serial number calls address,from 0 to N-1.Memory structureAn instruction wordAn data wordAddressfrom o to N-1I/O structureIn an abstracted and simplified view,I/O is similar to memory.Some words of storage CPU structureSome registers:Memory buffer register(MB
7、R):contains a word to be stored into memory,or a word just received from memory.Memory Address Register(MAR):specifies the address in memory of read/write a word(data or instruction).Instruction buffer Register(IBR):holds temporarily an instruction code just fetched from memory CPU structureInstruct
8、ion Register(IR):contains opcode of Instruction to be decoded.Program counter(PC):contains the address of the next instruction in memory.Accumulator(AC or Acc):holds temporarily a data word(an operand or a result of ALU operation).Cpu structureAC,IBR is not necessary for connection Connection for da
9、ta transferring3.2 computer function Instruction Cycle page53Two steps(of an INSTRUCTION cycle):Fetch (取指令)Execute (执行指令)Fetch Cycle(Fetch subcycle)page54Program Counter(PC)holds address of next instruction to fetchProcessor fetches instruction from memory location pointed to by PCIncrement PCUnless
10、 told otherwiseInstruction loaded into Instruction Register(IR)Processor interprets instruction and performs required actions(issues control signals)Execute Cycle(or Execute subcycle)Processor-memorydata transfer between CPU and main memoryProcessor-I/OData transfer between CPU and I/O moduleData pr
11、ocessingSome arithmetic or logical operation on dataControlAlteration of sequence of operationse.g.jumpCombination of aboveInstruction format page550001 1001 0100 0000=1 940H Means Load data to from 940H of Memory0101 1001 0100 0001=5 941H Means Add AC with data from 941H 0010 1001 0100 0010=2 942HM
12、eans Store data in AC to 942H0111215opcodeAddress codeOpcode:0001=Load AC from Memory 0010=Store AC to Memory 0101=Add to AC from MemoryProgram consists of 3 instruction:Address instruction note300 1940 load AC from 940(M)301 5941 add to AC from 941(M)302 2941 store AC to 941(M)Address data value940
13、 0003 3941 0002 2Example of Program Execution page56The operation of Each instruction contains 2 actions with memory:Fetch instruction from memory according to PCFetch/store data from/to memory according to address in instruction.(read/write access)Thinking:memory speed is so slower,2 times of memor
14、y actions means that CPU must wait the memory performing.I.e.in PDP-11,the instructionADD B,A means fetch instruction fetch B,fetch A store to A after addition Instruction Cycle-State Diagram page57Interrupts page58Mechanism by which other modules(e.g.I/O)may interrupt normal sequence of processingP
15、rograme.g.overflow,division by zeroTimerGenerated by internal processor timerUsed in pre-emptive multi-taskingI/Ofrom I/O controllerHardware failuree.g.memory parity errorProgram Flow ControlInterrupt Cycle(or Interrupt subcycle)page59Added to instruction cycleProcessor checks for interruptIndicated
16、 by an interrupt signalIf no interrupt,fetch next instructionInterrupt Cycle(or Interrupt subcycle)page59If interrupt pending(未处理):Suspend execution of current program Save contextSet PC to start address of interrupt handler routineProcess interrupt Restore context and continue interrupted programTr
17、ansfer of Control via Interrupts page61suspendingresumingbranchingprocessingInstruction Cycle with InterruptsProgram Timing short I/O Wait page62Call I/O 1.Call I/O 2Return userinterruptReturn and wait interrupt在2a期间,CPU执行用户程序和I/O操作是同时进行的.5作为中断处理中断中断了用户程序2Interrupt handlerProgram TimingLong I/O Wait
18、Instruction Cycle(with Interrupts)-State Diagram page65Multiple Interrupts page64Disable interruptsProcessor will ignore further interrupts while processing one interruptInterrupts remain pending and are checked after first interrupt has been processedInterrupts handled in sequence as they occurMult
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 8.4.3-Ch_03-System Buses计算机组成原理 8.4 Ch_03 System Buses 计算机 组成 原理
限制150内