Computer Organization and Architecture + Networks Lecture 10 Control Unit Overview • So far in the course, we have looked at the processor design and assumed that the control portion worked • In this section, we will — Survey the control unit operation — Highlights design methods using Hardwired control Microprogrammed control Control Unit Function • We have already seen that — Computer executes a program. — Programs are executed as a sequence of instructions — Each instruction contains a series of steps that make up the instruction cycle fetch, decode, execute, interrupt cycles • Each of these steps/cycles has a number of fundamental operations/a smaller series of steps called microeperations Control Unit Function • Thus, the control unit operation can be defined by — Defining the elements of the CPU — Defining the microoperationsthe CPU performs — Determining the functions the control unit must perform to cause the execution of the microoperations in the desired time sequence Sequencing Execution • Sequencing — Control unit causes the processor to step through a series of microoperations in the proper sequence based on the program being executed • Execution — Control unit causes each microoperation to be performed • How the control unit performed the 2 functions? – Control Unit Function • General layout of a control unit is shown below Clock: one micro-instruction per clock cycle Instruction register: opcode for current instruction, determines which microinstructions are performed Flags: status of the processor and indication of results of previous operations From control bus: control signal from bus eg. interrupts Within CPU: cause data movement and to activate specific functions Via control bus: control signal to memory and control signal to I/O modules Control Unit Function • Each step of the instruction cycle can be decomposed into microoperation primitives that are performed in precise time sequence — Instruction fetch t1: t2: t3: MAR (PC) MBR memory PC PC+1 IR (MBR) Memory address register Memory buffer register Program counter Instruction register — And add instruction - Add R1, X t1: t2: t3: MAR (IR(address)) MBR memory R1 (R1) + (MBR) • Each microoperation is initiated and controlled based on the used of control signals/lines coming from the control unit — cause data to move from one register to another and activate specific ALU functions Microoperations • Control unit design is then the collection and the implementation of all of the needed control signals Simple processor with single AC - Data path between element -Termination of control signals, Ci The control unit receives inputs from the clock, the IR and flags Data paths and control signals With each clock cycle, the control unit reads all of its inputs and emits a set of control signals – which go to 3 separates destinations 1.Data paths 2.ALU 3.System bus Microoperations Despite the 4 key inputs -Flags & control bus signals – bit with meaning -IR and CLK – not directly useful Control unit use the opcode and perform different actions for different instructions control unit with decoded inputs – complex to than general to account for variablelength opcodes Timing generator in order the control unit to emit different control signals at different time units within a single instruction cycle Control unit with decoded inputs • Two approaches of implementation — Hardwired implementation Control unit is viewed as a sequential logic circuit Used to generate fixed sequences of control signals Implemented using any of a variety of “standard” digital logic techniques Principle advantages Higher speed operation Smaller implementations (components counts) Modifications to the design can be hard to do Favored approach in RISC style designs — Microprogrammed control unit Control signal values for each microoperation are stored in a memory device – the control store Reading the contents of the control store in a prescribed order is equivalent to sequencing through the microoperations Since the “program” of microoperations and their control signal values are stored in memory, microprogrammed units Are more systematic with a well defined format Can be easily modified during the design process Require more components to implement Tend to be slower than hardwired units (due to having to perform memory read operations) Hardwired Implementation • Three general design approaches — Traditional “state-table” method from a digital logic course Can produce the minimum component design Complex design that may be hard to modify — Clocked delay element Straight-forward layout based on flowchart of the instruction implementation Requires more delay elements (flip-flops) than are really needed — Sequence counter approach – Polyphase clock signals are derived from the master clock using a standard counter-decoder approach – These signals are applied to the combinational portion of the circuit • Example: load register B (control signal C12) — C12 = T4I3 + T5I6Z + T6I24P Microprogramming • The concept of programming was developed by Maurice Wilkes (1951), using diode matrices for the memory element Wilkes’ microprogrammed control unit Microprogramming • Modern microprogrammed control units have replaced the diode matrices with standard memory components — The control unit operates by performing consecutive control storage reads to generate the next set of control function outputs • Performing the series of control memory accesses is, in effect, executing a program for each instruction in the machine’s instruction set – hence the term microprogramming • The control unit appears to be a complete computer within the larger computer – with all of its problems — How do you specify the next microinstruction to be executed? — How are branches handled? The option for next address •Address field •Instruction register code •Next sequential address Branch control logic: single address field Mux – serves as destination for a address field + instruction register Based on address-selection input, the Mux transmits either the opcode of address field to the control address register CAR – decoded to produce the next microinstruction address. Simple microprogrammed control unit Address-selection – provided by a branch logic module whose input consists of control unit flags + bits from the control portion of the microinstruction Branch control logic: two address fields – two address field in each microinstruction Similar process – Mux can transmits one of the two address + opcode More complex unit • For the typically large microprocessor systems today, there are — Many instructions and associated register-level hardware — Many control point to be manipulated • This can result in a control memory that — Contains a large number of words – corresponding to the number of instructions to be executed — Has a wide word width – due to the large number of control points to be manipulated • Most modifications to the basic design of a microprogrammed control unit have been concerned with the word length • Length is based on 3 factors — Maximum number of simultaneous microoperations that must be supported — The control information is represented or encoded — The way in which the next microinstruction address is specified • Designer must choose the parallel “power” of each instruction — Each microinstruction specifies a single (or few) microoperations to be performed (vertical microprogramming) — Each microinstruction specifies many different microoperations to be performed in parallel (horizontal microprogramming) • Vertical microprogramming — Width is narrow: n control signals can be encoded into log2 n control bits — Limited ability to express parallelism — Considerable encoding of control information requires external memory word decoder to identify the exact control line being manipulated • Horizontal microprogramming — Wide memory word — High degree of parallel operations are possible — Little to no encoding of control information • Compromise — Divide control signals into disjoint groups — Implement each group as a separate field in the memory word — Supports reasonable levels of parallelism without too much complexity Summary • This section has overviewed the operation and the design of the control unit • Hardwired and microprogramming techniques discussed — Basic operation of each — Advantages and disadvantages of each