First Year CH 3
First Year CH 3
First Year CH 3
The Central Processing Unit (CPU) is the main part of the computer, which
performs all its activities. It is also called the processor or microprocessor and
is truly the “brain" of the computer system. It combines the circuitry that
generates all the control signals needed to execute instructions.
COMPONENTS OF CPU
● ALU
● CU
● Registers
● Cache
● Internal Buses
Arithmetic logic unit (ALU) is the part of the CPU where the actual processing takes place. ALU is capable
of performing arithmetic, logical and data manipulation operations on data.
The ALU consists of logic circuitry that performs operations such as addition, subtraction, multiplication,
division, exponentials, data manipulations, comparison and logical operations such as AND, OR and NOT.
Suppose we want to add two numbers 30 and 45. The ALU will perform the following steps to do this
addition.
Control unit directs and coordinates the activities of the entire computer system. It controls the working
of all the input/output devices, all the primary and secondary storage devices and the calculations
performed by the ALU. Control unit controls the operations of computer system based on the
instructions in the program by executing them in a proper order.
Instruction Register
Data Bus
Instruction Decoder
Control Bus
Control Unit consists of three main components Instruction Register, Instruction Decoder and Timing &
Control Logic.
Instruction Register Stores the instruction while it is being executed. Instruction decoder decodes
(translates) it and timing & Control logic generates the signals to execute it.
Cache Memory:
Microprocessor
Data Bus
Internal Buses
A bus is a group of parallel wires used for transmitting data/information from one part of the computer
to another In other words; it provides a pathway for transmitting data/information among various
components of a computer. The buses that are found inside the CPU are known as internal buses. There
are three types of buses inside the microprocessor, which are address bus, data bus and control bus.
REGISTERS
Registers are used to quickly accept, store, and transfer data and instructions that are being used
immediately by the CPU. Registers used in the computer are divided into two types. General purpose
registers and special purpose registers.
General-purpose registers are used to store data as well as addresses. These registers are used for
arithmetic data movement. Typically, these are 8 to 32 bit registers. Following are the commonly used
general-purpose registers.
The Accumulator is used to temporarily store data whilst calculations are being performed within
the Arithmetic Logic Unit (ALU)
A data register is used in microcomputers to temporarily store data that is in the process of being
transferred from the memory to the central processor, or vice versa.
It contains the address (location) of the instruction being executed at the current time. As each
instruction is fetched, the counter register increases its stored value by 1. After each instruction is
fetched, it points to the next instruction in the sequence.
These registers hold the state of a program. They include program counter. instruction register, memory
address register and memory buffer registers. These are used by Control Unit to control the operations
of CPU.
Instruction register holds program instructions that are fetched from the memory for execution.
It holds the instruction while the instruction decoder circuit decodes it.
Memory address register hold the address of memory location from where a memory word is to
be fetched or where data is to be stored.
MBR stores the data being transferred to and from the immediate access store. It contains the
copy of designated memory locations specified by the memory address register.
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.
Buses:
A bus is an electrical pathway inside the computer system over which data/information is transferred
from one part to the other. It connects CPU to the main memory on the motherboard. There are three
types of buses i.e. Address Bus, Data Bus and Control Bus.
Address Bus: It is a group of wires or lines that are used to transfer the addresses of Memory or
I/O devices. The address bus is unidirectional between the main memory and the processor.
Transfer of memory location
Main Memory Processor
Address Bus
Transfer of data
Main Memory Processor
Data Bus
Control Bus: Microprocessor uses control bus to process data that is what to do with the selected
memory location. Some control signals are Read, Write and Opcode fetch etc.
Input / Output
System Buses
System Buses
INSTRUCTIONS:
An instruction (or instruction code) is a group of bits that tells the computer to perform a
specific operation. Instructions are stored in the main memory, waiting to be processed by the
processor. An instruction has two fields:
These instructions transfer data from one location to another location in the computer without
changing the data content. The most common transfers are between
● Registers to Registers.
These instructions are related to the arithmetic and logic operations. The arithmetic or logic
operations are performed on the values of two registers and the result is also placed in a register.
Data manipulation instructions can be divided into three basic types, i.e. Arithmetic, logical and
Shift instructions.
Program control or transfer of control is a way of altering the order in which statements are
executed. There are a number of instructions used for this purpose like JMP (Jump) and LOOP
etc.
INSTRUCTION FORMATS:
Instruction format defines the layout of the instruction. It consists of two parts, an Op-Code (Operation
Code) and Operand.
● Op-Code
● Operand
Op-Code: is a group of bits that define various processor operations such as LOAD, STORE, ADD and
SHIFT
Example:
10010 0101000101110101
The Op-code (10010) specifies the code for ADD operation to be performed on the operand at the
address specified in Operand part. Some of the common instruction formats are
● Zero-Address Instruction
● One-Address Instruction
● Two-Address Instruction
The Zero address instruction format requires only op-code, having no operand to work with. Example of
zero Address Instruction format is HALT, STOP. which do not have any address.
Op-Code
One Address instruction format requires one op-code and one Operand. Example of the one address
instruction format is LDA (Load Accumulator), JMP (Jump) etc. These instructions require one address to
do the operation.
Op-Code Operand
Two Address instruction format requires one op-code and two Operand. Example of the two-address
instruction format is MOV (Move), which moves data from the memory location to the register and from
the register to the memory location. E.g. ADD A, B etc.
INSTRUCTION CYCLE
Instruction cycle is the basic operation cycle of a computer to execute various instructions. A computer
retrieves an instruction from its memory, determines what actions the instruction requires, and carries
out those actions by the process.
FETCH
Instruction
EXECUTE DECODE
Instruction Instruction
Following are the three main instruction cycle steps.
● Fetch operations
● Decode operation
● Execute operation
Fetch Operation
In this operation, the control unit fetches an instruction from main memory by sending an address
through address bus and a read command through the control bus. The fetch operation places the
instruction into the instruction register (IR) inside the microprocessor.
Decode Operation
In this step the instruction decoder decodes the instruction to determine what the instruction is
intended to do.
Execute Operation
Once the instruction has been decoded. it is to be executed. In this operation, the timing and control
logic circuitry in the control unit generates signals needed to execute the instruction
CISC stands for Complex instruction Set Computer. It is traditional architecture of CPU that supports a
large variety of instructions. CISC architecture is complex because of the instructions used at the
hardware level. Examples of CISC processors are the Intel 486 series and Pentium series.
RISC stands for Reduced Instruction Set Computer. It is considered as a new architecture of CPUs. RISC
architecture of CPU supports same size of instructions and it does not use indirect addressing mode. The
instructions of a CPU that uses RISC architecture are very simple and are executed very fast. Examples of
RISC processor are, IBM PowerPC. Sun SPARC, mobiles phones and tablet PCs.
The following are few differences between CISC and RISC architectures.
● CISC implementations tend to be slower than RISC implementations. Computers typically use
CISC while tablets, smartphones and other devices use RISC.
Intel Pentium IV processors have 20 steps execution process. They have high clock speed and perform
fewer operations per clock. Pentium processors generally use 478 pin sockets and use Mega Hertz (MHz)
to specify processor speed.
AMD Processor
AMD processors have 10 steps execution process. These processors generally use 462 Pin sockets. AMD
processors do not use Mega Hertz (MHz) to specify processor speed.
iii. Which Of these buses selects a memory word for a read or write Operation?
iv. Which of these registers controls the sequence in which instructions are fetched from memory
for execution?
ix. How many distinct operations can be performed if op-code of a microprocessor of 4 bits?
A. 4 B. 8 C. 16 D. 32