0% found this document useful (0 votes)
27 views24 pages

Unit-3 Coa

Uploaded by

yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views24 pages

Unit-3 Coa

Uploaded by

yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Notes By Prof.

Tanya Shrivastava

UNIT – 3

COMPUTER ORGANIZATION AND ARCHITECTURE

 GENERAL MODEL OF THE CONTROL UNIT WITH A DIAGRAM

 Control unit use to control the signals. A Central Processing Unit is the most important
component of a computer system. A control unit is a part of the CPU which directs the
operation of the processor. A control unit controls the operations of all parts of the
computer.
 It is the responsibility of the control unit to tell the computer‟s memory, arithmetic/logic
unit, and input and output devices how to respond to the instructions that have been sent to
the processor.
 Control memory is use to control the memory in the control unit. Control Memory is the
storage in the micro programmed control unit to store the micro program.
 Writeable Control Memory: Control Storage whose contents can be modified, allow the
change in micro program and Instruction set can be changed or modified is referred as
Writeable Control Memory.
 The control memory consists of micro programs that are fixed and cannot be modified
frequently. They contain microinstructions that specify the internal control signals required to
execute register micro-operations. The machine instructions generate a chain of
microinstructions in the control memory.
 CPUs and GPUs are examples of devices that use control units.

Examples of devices that require a CU are:


 Control Processing Units(CPUs)
 Graphics Processing Units(GPUs)

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Functions of the Control Unit


 It manages the sequence of data movements into, out of, and between a processor‟s many sub-units.
 It interprets instructions.
 It controls data flow inside the processor.
 It receives external instructions or commands to which it converts to sequence of control signals.
 It controls many execution units (i.e. ALU, data buffers and registers) contained within a CPU.
 It also handles multiple tasks, such as fetching, decoding, execution handling and storing results.

Types of Control Unit


There are two types of control units:
 Hardwired
 Micro programmable control unit.

 INSTRUCTION TYPES

Instruction
An instruction is something that someone tells you to do. Instruction is a command which is given by
the user to computer to perform some task.

There are 3 types of instructions:

1. Data Transfer Instruction


2. Data Manipulation Instruction
3. Program Control Instruction

1. Data Transfer Instruction

These instructions are used to transfer the data from one place to another.

Data transfer instructions transfer the data between memory and processor registers, processor registers,
and I/O devices, and from one processor register to another.

Data Transfer Methods


Data transfer from:
Memory to Register ex. MOV R, M[X]
Register to Memory ex. MOV M[X], R
Register to Register ex. MOV R1, R2

There are eight commonly used data transfer instructions. Each instruction is represented by a
mnemonic symbol.

Name Mnemonic Symbols

Load LD

Store ST

Move MOV

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Name Mnemonic Symbols

Exchange XCH

Input In

Output OUT

Push PUSH

Pop POP
2. Data Manipulation Instruction
Data manipulation instructions are those instructions that manipulate or change the content of the
data/registers/memory.

The data manipulation instructions are usually divided into three types:
1. Arithmetic instructions
2. Logical instructions and bit manipulation instructions
3. Shift instructions

Arithmetic instructions: The four basic operations of arithmetic instructions are addition,
subtraction, multiplication, and division. Arithmetic instructions include increment, decrement, add,
subtract, multiply, divide, add with Carry, subtract with Borrow, negate that is (2‟s) two's complement.
If there‟s a negative number, it is considered as negate (so two's complement).

Name Mnemonic

Increment INC

Decrement DEC

Add ADD

Subtract SUB

Multiply MUL

Divide DIV

Add with carry ADDC

Subtract with borrow SUBB

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Logical instructions and bit manipulation instructions: logical and bit manipulation instructions
starting with clear (that means clear the content of accumulator), complement the accumulator, AND,
OR, Exclusive-OR, Clear carry, Set carry, Complement carry, Enable interrupts, Disable interrupts, all
these are logical and bit manipulation instructions.

 Clear instruction means making all the bits of a register „0‟.


 AND instruction performs multiplication of two binary numbers.
 OR instruction performs addition of two binary numbers.
 Set instruction means making all the bits of a register „1‟.
 XOR instruction is referred to as bit complement instruction.

Name Mnemonic

Clear CLR

Complement COM

AND AND

OR OR

Exclusive-OR XOR

Clear carry CLRC

Set Carry SETC

Complement Carry COMC

Enable Interrupt EI

Disable Interrupt DI

Shift instructions: Shift instructions allow the bits of a memory byte or register to be shifted one-bit
place to the right or the Left.

Name Mnemonic

Logical Shift Right SHR

Logical Shift Left SHL

Arithmetic Shift Right SHRA

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Arithmetic Shift Left SHLA

Rotate Right ROR

Rotate Left ROL

Rotate Right through carry RORC

Rotate Left through carry ROLC

3. Program Control Instruction

 The program control instructions control the flow of program execution.


 Program control instructions modify or change the flow of a program. It is the instruction that
changes the sequence of the program's execution, which means it changes the value of the program
counter, due to which the execution of the program changes.

Name Mnemonics

Branch BR

Jump JMP

Skip SKP

Call Call

Return RET

Compare (by Subtraction) CMP

Test (by ANDing) TST

 INSTRUCTION FORMAT

Instruction is an order given by user to computer that tells CPU what to do.

Instructions are written in machine language.

Instructions stored in memory.

CPU fetches the instructions from main memory and one by one stored in the Instruction Register (IR)
in particular format after that executes instruction and result displayed to user.

Instruction format: Instruction format describe the layout or internal structure of instruction and how
instruction is represented in Instruction Register by CPU.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

1st field: Opcode is also known as operation code. It tells the CPU which operation is to be performed in
the instruction. For example add (addition), sub (subtraction), mul (multiplication), mov etc.

 ADD A (in this operation addition is performed)


 MOV R1, R2, (in this mov operation is performed)

2nd field: Address of operand also known as data. Data stored in main memory and its address stored in
address field of instruction.

3rd field: Mode defines way of calculating address of operand. Mode tells whatever the address of the
data is given, how CPU reach to that address. Weather it is Memory address or Register address.

Types of Instruction Format:

Three address instruction: contains 1 opcode field and 3 address field.


Two address instruction: contains 1 opcode field and 2 address field.
One address instruction: contains 1 opcode field and 1 address field.
Zero address instruction: contains 1 opcode but no address field.

Example add two numbers 2+5=7

ADD 2 5
Result = 7

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

In two address
instruction we
mainly use MOV
operation.

In one address instruction result


stored in Accumulator (AC), but
not in main memory. In one
address instruction we mainly use
LOAD and STORE operation.

Instruction specifies
data itself. Basically we
use stack operation for
example PUSH and
POP.

Numerical based on Instruction Format


Q. Describe the Assembly Language Code for the expression X= (A+B) *(C+D)

a) Using Zero-Address Instruction


b) Using One-Address Instruction
c) Using Two-Address Instruction
d) Using Three Address Instruction

Answer:

Zero Address Instructions


In case of Zero Address Instructions the expression is first converted in to Reverse Polish Notation
i.e. Postfix Notation.

Expression: X = (A+B)*(C+D)
Postfixed : X = AB+CD+*
TOP means top of stack
M[X] is any memory location

PUSH A TOP = A

PUSH B TOP = B

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

PUSH A TOP = A

ADD TOP = A+B

PUSH C TOP = C

PUSH D TOP = D

ADD TOP = C+D

MUL TOP = (C+D)*(A+B)

POP X M[X] = TOP

One Address Instructions


Expression: X = (A+B)*(C+D)
AC is accumulator
M[] is any memory location
M[T] is temporary location

LOAD A AC = M[A]

ADD B AC = AC + M[B]

STORE T M[T] = AC

LOAD C AC = M[C]

ADD D AC = AC + M[D]

MUL T AC = AC * M[T]

Two Address Instructions


Here destination address can also contain an operand.
Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location

MOV R1, A R1 = M[A]

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

MOV R1, A R1 = M[A]

ADD R1, B R1 = R1 + M[B]

MOV R2, C R2 = M[C]

ADD R2, D R2 = R2 + M[D]

MUL R1, R2 R1 = R1 * R2

MOV X, R1 M[X] = R1

Three Address Instructions


Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location

ADD R1, A, B R1 = M[A] + M[B]

ADD R2, C, D R2 = M[C] + M[D]

MUL X, R1, R2 M[X] = R1 * R2

Q. Discuss Instruction format and classify according to the basic computer systems. The
Instruction format has 16 bits, 12 bits are used to represent address part and one bit for mode
part then Calculate how many bits are required for opcode?

Solution:

Instruction format = 16 bits,


Address part is 12 bits= 0 to 11 (given)
and address mode= 1 bit i.e. 15, (given)
Hence total no. of bits are required for opcode field = 3 i.e. 12, 13, 14

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Q. The Memory unit of a Computer has 512K words of 32 bits each. The Computer has an
Instruction format with four fields: an operation code field, a mode field to specify one of the
seven addressing modes, a register address field to specify one of the 90 processor register, and a
memory address. Analyse the instruction format and number of bits in each field if the instruction
is in one word memory.

Solution:

A computer has 512 K word memory i.e.

90 processor registers will require 9 bits (90 < 29)

7 address modes will require 3 bits (7 < 23)

Memory address field is 19 bits (in 512 K)

So opcode will have 32 – (9+3+19) = 1

So maximum instructions the system supports = 1 + 9 + 3 + 19 = 32

Q. A computer uses a memory unit of 512 K words of 32 bits each. A binary instruction code is
stored in one word of the memory. The instruction has four parts: an addressing mode field to
specify one of the two-addressing mode (direct and indirect), an operation code, a register code
part to specify one of the 256 registers and an address part. How many bits are there in
addressing mode part, opcode part, register code part and the address part?

Solution:

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Q. A computer has 256 K word memory. The instruction format has 4 fields i.e., Opcode, register
field to represent one of the 60 processor registers, mode field represent one of 7 addressing
modes and memory address field. How many instructions the system supports when a 32- bit
instruction is placed in the one memory cell.
Or

Q. The memory unit of a computer has 256K words of 32 bits each. The computer has an
instruction format with four fields: an operation code field, a mode field to specify one of seven
addressing modes, a register address field to specify one of 60 processor registers, and a memory
address. Specify the instruction format and the number of bits in each field if the in instruction is
in one memory word.

Solution:

 INSTRUCTION CYCLES AND SUBCYCLES


 Instruction cycle is also known as Fetch, Decode and Execute Cycle.
 Instruction cycle is divided into 4 sub phases or 4 sub cycles. Fetchdecode, decoderead,
readexecute, executefetch.
 The instruction cycle consists of four phases: fetching an instruction from memory, decoding the
fetched instruction, reading the address from memory, and finally, instruction execution.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Buses Used in Instruction cycle:

A bus is a collection of small wires and a communication system that transfers data between the
internal components of the computer or between the computers.
A bus is a collection of wires used for the communication of different parts of a computer. Further, it uses
electric signals to pass the data and information.

TYPES OF BUSES

Data Bus: The data bus is bidirectional. The data bus is used to communicate or send the data from
one part to another.
Address Bus: The address bus is unidirectional. The address bus is used to communicate the address of
the given data and instructions.
Control Bus: The control bus is unidirectional. The control bus is used to control the signals between
different devices.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Registers used in Instruction cycle:

 Register is an electronic component that is used to hold the information as bits.


 Register are used by processor (CPU) to store small amount of data.
 A register can be 2 bit register, 4 bit register, 8 bit register, 16 bit register,
32 bit register, 64 bit register etc.
 Register provides fast execution, fast accessing, fast fetching.
 CPU is a fast processor because it contains registers that provides fast speed.
 Register is a collection of various flip-flops.
 Flip flop means a single cell that is capable to store a single bit.
 1 cell stores 1 bit.
 1 cell = 1 flip-flop
Example: this 8 bit register contains 8 cells or we can say 8 flip-flops.

1 0 1 1 0 1 0 0
Types of Registers are:

 Program Counter (PC)


 Memory Address Register (MAR)
 Memory Data Register (MDR)/Memory Buffer Register (MBR)
 Instruction Register (IR)

Program Counter (PC)


 Program counter is a register in the CPU.
 Program counter is also known as digital counter.
 Controls sequence of instructions.
 A program counter is a register in the CPU containing the address of the next instruction to be
executed from memory.
 It holds the address of the memory/RAM. Address of RAM like – 0,1,2,3 etc.

Memory Address Register (MAR)

 MAR is a register in the CPU it contains address of the memory or RAM.


 Stores memory address/RAM address.
 The memory/RAM address store in the program counter (0, 1, 2, 3 etc.) is copied into the MAR
(0, 1, 2, 3 etc.).

Memory Data Register (MDR)/Memory Buffer Register (MBR)

 MDR/MBR is a register in the CPU. Stores and process the memory.


 Memory Data Register also known as Memory Buffer Register.
 It is used to hold the contents of the memory/RAM. Contents like – Load 4, ADD 5, Store 6
these are the contents of the RAM.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 The main purpose of MDR is: if a CPU contains a 4-bit register and we have data of 100 bits, so
MDR converts the 100 bits data into 4-4 bits, and then it will be executed. (Split large data into
small pieces).

Instruction Register (IR)

 The memory content store in the MDR is copied into the Instruction Register (IR).
 It is used to store the instructions like LOAD, ADD, SUB, DIV, MUL, STORE, MOV, EXE etc.
 Instruction Register (IR) is also known as Current Instruction Register (CIR).

 MICRO OPERATIONS
 In computer central processing units, micro-operations (also known as micro-ops) are the
functional or atomic, operations of a processor.
 These are low level instructions used in some designs to implement complex machine instructions.
They generally perform operations on data stored in one or more registers.
 They transfer data between registers or between external buses of the CPU, also performs
arithmetic and logical operations on registers.
 Each instruction cycle is made up of a number of smaller units – Fetch, Indirect, Execute and
Interrupt cycles. Each of these cycles involves series of steps, each of which involves the
processor registers. These steps are referred as micro-operations.

Types of Micro-operations

1. Arithmetic Micro-operations
2. Logic Micro-Operations
3. Shift Micro-operations

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Arithmetic Micro-operations
The basic Arithmetic Micro-operations are classified in the following categories:
1. Addition
2. Subtraction
3. Increment
4. Decrement
5. Shift
Some additional Arithmetic Micro-operations are classified as:
1. Add with carry
2. Subtract with borrow
3. Transfer/Load, etc.
Logic Micro-operations
1. Clear
2. AND
3. Exclusive OR
4. OR
5. NOR
6. NAND
Shift Micro-operations
1. Shift Left Register (shl)
2. Shift Right Register (shr)
3. Circular Shift Left Register (shlc)
4. Circular Shift Right Register (shrc)
5. Arithmetic Shift Left (shla)
6. Arithmetic Shift Right (shra)

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 EXECUTION OF A COMPLETE INSTRUCTION

In a computer program we have seen that execution of every instruction consists of two parts – fetch
phase and execution phase of the instruction.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

Figure Control sequence for execution of instruction Add (R3), Rl.

 In step 1, the instruction fetch operation is initiated by loading the contents of the PC into the MAR
and sending a Read request to the memory. The Select signal is set to Select4, which causes the
multiplexer MUX to select the constant 4. This value is added to the operand at input B, which is
the contents of the PC, and the result is stored in register Z.
 The updated value is moved from register Z back into the PC during step 2, while waiting for the
memory to respond.
 In step 3, the word fetched from the memory is loaded into the IR.
 Steps 1 through 3 constitute the instruction fetch phase, which is the same for all instructions. The
instruction decoding circuit interprets the contents of the IR at the beginning of step 4.
 This enables the control circuitry to activate the control signals for steps 4 through 7, which
constitute the execution phase.
 The contents of register R3 are transferred to the MAR in step 4, and a memory read operation is
initiated.
 Then the contents of R1 are transferred to register Y in step 5, to prepare for the addition operation.
 When the Read operation is completed, the memory operand is available in register MDR, and the
addition operation is performed in step 6.
 The contents of MDR are gated to the bus, and thus also to the B input of the ALU, and register Y
is selected as the second input to the ALU by choosing Select Y The sum is stored in register Z,
then transferred to R1 in step 7.
 The End signal causes a new instruction fetch cycle to begin by returning to step 1.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 PROGRAM CONTROL

 The program control instructions control the flow of program execution.


 Program control instructions modify or change the flow of a program. It is the instruction that
changes the sequence of the program's execution, which means it changes the value of the program
counter, due to which the execution of the program changes.

Name Mnemonics Description

Branch BR Specify the address we need to branch. Three types of branch


instruction are jump, call and return.

Jump JMP The jump instruction transfers the program sequence to the
memory address.

Call Call The CALL instruction is used to call the value.

Return RET RETURN instruction is used to RETURN the value.

Skip SKP Skip instruction is used to skip one or next instruction.

Compare (by CMP Compare instructions used to perform comparisons.


Subtraction)

Test (by ANDing) TST Test instruction use to test the instructions.

 REDUCED INSTRUCTION SET COMPUTER/COMPLEX INSTRUCTION SET COMPUTER


RISC CISC
It focuses on software. It focuses on hardware
It uses only hardwired control unit It uses both hardwired and Microprogrammed
control unit
Code size is large Code size is small
The use of pipeline are simple in risc The use of pipeline are difficult in cisc
An instruction is executed in a single clock Instruction may take more than one clock cycle.
cycle.
The execution time of risc is very short The execution time of cisc is very long
Takes more space in memory Takes less space in memory
Less registers Use more registers
Fixed length instruction Variable length instruction
110011 1010101010110
001100 10110101010
101000 1100111000111100
Instructions are reduced Instructions are complex
Power consumption is less Power consumption is more
Load and Store independent instructions Load and Store independent instructions
(Register to Register) (Memory to Memory)

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 PIPELINING
 Pipelining is a process of arrangement of hardware elements of the CPU such that its overall
performance is increased.
 Simultaneous execution of more than one instruction takes place in a pipelined processor.

Let us see a real-life example that works on the concept of pipelined operation. Consider a water
bottle packaging plant. Let there be 3 stages that a bottle should pass through, Inserting the bottle
(I), Filling water in the bottle(F), and Sealing the bottle(S).
Let us consider these stages as stage 1, stage 2, and stage 3 respectively. Let each stage take 1
minute to complete its operation. Now, in a non-pipelined operation, a bottle is first inserted in the
plant, after 1 minute it is moved to stage 2 where water is filled. Now, in stage 1 nothing is
happening. Similarly, when the bottle moves to stage 3, both stage 1 and stage 2 are idle. But in
pipelined operation, when the bottle is in stage 2, another bottle can be loaded at stage 1.
Similarly, when the bottle is in stage 3, there can be one bottle each in stage 1 and stage 2. So,
after each minute, we get a new bottle at the end of stage 3. Hence, the average time taken to
manufacture 1 bottle is:

 Without pipelining = 9/3 minutes = 3m


IFS||||||
|||IFS|||
| | | | | | I F S (9 minutes)

 With pipelining = 5/3 minutes = 1.67m


IFS||
|IFS|
| | I F S (5 minutes)

Thus, pipelined operation increases the efficiency of the CPU.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 HARDWIRE AND MICRO PROGRAMMED CONTROL (TABULAR FORMAT)

Hardwired Control Unit: The control hardware can be viewed as a state machine that changes from
one state to another in every clock cycle, depending on the contents of the instruction register, the
condition codes, and the external inputs. The outputs of the state machine are the control signals. The
sequence of the operation carried out by this machine is determined by the wiring of the logic
elements and hence named “hardwired”.
 Fixed logic circuits that correspond directly to the Boolean expressions are used to generate the
control signals.
 Hardwired control is faster than micro-programmed control.
 A controller that uses this approach can operate at high speed.
 RISC architecture is based on the hardwired control unit

Micro-programmed Control Unit –


 The control signals associated with operations are stored in special memory units
inaccessible by the programmer as Control Words.
 Control signals are generated by a program that is similar to machine language programs.
 The micro-programmed control unit is slower in speed because of the time it takes to fetch
microinstructions from the control memory.

Some Important Terms


1. Control Word: A control word is a word whose individual bits represent various control
signals.
2. Micro-routine: A sequence of control words corresponding to the control sequence of a
machine instruction constitutes the micro-routine for that instruction.
3. Micro-instruction: Individual control words in this micro-routine are referred to as
microinstructions.
4. Micro-program: A sequence of micro-instructions is called a micro-program, which is
stored in a ROM or RAM called a Control Memory (CM).
5. Control Store: the micro-routines for all instructions in the instruction set of a computer
are stored in a special memory called the Control Store.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

The differences between hardwired and micro-programmed control units:

Micro-programmed Control Unit


Hardwired Control Unit

Fixed set of logic gates and Microcode stored in memory


Implementation
circuits

Less flexible, difficult to More flexible, easier to modify


Flexibility
modify

Supports limited instruction Supports complex instruction sets


Instruction Set
sets

Complex design, more difficult to


Simple design, easy to
Complexity of Design implement
implement

Slower operation due to microcode


Speed Fast operation decoding

Easier to debug and test


Debugging and Testing Difficult to debug and test

Larger size, higher cost


Size and Cost Smaller size, lower cost

Maintenance and Difficult to upgrade and Easier to upgrade and maintain


Upgradability maintain

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 CONCEPT OF HORIZONTAL AND VERTICAL MICROPROGRAMMING.

Types of Micro-programmed Control Unit – Based on the type of Control Word stored in the
Control Memory (CM), it is classified into two types:

1. Horizontal Micro-programmed Control Unit:


The control signals are represented in the decoded binary format that is 1 bit/CS. Example: If 53
Control signals are present in the processor then 53 bits are required. More than 1 control signal can
be enabled at a time.
 It supports longer control words.
 It is used in parallel processing applications.
 It allows a higher degree of parallelism. If degree is n, n CS is enabled at a time.
 It requires no additional hardware (decoders). It means it is faster than Vertical
Microprogrammed.
 It is more flexible than vertical Micro programmed

2. Vertical Micro-programmed Control Unit:


The control signals are represented in the encoded binary format. For N control signals- Log2(N) bits
are required.
 It supports shorter control words.
 It supports easy implementation of new control signals therefore it is more flexible.
 It allows a low degree of parallelism i.e., the degree of parallelism is either 0 or 1.
 Requires additional hardware (decoders) to generate control signals, it implies it is slower than
horizontal micro programmed.
 It is less flexible than horizontal but more flexible than that of a hardwired control unit.

In the Horizontal micro-programmed control unit, the control signals are represented in the decoded
binary format, i.e., 1 bit/CS. Here „n‟ control signals require n bit encoding. On the other hand

In a Vertical micro-programmed control unit, the control signals are represented in the encoded
binary format. Here „n‟ control signals require log2n bit encoding.

Difference between Horizontal and Vertical micro-programmed Control Unit:

S.
No Horizontal µ-programmed CU Vertical µ-programmed CU

1. It supports longer control word. It supports shorter control word.

It allows a higher degree of parallelism.


It allows a low degree of parallelism i.e., the degree
If degree is n, then n Control Signals are
of parallelism is either 0 or 1.
2. enabled at a time.

Additional hardware in the form of decoders is


No additional hardware is required.
3. required to generate control signals.

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

S.
No Horizontal µ-programmed CU Vertical µ-programmed CU

It is faster than a Vertical micro- it is slower than a Horizontal micro-programmed


4. programmed control unit. control unit.

It is more flexible than a vertical micro- It is less flexible than horizontal but more flexible
5. programmed control unit. than that of a hardwired control unit.

A horizontal micro-programmed control A vertical micro-programmed control unit uses


unit uses horizontal micro-instruction, vertical micro-instruction, where a code is used for
where every bit in the control field each action to be performed and the decoder
6. attaches to a control line. translates this code into individual control signals.

The horizontal micro-programmed


The vertical micro-programmed control unit makes
control unit makes less use of ROM
more use of ROM encoding to reduce the length of
encoding than the vertical micro-
the control word.
7. programmed control unit.

Example: Consider a hypothetical Control Unit that supports 4 k words. The Hardware contains 64
control signals and 16 Flags. What is the size of control word used in bits and control memory in a
byte using:
a) Horizontal Programming
b) Vertical programming
Solution:

a) For Horizontal
64 bits for 64 signals % 16 bits for flags
Control Word Size = 64 + 16 = 80 bits
Control Memory = 4 kW = ( (4* 80) / 8 ) = 40 kByte

b) For Vertical
6 bits for 64 signals i.e log264
4 bits for 16 flags i.e log216
12 bits for 4K words i.e log2(4*1024)
Control Word Size = 4 + 6 + 12 = 22 bits
Control Memory = 4 kW = ( (4* 22) / 8 ) = 11 kByte

Notes By Prof. Tanya Shrivastava


Notes By Prof. Tanya Shrivastava

 MICRO PROGRAMME SEQUENCING

A microprogram sequencer generates the address of the next microinstruction to be executed.

The address is used by a microprogram sequencer to decide which microinstruction has to be


performed next. Microprogram sequencing is the name of the total procedure. The addresses needed
to step through a control store‟s microprogram are created by a sequencer, also known as a
microsequencer.

Micro Instructions Sequencer


Micro Instructions Sequencer is a combination of all hardware for selecting the next micro-instruction
address. The micro-instruction in control memory contains a set of bits to initiate micro-operations in
computer registers and other bits to specify the method by which the address is obtained.

Implementation of Micro Instructions Sequencer

 Control Address Register (CAR): Control address register receives the address from four
different paths. For receiving the addresses from four different paths, Multiplexer is used.
 Multiplexer: Multiplexer is a combinational circuit which contains many data inputs and single
data output depending on control or select inputs.
 Branching: Branching is achieved by specifying the branch address in one of the fields of the
micro instruction. Conditional branching is obtained by using part of the micro-instruction to
select a specific status bit in order to determine its condition.
 Mapping Logic: An external address is transferred into control memory via a mapping logic
circuit.
 Incrementer: Incrementer increments the content of the control address register by one, to select
the next micro-instruction in sequence.
 Subroutine Register (SBR): The return address for a subroutine is stored in a special register
called Subroutine Register whose value is then used when the micro-program wishes to return
from the subroutine.
 Control Memory: Control memory is a type of memory which contains addressable storage
registers. Data is temporarily stored in control memory. Control memory can be accessed quicker
than main memory.

Notes By Prof. Tanya Shrivastava

You might also like