Microprogrammed Control Unit Computer Organization and Architecture by Ravinder Nath Rajotiya - May 19, 2021December 19, 20220 Share on Facebook Share Send email Mail Print Print Table of Contents Toggle Microprogram Control UnitGeneral features of MCU:Important terms associated with microprogrammed control unit.Block diagram of MCUMapping of InstructionsFormat of the microinstructionAddress Sequencer: Microprogram Control Unit As discussed in Control Unit topic, a control unit generates a binary control variable for executing a particular microoperations. The control unit can be a hardwired or microprogrammed control unit. Figure-1 : Interaction between CU and CPU A control word can be programmed to perform various operations on components of the system. A control unit whose control word is stored in the control memory which is usually a ROM is called as microprogram control unit. Each control word in the control memory contains within it a microinstruction. Every microinstruction specifies one or more micro-operations. A microprogram is written for every instruction supported by the CPU. Each instruction of a program causes the corresponding micro-program to be fetched and its control information extracted in a manner that resembles the fetching and execution of a program from the main memory. Since the control signals are embedded into a kind of low-level software, this is also referred as firmware. General features of MCU: One time Programmable, programmed during manufacture Flexible to accommodate new system specification We can change its functionality, but generally not required once designed Reusability-code easier decoding and sequencing logic Easier to design cheaper Slow Speed Microprogrammed control unit is implemented by writing microprograms in the control memory. These microprograms are a set of microinstructions required for executing the machine instruction. Each microinstruction somehow(implicitly or explicitly ) also specify the address of next microinstruction to be fetched, thus sequencing the microoperations. Important terms associated with microprogrammed control unit. Microprogram: The set of related microinstructions forms a microprogram. The assembly instructions are implemented by writing a microprogram. These microprograms can be changed easily, hence microprogramming yields control units that are more flexible than hardwired control unit. Microinstructions: the control signals to be activated at any time for executing a microoperation is specified by a microinstruction. It specifies one or more microoperations. Microoperations: These are the operations performed on the contents of the registers. Each microoperation is associated with a group of control lines that must be activated in a prescribed sequence to trigger the microoperations. Microinstruction Format: Each control word in the control memory contains within it a microinstruction. Each computer instruction must be microprogrammed. the general format of the 20-bit microinstruction is given below: Figure – Microinstruction Format The microinstruction is divide in to four fields, these are Three fields F1, f2, F3 for the microoperations CD field to select status bit condition BR field specifies the type or the branch to be used Adr field is the address field for the microinstructions Symbol and binary code for Microinstruction fields F1 F2 F3 000 None NOP 000 NOP 000 NOP 001 AC <–AC+DR ADD 001 SUB 001 XOR 010 AC<–0 CLRAC 010 OR 010 COM 011 AC<–AC+1 INCAC 011 AND 011 SHL 100 DRTAC 100 READ 100 SHR 101 DRTAR 101 ACTDR 101 INCPC 110 PCTAR 110 INCDR 110 ARTPC 111 WRITE 111 PCTDR 111 Reserved Conditional and Branch Microinstructions CD Condition Symbol Comment BR Symbol Function 00 Always=1 U Unconditional Bransch 00 JMP CAR ß AD if condition=1 CAR ßCAR+1 if condition=1 01 DR(15) I Indirect address bit 01 CALL CAR ßAD, SBRßCAR+1 if condition=1D, SBRßCAR+1 if CARßCAR+1 if condition=0 10 AC(15) S Sign bit of AC 10 RET CAR ßSBR(Return from subroutine) 11 AC=0 Z Zero value in AC 11 MAP CAR(2-5)ßDR(11-14), CR(0,1,6)ß0 Fetch Routine Microinstructions for Fetch routine AR <– PC DR <– M[AR], PC <PC+1 AR <–DR(0-10), CAR(2-5)<–DR(11-14), CAR(0,1,6)<–0 These instructions are read from the memory into the DR……, the address part is transferred to AR and then the control is transferred to one of the 16 routines by mapping the operation code part of the instruction from DR into CAR. The fetch routine need theree microinstructions which is written as: ORG 64 fetch: PCTAR U JMP NEXT READ, INCPC U JMP NEXT DRTAR U MAP The translation of symbolic microprogram to binary produce the following binary microprogram Binary Address F1 F2 F3 CD BR Addr 1000000 110 000 000 00 00 1000001 1000001 000 100 101 00 00 1000010 1000010 101 000 000 00 11 0000000 Block diagram of MCU Figure-2 shows various components of a microprogrammed control unit. These are: Figure-2: Components of a MPU Control memory Address Sequencer Micro-Instruction Register Micro-Instruction Decoder Control Memory Control memory is in the form of a ROM. It stores microprograms which consist of microinstructions that specifies various internal control signals for executing the microoperations on the contents of the registers. Mapping of Instructions Figure – : Mapping of instruction code to microinstruction address Format of the microinstruction Figure-3: Format of a microinstruction :The control field part specify the control signals to be activated in response to the assembly instruction and the address field contains the reference to address of the next microinstruction in control memory to be executed. The control memory unit also has a current and the next memory address. Address Sequencer: This unit is used to determine the address of the next microinstruction in the control memory. Various functions of this unit is: incrementing the control address by ‘1’. Loading an address into the control address register an address from control memory. transferring an external address Loading an initial address to start the control operation As indicated in the figure the control memory address register (CAR) is connected to the MUX which gets the input from the 2nd field of the microinstruction (address part) or from the external source of address. The instructions opcode after suitable encoding, provides the starting address of its microprogram. The external source of address usually denote the starting address of the microprogram for a particular instruction. The control unit also respond to external signal or external conditions which allow the current microinstruction to choose or select one of the two possible address fields Figure : Address Selection Logic for the Control Memory Share on Facebook Share Send email Mail Print Print