0% found this document useful (0 votes)
28 views21 pages

Coa Unit-1

This document provides information about computer organization and architecture. It discusses the internal workings and structure of a computer system. The topics covered include input/output devices, the CPU, memory, buses, registers, and control words. Computer organization defines how the components of a system are structured to allow proper use of the tools. The tutorial is designed for beginners and professionals to learn about computer architecture and organization.

Uploaded by

singhshiva8082
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)
28 views21 pages

Coa Unit-1

This document provides information about computer organization and architecture. It discusses the internal workings and structure of a computer system. The topics covered include input/output devices, the CPU, memory, buses, registers, and control words. Computer organization defines how the components of a system are structured to allow proper use of the tools. The tutorial is designed for beginners and professionals to learn about computer architecture and organization.

Uploaded by

singhshiva8082
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/ 21

Computer Organization and Architecture Tutorial

Computer Organization and Architecture Tutorial provides in-depth knowledge of internal


working, structuring, and implementation of a computer system.

Whereas, Organization defines the way the system is structured so that all those catalogued tools
can be used properly.

Our Computer Organization and Architecture Tutorial includes all topics of such as introduction,
ER model, keys, relational model, join operation, SQL, functional dependency, transaction,
concurrency control, etc.

What is Computer Architecture and Organization?


In general terms, the architecture of a computer system can be considered as a catalogue of tools
or attributes that are visible to the user such as instruction sets, number of bits used for data,
addressing techniques, etc.Play Video

Whereas, Organization of a computer system defines the way system is structured so that all
those catalogued tools can be used. The significant components of Computer organization are
ALU, CPU, memory and memory organization.

Prerequisite
Before learning the concepts of Computer Architecture and Organization, you should have a
basic knowledge prior to Computer Architecture, basic functional units of a computer system,
etc.

Audience
Our COA tutorial is designed to help beginners and professionals.

Problem
We can assure you that you will not find any problem in this tutorial. However, if you find any,
you can post the questions in the contact form

What is the computer structure?


Computer structure is the way that each component is arranged so that communication is
possible.
The structure of a computer is simple, and that can be represented in below diagram −
Parts of Computer
The computer structure in general, divided into five main parts, which are as follows −
 Input devices
 Output devices
 I / O Ports
 CPU and
 Memory
Let us discuss each component in detail.

Input Device
An input device is a computer hardware which handles input receiving from outside the system.
The main function of the input device is to enter data or give commands by the user into the
system.
For example, the input devices are keyboards, mouse, joysticks, scanners, touchpad and many
more.
Output devices
Output devices are computer hardware devices which handle output activities. The function of
the output device is to display the results of data processing, as soft copy, hard copy, voice, or
video.
For example, the output devices are monitors, printers, speakers, projectors and so on.
Given below in the figure are the output devices −
I/O Ports
I / O Ports are called connectors which are under the control of the processor helpful in handling
input and output activities. Or in other words, this port is used to connect any device that comes
from outside the computer, like a printer, scanner, mouse, or USB. In a computer system this
port is present on the back of the CPU while on the laptop the ports are located on the right and
left side.
CPU
The Central Processing unit is computer hardware called the brain of the computer system.
Because, the performance of a computer is determined by the technology and quality of the CPU
used.
Generally, there are three types of components in the CPU, which are given below −
 Control unit
 Register
 ALU (Arithmetic Logic Unit)
The control unit controls and regulates the course of the program. The register is used to serve
as a temporary storage area for data that is being processed to continue to the next processing.
ALU performs all arithmetic and logic operations based on the instructions given.
Given below in the figure is the structure of CPU −
Memory
It is a device that functions as a storage medium in a computer system.
There are two types of memory which are characterized as follows −
 Volatile called as temporary storage where data is lost when the computer is turned off,
and
 Non-volatile storage is called permanent storage where data is stored even if the computer
is not turned on.
Based on the location, the memory is divided into two parts, namely internal and external
memory. This internal memory is the main memory in a computer system, such as RAM
(Random Access Memory) and ROM (Read Only Memory).
External memory is secondary memory like hard disk, USB drive, etc.
Given below in the figure are the access times and capacities of the memory −

Control Bus
Control bus is part of a computer system which is helpful to control the use of access to data
buses and bus addresses.
In principle, the data channel and address channel are used simultaneously by all components,
so that a control bus is needed to control their use. This control bus is equipped with command
signals that specify the operations to be performed.

Address Bus
The address bus relates to the source or destination address on the data bus. It is used to select a
memory location or port to perform write and read operations.
So that all devices connected to the computer system must have an address to be accessed. For
example, the CPU will read a word from memory, and then the CPU will put the data address on
the address channel.

Data Bus
It is part of a computer system which is the path for the movement of data contained in the
computer system module. The data is transferred from the input device to the CPU or from the
CPU to memory or from memory to the output device.
The bus width determines the amount of data that can be transferred at one time. Generally, the
data bus consists of 8, 16, 32, 64 or more parallel lines.
What is General Register Organization?
A set of flip-flops forms a register. A register is a unique high-speed storage area in the CPU.
They include combinational circuits that implement data processing. The information is always
defined in a register before processing. The registers speed up the implementation of programs.
Registers implement two important functions in the CPU operation are as follows −

 It can support a temporary storage location for data. This supports the directly implementing
programs to have fast access to the data if required.
 It can save the status of the CPU and data about the directly implementing program.
Example − Address of the next program instruction, signals get from the external devices and
error messages, and including different data is saved in the registers.
If a CPU includes some registers, therefore a common bus can link these registers. A general
organization of seven CPU registers is displayed in the figure.
The CPU bus system is managed by the control unit. The control unit explicit the data flow
through the ALU by choosing the function of the ALU and components of the system.
Consider R1 ← R2 + R3, the following are the functions implemented within the CPU −
MUX A Selector (SELA) − It can place R2 into bus A.
MUX B Selector (SELB) − It can place R3 into bus B.
ALU Operation Selector (OPR) − It can select the arithmetic addition (ADD).
Decoder Destination Selector (SELD) − It can transfers the result into R1.
The multiplexers of 3-state gates are performed with the buses. The state of 14 binary selection
inputs determines the control word. The 14-bit control word defines a micro-operation.

Register Memory
Register memory is the smallest and fastest memory in a computer. It is not a part of the main
memory and is located in the CPU in the form of registers, which are the smallest data holding
elements. A register temporarily holds frequently used data, instructions, and memory address
that are to be used by CPU. They hold instructions that are currently processed by the CPU. All
data is required to pass through registers before it can be processed. So, they are used by CPU to
process the data entered by the users.

Registers hold a small amount of data around 32 bits to 64 bits. The speed of a CPU depends on
the number and size (no. of bits) of registers that are built into the CPU. Registers can be of
different types based on their uses. Some of the widely used Registers include Accumulator or
AC, Data Register or DR, the Address Register or AR, Program Counter (PC), I/O Address
Register, and more.

Types and Functions of Computer Registers:


o Data Register: It is a 16-bit register, which is used to store operands (variables) to be operated by
the processor. It temporarily stores data, which is being transmitted to or received from a
peripheral device.
o Program Counter (PC): It holds the address of the memory location of the next instruction,
which is to be fetched after the current instruction is completed. So, it is used to maintain the path
of execution of the different programs and thus executes the programs one by one, when the
previous instruction gets completed.
o Instructor Register: It is a 16-bit register. It stores the instruction which is fetched from the
main memory. So, it is used to hold instruction codes, which are to be executed. The Control Unit
takes instruction from Instructor Register, then decodes and executes it.
o Accumulator Register: It is a 16-bit register, which is used to store the results produced by the
system. For example, the results generated by CPU after the processing are stored in the AC
register.
o Address Register: It is a 12-bit register that stores the address of a memory location where
instructions or data is stored in the memory.
o I/O Address Register: Its job is to specify the address of a particular I/O device.
o I/O Buffer Register: Its job is to exchange the data between an I/O module and the CPU

What is control word? Give the structure of a control word.


Control word is defined as a word whose individual bits represent the various control signal. The
control words related to an instruction that is stored in microprogram memory. It is a set of
micro-instructions in a micro-routine.

 In control words, microoperations are specified, they are known as microinstructions.


 Each microinstruction specifies one or more microoperations that are performed.
 The Control Word consists of bits, and each bit corresponds to a function or commands
such as Pause, Stop, Enable, Start, Stop, Move, Jog, etc.

What is Stack Organization?


Stack is also known as the Last In First Out (LIFO) list. It is the most important feature in the
CPU. It saves data such that the element stored last is retrieved first. A stack is a memory unit
with an address register. This register influence the address for the stack, which is known as
Stack Pointer (SP). The stack pointer continually influences the address of the element that is
located at the top of the stack.
It can insert an element into or delete an element from the stack. The insertion operation is
known as push operation and the deletion operation is known as pop operation. In a computer
stack, these operations are simulated by incrementing or decrementing the SP register.

Register Stack
The stack can be arranged as a set of memory words or registers. Consider a 64-word register
stack arranged as displayed in the figure. The stack pointer register includes a binary number,
which is the address of the element present at the top of the stack. The three-element A, B, and
C are located in the stack.
The element C is at the top of the stack and the stack pointer holds the address of C that is 3.
The top element is popped from the stack through reading memory word at address 3 and
decrementing the stack pointer by 1. Then, B is at the top of the stack and the SP holds the
address of B that is 2. It can insert a new word, the stack is pushed by incrementing the stack
pointer by 1 and inserting a word in that incremented location.
The stack pointer includes 6 bits, because 26 = 64, and the SP cannot exceed 63 (111111 in
binary). After all, if 63 is incremented by 1, therefore the result is 0(111111 + 1 = 1000000). SP
holds only the six least significant bits. If 000000 is decremented by 1 thus the result is 111111.
Therefore, when the stack is full, the one-bit register „FULL‟ is set to 1. If the stack is null, then
the one-bit register „EMTY‟ is set to 1. The data register DR holds the binary information which
is composed into or readout of the stack.
First, the SP is set to 0, EMTY is set to 1, and FULL is set to 0. Now, as the stack is not full
(FULL = 0), a new element is inserted using the push operation.
The push operation is executed as follows −

SP←SP + 1 It can increment stack pointer

K[SP] ← DR It can write element on top of the stack

If (SP = 0) then (FULL ← 1) Check if stack is full

EMTY ← 0 Mark the stack not empty


The stack pointer is incremented by 1 and the address of the next higher word is saved in the SP.
The word from DR is inserted into the stack using the memory write operation. The first element
is saved at address 1 and the final element is saved at address 0. If the stack pointer is at 0, then
the stack is full and „FULL‟ is set to 1. This is the condition when the SP was in location 63 and
after incrementing SP, the final element is saved at address 0. During an element is saved at
address 0, there are no more empty registers in the stack. The stack is full and the „EMTY‟ is set
to 0.
A new element is deleted from the stack if the stack is not empty (if EMTY = 0). The pop
operation includes the following sequence of micro-operations −

DR←K[SP] It can read an element from the top of the stack


SP ← SP – 1 It can decrement the stack pointer

If (SP = 0) then (EMTY ← 1) Check if stack is empty

FULL ← 0 Mark the stack not full


The top element from the stack is read and transfer to DR and thus the stack pointer is
decremented. If the stack pointer reaches 0, then the stack is empty and „EMTY‟ is set to 1. This
is the condition when the element in location 1 is read out and the SP is decremented by 1.
Format Of Instruction

The set of instructions that manages the operation codes is called the format of instruction. The design of bits
in instruction is supported by the format of instruction. The length of instruction is generally preserved in
multiples of character, which is 8bits. The instruction format determines the behaviour and complexity of
instruction. Depending upon the number of addresses, the format of instruction is of variable length.

Types of instruction format include:

 Zero(0) Address Instruction format


 One(1) Address Instruction format
 Two(2) Address Instruction format
 Three(3) Address Instruction format

Types Of Instruction Format

Types of instruction formats are :

1. Zero(0) Address Instruction format

 The instruction format in which there is no address field is called zero address instruction

 In zero address instruction format, stacks are used


 In zero order instruction format, there is no operand

2. One(1) Address Instruction format

 The instruction format in which the instruction uses only one address field is called the one address instruction
format
 In this type of instruction format, one operand is in the accumulator and the other is in the memory location
 It has only one operand
 It has two special instructions LOAD and STORE

3. Two(2) Address Instruction format


 The instruction format in which the instruction uses only two address fields is called the two address
instruction format
 This type of instruction format is the most commonly used instruction format
 As in one address instruction format, the result is stored in the accumulator only, but in two addresses
instruction format the result can be stored in different locations
 This type of instruction format has two operands
 It requires shorter assembly language instructions

4. Three(3) Address Instruction format

 The instruction format in which the instruction uses the three address fields is called the three address
instruction format
 It has three operands
 It requires shorter assembly language instructions
 It requires more bits

Example Of format Of Instruction


1. Zero Address Instruction examples

 Assembly language instruction – PUSH A, PUSH B etc.


 Stack transfer operation – TOS <- A, TOS <- B etc.

2. One Address Instruction examples

 Assembly language instruction – LOAD C, ADD B, STORE T etc.


 Operation Register instruction – AC <- M[T], AC <- M[C] etc.

3. Two Address Instruction examples

 Assembly language instruction – MOV R1, A; ADD R1, B etc.


 Operation Register instruction – R1 <- M[A], R2 <- M[C] etc.

4. Three Address Instruction examples

 Assembly language instruction – ADD R1, A, B etc.

 Operation Register instruction – R1 <- M[A] + M[B] etc.

Parts Of Instruction Format

The parts of the instruction format are:


1. Addressing Mode

 The data is represented in the instruction format with the help of addressing mode
 The addressing mode is the first part of the instruction format
 The data can either be stored in the memory of a computer or it can be located in the register of the CPU

2. Operation Code( OPCODE)

 The operation code gives instructions to the processor to perform the specific Operation
 The operation code is the second part of the instruction format

3. OPERAND

 It is the part of the instruction format that specifies the data or the address of the data
 Depending upon the processor of the computer the instruction format contains zero to three operands

Conclusion

A standard machine which can be directly decoded and executed by the CPU is called instruction format. It is a
sequence of bits in a machine instruction that defines the layout of the instruction. The format of instruction
provides specific information to the CPU regarding the information to be performed. The parts of the format of
instruction are addressing mode, operation code and operand. The characteristic of a good format of instruction
is that all the components of instruction should be present. The group of Instructions is called the instruction
set.

Arithmetic Logic Unit (ALU)


Inside a computer, there is an Arithmetic Logic Unit (ALU), which is capable of performing
logical operations (e.g. AND, OR, Ex-OR, Invert etc.) in addition to the arithmetic operations
(e.g. Addition, Subtraction etc.). The control unit supplies the data required by the ALU from
memory, or from input devices, and directs the ALU to perform a specific operation based on
the instruction fetched from the memory. ALU is the “calculator” portion of the computer.
An arithmetic logic unit(ALU) is a major component of the central processing unit of the a
computer system. It does all processes related to arithmetic and logic operations that need to be
done on instruction words. In some microprocessor architectures, the ALU is divided into the
arithmetic unit (AU) and the logic unit (LU).
An ALU can be designed by engineers to calculate many different operations. When the
operations become more and more complex, then the ALU will also become more and more
expensive and also takes up more space in the CPU and dissipates more heat. That is why
engineers make the ALU powerful enough to ensure that the CPU is also powerful and fast, but
not so complex as to become prohibitive in terms of cost and other disadvantages.
ALU is also known as an Integer Unit (IU). The arithmetic logic unit is that part of the CPU that
handles all the calculations the CPU may need. Most of these operations are logical in nature.
Depending on how the ALU is designed, it can make the CPU more powerful, but it also
consumes more energy and creates more heat. Therefore, there must be a balance between how
powerful and complex the ALU is and how expensive the whole unit becomes. This is why
faster CPUs are more expensive, consume more power and dissipate more heat.
Different operation as carried out by ALU can be categorized as follows –
 logical operations − These include operations like AND, OR, NOT, XOR, NOR, NAND,
etc.
 Bit-Shifting Operations − This pertains to shifting the positions of the bits by a certain
number of places either towards the right or left, which is considered a multiplication or
division operations.
 Arithmetic operations − This refers to bit addition and subtraction. Although
multiplication and division are sometimes used, these operations are more expensive to
make. Multiplication and subtraction can also be done by repetitive additions and
subtractions respectively.

What Does Program Counter (PC) Mean?

A program counter (PC) is a CPU register in the computer processor which has the address of the
next instruction to be executed from memory. It is a digital counter needed for faster execution
of tasks as well as for tracking the current execution point.

A program counter is also known as an instruction counter, instruction pointer, instruction


address register or sequence control register.

Techopedia Explains Program Counter (PC)

All instructions as well as data in memory have a specific address. As each instruction is
processed, the software application responsible updates the program counter with the upcoming
instructions' address which needs to be fetched. The program counter in turn passes this
information to the memory address register as part of the execution cycle/standard fetch. The
program counter increases the stored value by one as the next instruction is fetched. If the
computer is reset or restarts, the program counter usually reverts to the value of zero.
Similar to other process registers of the computer, the program counter is like a bank of binary
latches, with each representing one bit of value. The program counter works in combination with
other registers to identify the current instruction. It can be modified or accessed with the help of
access or jump instructions. The PC can be accessed/modified by jump and branch instructions.
Therefore, the destination address can be loaded to the program counter via branch instructions.
The program counter can also be loaded with the address using the data processing instructions.

What are the types of Addressing Modes?


The operands of the instructions can be located either in the main memory or in the CPU
registers. If the operand is placed in the main memory, then the instruction provides the location
address in the operand field. Many methods are followed to specify the operand address. The
different methods/modes for specifying the operand address in the instructions are known as
addressing modes.

Types of Addressing Modes

There are various types of Addressing Modes which are as follows −

Implied Mode − In this mode, the operands are specified implicitly in the definition of the
instruction. For example, the instruction "complement accumulator" is an implied-mode
instruction because the operand in the accumulator register is implied in the definition of the
instruction. All register reference instructions that use an accumulator are implied-mode
instructions.

Instruction format with mode field

Opcode Mode Address

Immediate Mode − In this mode, the operand is specified in the instruction itself. In other
words, an immediate-mode instruction has an operand field instead of an address field. The
operand field includes the actual operand to be used in conjunction with the operation
determined in the instruction. Immediate-mode instructions are beneficial for initializing
registers to a constant value.

Register Mode − In this mode, the operands are in registers that reside within the CPU. The
specific register is selected from a register field in the instruction. A k-bit field can determine
any one of the 2k registers.

Register Indirect Mode − In this mode, the instruction defines a register in the CPU whose
contents provide the address of the operand in memory. In other words, the selected register
includes the address of the operand rather than the operand itself.
A reference to the register is then equivalent to specifying a memory address. The advantage of a
register indirect mode instruction is that the address field of the instruction uses fewer bits to
select a register than would have been required to specify a memory address directly.

Autoincrement or Autodecrement Mode &minuend; This is similar to the register indirect


mode except that the register is incremented or decremented after (or before) its value is used to
access memory. When the address stored in the register defines a table of data in memory, it is
necessary to increment or decrement the register after every access to the table. This can be
obtained by using the increment or decrement instruction.

Direct Address Mode − In this mode, the effective address is equal to the address part of the
instruction. The operand resides in memory and its address is given directly by the address field
of the instruction. In a branch-type instruction, the address field specifies the actual branch
address.

Indirect Address Mode − In this mode, the address field of the instruction gives the address
where the effective address is stored in memory. Control fetches the instruction from memory
and uses its address part to access memory again to read the effective address.

Indexed Addressing Mode − In this mode, the content of an index register is added to the
address part of the instruction to obtain the effective address. The index register is a special CPU
register that contains an index value. The address field of the instruction defines the beginning
address of a data array in memory.

Nano programming in Micro Instruction Format


Micro instruction format :
The control field of the micro-instruction decides the control signals to be produced. It is of two
different formats Horizontal or Vertical. Let’s discuss it one by one.
Type-1 :
Horizontal micro-instruction :
Here, we will discuss the horizontal micro-instruction format as follows.
 Every bit of the micro-instruction corresponds to a control signal.
 The bit which is 1, that corresponding control signal will be produced by the micro-
instruction. If there are N bits in micro-instruction then it can produce N control
signals by that micro-instruction.
 As the control signals increase, the micro-instruction grows wider. Therefore, the
control memory grows horizontally.
 Executes faster because no decoder is used.
 The control memory is large because the micro-instructions are wide.
Horizontal micro-instruction format

Type-2 :
Vertical micro-instruction :
Here, we will discuss the vertical micro-instruction format as follows.
 The bits of the micro-instruction are decoded.
 The decoded output decides the control signal to be produced.
 N bits in the micro-instruction will totally generate 2N control signals.
 But one control can be generated by one micro-instruction.
 More micro-instructions are needed.
 Also, the decoding makes the execution slower.
 The circuit is complex.
Vertical micro-instruction format

Need for nano programming :


 Horizontal micro-instructions can produce multiple control signals simultaneously but
are very wide. This makes the control memory very large.
 Vertical micro-instructions are narrow, but after decoding, only produce one control
signal. This makes the control memory small, but the execution is slow.
 Both methods have their own pros and cons.
 Hence, a combination of both techniques is needed to be called nano programming.
Nano programming :
1. Here we have a two-level control memory.
2. The instruction is fetched from the main memory into instruction register IR.
3. Using its opcode we load address of its first micro-instruction into µPC,
4. Using this address we fetch the micro-instruction from micro control memory (µCM)
into micro instruction register µIR.
5. This is in vertical form and decoded by a decoder.
6. The decoded output loads a new address in a nano program counter (nPC).
7. By using this address, the nano-instruction is fetched from nano-control memory
(nCM) into nano instruction register (nIR).
8. This is in horizontal form and can directly generate control signals which can be
multiple at a time.
9. Such a combination gives advantage of both techniques.
10. The size of the control Memory is small as micro-instructions are vertical.
Nano programming circuit.

Example –
 Suppose processors have 32 instructions (8 for arithmetic operations 8 for data
transfer operations, 8 for logical operations 8 for shift operation). Suppose we require
32 control signals total in which 8 are responsible for performing data transfer
operation, 8 for logical,8 for a shift, and 8 for arithmetic.
 If we implement it by horizontal micro-instruction, then the size of each micro-
instruction should be 32 bits. Most probably for data transfer operation we don‟t need
a control signal for the other 3 types of instruction so in the whole micro-instruction
the 27 bits for generating control signals for different 3 instruction types are 0
(garbage) which makes lots of memory space waste, also control memory size
increases.
 If we use nano programming, then micro-control memory has instructions for
identifying the type of the instruction by decoding i.e using vertical micro-instruction.
After identifying the type of instruction the nano control memory is responsible for
generating control signals for that particular instruction type that is identified
previously. So the advantage of that is every nano instruction size reduces to 8 bits
and every micro-instruction size reduces to 2 bits(for identifying 4 different types of
instruction and for 2×4 decoder) i.e advantage of vertical micro-instruction also we
can produce multiple control signal for a particular instruction type simultaneously
which is an advantage of horizontal instruction.
Disadvantage of Nano programming
Increased memory access time:- The main disadvantage of the two level memory
approaches is the loss of speed due to theextra memory access required for Nano control
memory.
https://www.ques10.com/p/19359/explain-the-types-of-microinstruction-formats/

What is Instruction Cycle in Computer Architecture?


A program consisting of the memory unit of the computer includes a series of
instructions. The program is implemented on the computer by going through a cycle for
each instruction.
In the basic computer, each instruction cycle includes the following procedures −

 It can fetch instruction from memory.


 It is used to decode the instruction.
 It can read the effective address from memory if the instruction has an indirect address.
 It can execute the instruction.
After the following four procedures are done, the control switches back to the first step
and repeats the similar process for the next instruction. Therefore, the cycle continues
until a Halt condition is met. The figure shows the phases contained in the instruction
cycle.

As display in the figure, the halt condition appears when the device receive turned off,
on the circumstance of unrecoverable errors, etc.

Fetch Cycle
The address instruction to be implemented is held at the program counter. The
processor fetches the instruction from the memory that is pointed by the PC.
Next, the PC is incremented to display the address of the next instruction. This
instruction is loaded onto the instruction register. The processor reads the instruction
and executes the important procedures.

Execute Cycle
The data transfer for implementation takes place in two methods are as follows −

 Processor-memory − The data sent from the processor to memory or from memory to
processor.
 Processor-Input/Output − The data can be transferred to or from a peripheral device by
the transfer between a processor and an I/O device.
In the execute cycle, the processor implements the important operations on the
information, and consistently the control calls for the modification in the sequence of
data implementation. These two methods associate and complete the execute cycle.
OR

The fetch-execute cycle

The basic operation of a computer is called the ‘fetch-execute’ cycle. The CPU is designed to
understand a set of instructions - the instruction set. It fetches the instructions from the
main memory and executes them. This is done repeatedly from when the computer is booted up
to when it is shut down.

1. The CPU fetches the instructions one at a time from the main memory into the registers. One
register is the program counter (pc). The pc holds the memory address of the next instruction to
be fetched from main memory.
2. The CPU decodes the instruction.
3. The CPU executes the instruction.
4. Repeat until there are no more instructions.
A single piece of program code might require several instructions. Look at this Python (3.x)
code:
area = length * width

First, the computer needs to load in the value of the variable length into the immediate access
store (registers). Next it needs to load in the value of the variable width. Then it needs to
multiply the two numbers together, and finally it needs to store the result in the variable area.

What is Microprogram Sequencing?


The microcode for the control memory should be generated by the inventor once the
configuration of the computer is settled. The generation of code is known as
microprogramming.
There are various points to be treated while designing the microprogram sequencer are

 Size of the microinstruction


 Time of address generation
The microinstruction’s size should be in the least, therefore that the control memory
necessary is less and the cost is decreased. Microinstructions can be implemented at a
quicker rate if the time to create an address is less. This results in raised throughput.

Disadvantage of Micro-program Sequencing


The disadvantage of microprogram sequencing is as follows −

 If each device instruction has an independent micro routine, therefore it results in the
help of huger areas for storage.
 The branching needed more time for implementation.

Computer Configuration
The block diagram of the computer is shown in the figure. It consists of two memory
units: the main memory for storing instructions and data, and a control memory for
storing the micro-program.
The processor unit includes four registers are Program Counter (PC), Address Register
(AR), Data Register (DR), and an Accumulator (AC). The control unit includes two
registers are Control Address Register (CAR) and a Subroutine Register (SBR).
Multiplexers are used to send data within the registers in the processor. AR can get
information from PC or DR. DR can get information from AC, PC, or memory. PC
receives information only from PC.
The information from AC and DR can have arithmetic and logic operations and be
located in the AC. The DR is the source of information for memory, where the
information that is read can go to DR and no other register.

You might also like