【正文】
portant, the cost of these microcontrollers is very low, making their use cost effective. In the following pages, we consider two puter CPUs, one for a plex instruction set puter (CISC) and the other for a reduced instruction set puter (RISC). After a detailed examination of the designs, we pare the performance of the two CPUs and present a brief 10 overview of some methods used to enhance that performance. Fi nally, we relate the design ideas discussed to general digital system design. Two CPU designs As mentioned in previous chapters, atypical CPU is usually divided into two parts: the datapath and the control unit. The datapath consists of a function unit, registers, and internal buses that provide pathways for the transfer of information between the registers, the function unit, and other puter ponents. The datapath may or may not be pipelined. The control unit consists of a program counter, an instruction register, and control logic, and may be other hardwired or microprogrammed. If the datapath is pipelined, the control unit may be also be a pipeline. The puter of which the CPU is a part is either a CISC or a RISC, with its own instruction set architecture. The purposes of this chapter is to present two CPU designs that illustrate binations of architectural characteristics of the instruction set, the datapath, and the control unit. The designs will be top down, but with the reuse of prior ponent designs, illustrating the influence of the instruction set architecture on the datapath and control units, and the influence of the datapath on the unit. The material makes extensive use of tables and diagrams. Although we reuse and modify ponent designs from others , background information from these chapters is not repeated here. References, however, are given to earlier sections of the book, where detailed information can be found. The two CPUs presented are for a CISC using a nonpipelined datapath with a microprogrammed control unit and a RICS using a pipelined datapath with a hardwired pipelined control unit. These represent two quite distinct binations of instruction set architecture, datapath, and control unit. The plex instruction set puter The first design we present is for a plex instruction set puter with a nonpipelined datapath and microprogrammed control unit. We begin by describing the instruction set architecture, including the CPU register set, instruction formats, and addressing modes. The CISC nature of the instruction set architecture is demonstrated by its memorytomemory access for data manipulation instructions, eight addressing modes, two instruction format lengths, and instructions that require significant sequences of operations for their execution. We design a datapath for implementing the CISC architecture. The datapath is based on the one initially described in Section 79 and incorporated into a CPU in section 810. modifications are made to the register file, the function unit, and the buses to support the 11 present instruction set architecture. Once the datapath has been specified, a control unit is designed to plete the implementation of the instruction set architecture. The design of the control unit must involve a coordinated definition of both the hardware anization and the microprogram anization. In particular , dividing the microprogram into microroutines, while at the same time designing the sequencer with which they interact, is a key part of the design. Even the instruction fields and opcodes are tied to this coordinated effort. Following the definition of the hardware and microcode anizations, we detail essential parts of the microcode and the microroutines for representative operations. Instruction set architecture Figure 101 shows the CISC register set accessible to the programmer. All registers have 16 bits. The register file has eight registers, R0 though is a special register that always supplies the value zero when it is used as a source and discards the result when it is used as a destination. In additional to the register file, there is a program counter PC and stack pointer SP. The presence of a stack pointer indicates that a memory stack is a part of the architecture . the final register is the processor status register PSR, which contains information only in its rightmost the five bits。我們研究任何形式的風(fēng)險(xiǎn),像軟件和硬件一頁(yè)提出每個(gè)解決方案。在每個(gè)執(zhí)行微線(xiàn)路之后,在獲取下一個(gè)指令之前該程序進(jìn)入了中斷。根據(jù)操作碼( OPCODE)的前三個(gè)位,要么一個(gè)單一的操作,兩個(gè)操作(或 者一個(gè)操作加一個(gè)參數(shù)),要么一個(gè)分支地址,這二者選其一。這個(gè)分支被圖中的五個(gè)二進(jìn)制決策框代替。這個(gè)流動(dòng)顯示在圖 108 中,這個(gè)圖表并不是嚴(yán)格的 ASM 圖,因?yàn)槊總€(gè)矩形框?qū)?yīng)的微線(xiàn)路代表了不同的國(guó)家而不是一個(gè)單一的國(guó)家以及對(duì)應(yīng)的是多計(jì)時(shí)周期而不是單一的周期。SBR 被用來(lái)存儲(chǔ)關(guān)于 CAR 的下一代地址,同時(shí)一個(gè)微子線(xiàn)路是在微路線(xiàn)的要求下 為了使微程序執(zhí)行轉(zhuǎn)向下一個(gè)微指令。其中之一是控制單元登記:指令登記 IR,程序計(jì)數(shù)器 PC 和堆棧指針度 SP。一個(gè) 2 比 1 多路復(fù)用器 MUX SO 選擇的結(jié)束位來(lái)傳遞到執(zhí)行觸發(fā)器。這個(gè)修改涉及到切換邏輯的最終的位。在微指令中有 5 位的空間是用來(lái)合并目 5 的地和來(lái)源地 址的 DSA,再增加 5位空間給 B 地址 SB。 我們不能進(jìn)入 8個(gè)基于在指令集內(nèi)可用 3 位登記地址的臨時(shí)登記冊(cè)。 在第 810節(jié)里,注冊(cè) R8是被作為臨時(shí)的存儲(chǔ)位置。例如, LD, ST, IN, 和 OUT 都可以通過(guò)使用在內(nèi)存映射結(jié)構(gòu)里的 MOVE 指令來(lái)實(shí)現(xiàn)。 帶有 IR(15:14)=11 的指令是分流的。表格的第三欄提供了注冊(cè)轉(zhuǎn)換為針對(duì)一個(gè)操作指令的每個(gè)處理模式的聲明。對(duì)帶有單一運(yùn)算的 16 位指令來(lái)說(shuō)有足夠的 OPCODE 位。右邊的 4 個(gè) OPCODE 位可以指定多達(dá) 16 個(gè)操作或帶有暗示的操作地址。通用指令格式的有五個(gè)領(lǐng)域。堆棧指針的出現(xiàn)的情況表明內(nèi)存堆棧是構(gòu)架的一部分。特別是把微程序分成微線(xiàn)路,然而同時(shí)也設(shè)計(jì)了它們相互影響的音序器,這是設(shè)計(jì)的關(guān)鍵部分。 2.復(fù)雜指令集計(jì)算機(jī) 我們提交的第一個(gè)設(shè)計(jì)就是為一個(gè)帶有非流水線(xiàn)數(shù)據(jù)路徑和微程序的控制單元的 復(fù)雜指令集計(jì)算機(jī)而設(shè)計(jì)的。電腦的 CPU 是一個(gè)部分, 1 要么是復(fù)雜指令集計(jì)算機(jī)( CISC),要么是精簡(jiǎn)指令集計(jì)算機(jī)( RISC),有 自己的指令集架構(gòu)。 在接下去的幾頁(yè)里,我考慮的是兩個(gè)計(jì)算機(jī)的 CPU,一個(gè)是一個(gè)復(fù)雜指令集計(jì)算機(jī)( CISC),另一個(gè)是精簡(jiǎn)指令集計(jì)算機(jī)( RISC)。在外部, CPU 為轉(zhuǎn)換指令數(shù)據(jù)和控制信息提供一個(gè)或多個(gè)總線(xiàn)并從組件連接到它。字長(zhǎng)也許更短,(或者說(shuō) 4或 8個(gè)字節(jié)),編制數(shù)量少,指令集有限。這個(gè)數(shù)據(jù)途徑有可能是流水線(xiàn),也有可能不是。但是,參考資料可以在這本書(shū)的前幾節(jié)里找到詳細(xì)的信息。對(duì)登記檔案,功能單元以及總線(xiàn)進(jìn)行修改來(lái)支持現(xiàn)有的指令集構(gòu)架。這個(gè)注冊(cè)文件有 8 個(gè)寄存器,從 R0 到 R7。根據(jù)一些明確的操作和是否分開(kāi)操作,將這些操作分成 4 組。 圖 2 OPCODE 的前兩位, IR( 15: 14),確定了一些明確的操作和格式領(lǐng)域的如何使用。但是,切換指令要求有一個(gè)切換數(shù)額來(lái)只是到底切換多少位。否則,如果第三位等于 0 的,間接處理就不適用,而如果等于 1 ,間接處理就適用。如果 S等于 1 那么目的地使用處理方式,且來(lái)源是注冊(cè)的。在第 9章里給出的大部分操作都被包括在指令集里。 數(shù)據(jù)路徑組織 不是從頭開(kāi)始,我們將重新使用非流水線(xiàn)數(shù)據(jù)路徑被雇用在第 810 節(jié)里的微程序 4 控制器,并進(jìn)行修改。圖 3提供了一個(gè)帶有臨時(shí)登記屏蔽的擴(kuò)展注冊(cè)文件的地圖。該登記冊(cè)檔案使用 B 地址的來(lái)源,以及