0% found this document useful (0 votes)
36 views9 pages

Unit-2 Cof

The document provides an overview of the instruction cycle, detailing its three main phases: Fetch, Decode, and Execute, along with their subcycles. It explains the steps involved in fetching a word from memory, differentiates between branch and call subroutine instructions, and describes hardwired and microprogrammed control units. Additionally, it outlines methods for designing hardwired control and highlights the advantages of microprogrammed control units.

Uploaded by

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

Unit-2 Cof

The document provides an overview of the instruction cycle, detailing its three main phases: Fetch, Decode, and Execute, along with their subcycles. It explains the steps involved in fetching a word from memory, differentiates between branch and call subroutine instructions, and describes hardwired and microprogrammed control units. Additionally, it outlines methods for designing hardwired control and highlights the advantages of microprogrammed control units.

Uploaded by

Ravikant Arya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Unit-2

Define instruction cycle and divide instruction cycle into sub cycles with the help of diagram,
explain the sequence in which sub cycles are [Link] Explain the different cycles of an
instruction [Link] Explain all the phases of instruction cycle.

Instruction Cycle Overview:

The instruction cycle is the process by which a computer retrieves a program instruction from
memory, interprets it, and executes the necessary actions. It consists of three main phases:
Fetch, Decode, and Execute.

Subcycles of the Instruction Cycle:

1. Fetch Cycle:

 Purpose: Retrieve the next instruction from memory.

 Steps:

1. Program Counter (PC) Placement: The address of the next instruction (opcode) is
placed on the address bus by the program counter.

2. Memory Access: CPU sends control signals to memory to read the opcode.

3. Data Transfer: Opcode is transferred from memory to CPU via the data bus.

2. Decode Cycle:

 Purpose: Interpret the opcode fetched from memory.

 Steps:

1. Transfer to Data Register (DR): Opcode is placed in the Data Register.

2. Transfer to Instruction Register (IR): Opcode moves to the Instruction Register.

3. Decoding: CPU’s decoder circuitry interprets the opcode to determine the


operation to be performed.
3. Execute Cycle:

 Purpose: Perform the operation specified by the instruction.

 Steps:

1. Perform Operation: If the instruction involves arithmetic or logic, the Arithmetic


Logic Unit (ALU) is used to execute the operation.

2. Update Registers: Any necessary updates to CPU registers or memory locations


are performed.

Sequence of Subcycles Execution:

1. Fetch Cycle: The CPU retrieves the opcode from memory using the address provided by
the program counter.

2. Decode Cycle: Once the opcode is fetched, it’s transferred to the Instruction Register
and decoded by the CPU’s decoder circuitry to determine the operation.

3. Execute Cycle: With the opcode decoded, the CPU performs the operation specified by
the instruction, utilizing the ALU if necessary, and updates any relevant registers.

Write the steps in fetching a word from


[Link] between a branch instruction and
call sub routine instruction.

Steps in fetching a word from memory are as follows :


Step 1 : The CPU has to perform opcode fetch cycle and operand fetch cycle.
Step 2 : The opcode fetch cycle gives the operation code of fetching a word from memory to the
CPU.
Step 3 : The CPU then invokes the operand fetch cycle.
Step 4 : The opcode specifies the address of memory location where the information is stored.
Step 5 : The CPU transfers the address of required word of information to the Address Register
(AR), which is connected to the address lines of the memory bus. Hence, the address is
transferred to the memory.
Step 6 : The CPU activates the read signal of the memory to indicate that a read operation is
needed.
Step 7 : As a result, memory copies data from the addressed register on the data bus.
Step 8 : The CPU then reads this data from the data register and loads it in the specified
register.
Step 9 : Memory Functions Completed (MFC) is also used as a control signal for this memory
transfer.
Step10 : Memory sets MFC to 1 to indicate that the contents of the specified location have been
read and are available on the data bus.

Difference :

Feature Branch Instruction Call Subroutine Instruction

Alters the sequence of program


Purpose Invokes a subroutine (a specific task) and returns to the next instruction
execution based on a condition

Changes program flow by


Functionality Transfers control to a subroutine and returns to the next instruction after completion
jumping to a different location

Conditional execution or loop


Usage Modularizing code for reuse and organization
control

May cause program to skip or


Effect on
repeat sections based on Temporarily diverts program flow to execute a specific task
Program Flow
condition

If-else statements, loops (e.g., for,


Example Calling a function or method
while)

Fetch a Word from Memory and Transfer

Objective •

Learn microoperations for fetch of a Word from Memory and transfer to IR or GPR or other
Word Storing Unit by sequences of microoperations •

Learn how a Word from processor transfer and store into Memory by sequences of
microoperations

Fetch operation

Execution of a fetch or store instruction by Data Path Implementation


Execution of a fetch or store instruction can be considered as the implementation of a specific
data path flow, as per the specific instruction

• The processing unit composition is as controlled data-path unit and control unit (controlling
and sequencing unit)

• Control unit generates control signals to implement each step using signals

Sequence of actions to define the controlled transfers of data between processing subunits •
Processing subunits─ registers, PC, IR, MAR, MDR along a required data path • Bus selected as
per one data path among several paths

Storing a word in memory

That is similar process with fetching a word from memory.

o The required address is loaded into the MAR

o After that data to be written are loaded into MDR, and a write command is issued.

o If we suppose that the data word to be stored in the memory is in R2 and that the
memory address is in R1, the Write operation needed the following sequence:

o MAR - [R1]

o MDR -[R2]

o Write

o Wait for the MFC

Move R2, (R1) requires the following sequence (signal):

R1out, MARin

R2out, MDRin. Write

MDRoutE,WMFC

Explain hardwired control unit. What are the methods to design hardwired controllers ? OR
What do you understand by hardwired control ? Give various methods to design hardwired
control unit. Describe any one method used for designing of hardwired control unit.

Hardwired Control:

1. Definition:
 Hardwired control is like a brain for a computer, designed as a sequential logic
circuit or finite state machine.

 It generates a series of control signals based on the instructions it receives.

2. Implementation:

 Uses gates, flip-flops, decoders, and other digital circuits for its control logic.

1. Modification:

 If you want to change the design, you have to physically alter the wiring among
components.

2. Signal Transformation:
 Transforms input logic signals into a set of output logic signals, known as control
signals.

3. Clock Cycle:

 Each step in the control sequence happens in one clock cycle.

4. Control Signals Determination:

 Uses information like the control step counter, instruction register, condition
code flags, and external input signals.

Methods for Designing Hardwired Control:

1. State Table (One-Hot) Method:

 Represents control states in a table.

 Each state is indicated by a single bit, simplifying the design.

2. Delay Element Method:

 Uses delay elements to sequence control steps.

3. Sequence-Counter Method:

 Utilizes a counter to keep track of control steps.

4. PLA Method (Programmable Logic Array):

PLA Method:

1. PLA Definition:

 A digital system device that consolidates complex logic circuits into a single chip.

 Replaces many smaller integration chips, reducing the overall complexity.

2. Implementation:

 Decision logic and decoder functions are housed in the PLA.

3. Advantages:

 Reduces the number of integrated circuits (ICs) and interconnection wires.

4. Role in Hardwired Control:

 PLA outputs dictate the next state of the sequence register in hardwired control.
What is Microprogrammed Control Unit

A control unit whose binary control values are saved as words in memory is called a
microprogrammed control unit.

A controller results in the instructions to be implemented by constructing a definite collection of


signals at each system clock beat. Each of these output signals generates one micro-operation
including register transfer. Thus, the sets of control signals are generated definite micro-
operations that can be saved in the memory.

Each bit that forms the microinstruction is linked to one control signal. When the bit is set, the
control signal is active. When it is cleared the control signal turns inactive. These
microinstructions in a sequence can be saved in the internal ’control’ memory. The control unit
of a microprogram-controlled computer is a computer inside a computer.

 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.
There are the following steps followed by the microprogrammed control are −

 It can execute any instruction. The CPU should divide it down into a set of sequential
operations. This set of operations are called microinstruction. The sequential micro-
operations need the control signals to execute.

 Control signals saved in the ROM are created to execute the instructions on the data
direction. These control signals can control the micro-operations concerned with a
microinstruction that is to be performed at any time step.

 The address of the microinstruction is executed next is generated.

 The previous 2 steps are copied until all the microinstructions associated with the
instruction in the set are executed.

Advantages of Microprogrammed Control Unit


There are the following advantages of microprogrammed control are as follows

 It can more systematic design of the control unit.
 It is simpler to debug and change.
 It can retain the underlying structure of the control function.
 It can make the design of the control unit much simpler. Hence, it is
inexpensive and less error-prone.
 It can orderly and systematic design process.
 It is used to control functions implemented in software and not hardware.
 It is more flexible.
 It is used to complex function is carried out easily.

You might also like