UNIT 3 Notes
UNIT 3 Notes
Chapter#3
Central Processing Unit (CPU)
The Central Processing Unit (CPU) is the integral part of any computer system, often referred to as the
brain of the computer. Like the human brain, it manages all operations and is connected to all
components of the computer. The CPU executes instructions, controls data storage, and manages
input/output activities for various devices.
1.1 Arithmetic and Logic Unit (ALU): The Arithmetic and Logic Unit (ALU) is the
main processing unit of the CPU. The Arithmetic and Logic Unit (ALU) is a critical component of the CPU
responsible for performing essential calculations and logical operations.
Arithmetic operations:It performs arithmetic operations such as addition, subtraction,
multiplication, and division.`
Comparisons: Evaluating relationships between values (e.g., greater than, less than, equal to).
Logical Operations: Performing operations such as AND, OR, NOT on binary data.
Data Processing: The ALU processes input data, executes operations, and returns results to be
stored in registers, which serve as temporary storage locations within the CPU.
Modern ALU Design: Many modern CPUs incorporate multiple ALUs to enhance processing
efficiency, enabling simultaneous calculations and improving overall performance.
1.2 Control Unit (CU):The Control Unit (CU) manages the operations of the CPU and
coordinates the functions of various components.
Execution Coordination:Directs the Arithmetic and Logic Unit (ALU) and other units to perform
the specified tasks.
1
Computer science, XI Ch#3: Central Processing Unit
Flow of Instructions and Data: The CU regulates the movement of instructions and data within
the CPU, ensuring efficient processing.
Timing and Control Signals:Generates necessary timing and control signals to synchronize
operations and maintain orderly execution.
1.3 Registers:Registers are small, highspeed storage locations within the CPU that temporarily
hold data and instructions. Each register is designed for special purpose.
Measurement:Registers are measured by the size of bits they can hold e.g 16bits,32 or 64 bits
registers.
Classification:Processor contains different kinds of registers and is classified according to their
content pr instructions.
Importance of Registers:Registers play a critical role in the CPU’s performance by:
1.5 Internal Buses:Multiple bits simultaneously) or in Internal buses are subsystems that
transfer data between computer components. They connect all components to the motherboard,
facilitating communication between the CPU, memory, and other devices
Functions of Internal Buses
Data Transfer: Enable the movement of data between the CPU, memory, and other devices.
Component Connectivity: Connect all components to the motherboard for integrated
functionality.
Modes of Operation
Parallel Operation
Allows multiple bits to be transferred simultaneously, increasing data transfer rates.
Serial Operation
2
Computer science, XI Ch#3: Central Processing Unit
Transfers one bit at a time, which can simplify the design but may reduce speed compared to
parallel buses.
2 Registers:Registers are small, high speed storage locations within the CPU that temporarily
hold data and instructions.Theseare group of latches that a single memory word. Each register is
designed for special purpose. They are crucial for efficient processing and play a significant role in the
execution of instructions.
Characteristics of Registers:
Speed: Registers are much faster than RAM, allowing the CPU to access data quickly.
Size: Typically range from 32 to 64 bits in modern CPUs.
Functionality: Used to store operands, results of calculations, and control information.
Types of Registers
General Purpose Registers
These registers are versatile and used in various arithmetic and data movement operations. They are
used to save data as well as their addresses. These are 8-64bits registers.
The AX, BX, CX, and DX registers are key general-purpose registers.
Function: Primarily used for arithmetic operations, input/output operations, and as the default
register for many instructions.AX can hold a 16-bit value, with its lower 8 bits referred to as AL
(low byte) and the upper 8 bits as AH (high byte).
Usage: Often used to store results of arithmetic operations or data that is frequently accessed.It
is included in a CPU and act as a temporary storage location.The results of an operation are
written to Accumulator ,overwriting the previous values,
Function: It can perform Arithmetic and data movement and it has some special addressing abilities.
Serves as a pointer to data in memory, especially useful for addressing modes that require base
3
Computer science, XI Ch#3: Central Processing Unit
addresses. The BX register also has two sub-registers: BL (the lower 8 bits) and BH (the upper 8 bits),
enabling operations on individual bytes.
Counter register(CX):
A counter register is a special type of register in a computer's CPU that keeps track of how many times a
certain operation has occurred, often used in loops or repetitive tasks. . When the operation is
performed, the count decreases until it reaches zero, signaling that the loop should stop. This helps
manage control flow in programs efficiently.
Usage
Counts how many times a loop should run, decreasing with each iteration.
Tells the program how many characters to copy or process in string operations.
Tracks the number of times something happens, like counting items.
Counts down time for delays or triggers events.
Data Register(DX)
It has a special role in multiply and divide operations. It works as a buffer and holds anything
that is copied from memory ready for the processor to use it.
current instruction register (CIR):It is also known as current instruction register (CIR) because it holds
the current instruction being executed.
Memory Address Register (MAR): Memory Address Register holds the memory address, the
memory address from which data will be provided to the CPU or will have the address to which data will
be sent and then stored.
parallel load register:MAR is a parallel load register containing the next memory address to be
manipulated.
4
Computer science, XI Ch#3: Central Processing Unit
For example: The next address to be read or written. It basically holds the memory location of data
that needs to be accessed. When reading from memory, the data addressed by MAR is fed into the MDR
(Memory Data Register) and then is used by the CPU. When writing to memory, the CPU writes data
from Data Register to the memory location whose address is stored in MAR. So, in both reading and
writing, it is holding the address of the memory location where the data is to be read or stored.
Memory Buffer Register (MBR):The Memory Buffer Register actually holds the contents of the
memory which are to be moved from memory to other components or from components to the other
memory. In order to store a word, it must be transferred to the MBR and then from here it will go to the
specific memory location. It must be allow the processor and memory units to act independently.
5
Computer science, XI Ch#3: Central Processing Unit
Size: A typical data bus is 32-bits wide. This means that up to 32-bits of data can travel through a data
bus every unit of time. New computers have 64-bit data buses and even more.
(c) Control Bus:The control bus is used by the CPU to direct and monitor the actions of other
functional areas of computer. It is used to transmit a variety of individual signals (read, write, interrupt,
acknowledge) necessary to control and coordinate the operations of the computer.
Size:The size of control bus is from 8 to 16 bits
CPU Operations
The fundamental operation of a CPU is executing programs represented by a series of instructions
stored in memory.
Program: The CPU follows a cycle to fetch, decode, and execute these instructions. There are four
steps that CPUs use in their operation, these stored instructions called a program. The program is
represented by a series of fetch, decode, execute and store.
6
Computer science, XI Ch#3: Central Processing Unit
MOVE (MOV): instruction transfers data from a memory location to a register, register to memory
and register to register. This is also used to obtain the data to perform a computation on it later, or to
store the result of a computation.
(b) Data Processing Instructions: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.
Types:
Data manipulation instructions can be divided into three basic types:
arithmetic, logical and shift instructions.
1. Arithmetic Instructions:The four basic operations are ADD, SUB, MUL and DIV. An arithmetic
instruction may operate on fixed- point data, binary or decimal data .The other possible operations
include a variety of instructions .
Example: ABSOLUTE,NEGATE,INCREMENT,DECREMENT.
ii. Logical Instructions:AND, OR, NOT, XOR operate on binary data stored in registers. iii. Shift
Instructions
Shift Instructions: is used for transfer of bits either to the left or to the right of an operand.
Program Control Instructions:These instructions specify conditions for altering the sequence of
program execution or in other words the content of PC (program counter) register. 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 like JMP (Jump) and
LOOP.
The JMP instruction jumps to begin the execution at another location.
The LOOP instruction is used when number of statements are to be repeated.
Instruction Format
An instruction format defines the layout of an instruction. An instruction format must include an Op-
code (Operation-Code) and zero or more Operands. The Op-code will always be present.
1.Op-Code 2. Operand
7
Computer science, XI Ch#3: Central Processing Unit
Different instruction formats are used. A few of them are explained below.
a) Zero Address instruction:Zero Address instruction format requires only Op-Code, having no
operand to work with. Example: of the Zero Address instruction format is HALT, STOP, which do not
have any address.
b) One-Address Instruction: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. Like JMP requires one address in order to
jump to that specific address location.
(c) Two-Address Instruction:Two Address instruction format requires one Op-Code and two
operands. Example:of such instruction format is the MOV (Move), which moves data from the
memory location to the register and vice versa.
4. Instruction Cycle
The instruction cycle is the process by which a computer retrieves, decodes, and executes instructions
from memory. It typically consists of several stages, often summarized as:
Fetch
Instruction
Execute Decode
Instruction Instruction
1. Fetch: The CPU retrieves an instruction from memory, using the program counter (PC) to
determine the address of the next instruction.
2. Decode: The fetched instruction is interpreted by the CPU to understand what actions are
required. This often involves determining the operation code (opcode) and the operands .
3. Execute: The CPU performs the operation specified by the instruction, which may involve
arithmetic calculations, logic operations, or data transfer.
4. Store: If the instruction produces a result that needs to be saved, this stage writes the result
back to memory or a register.
8
Computer science, XI Ch#3: Central Processing Unit
Advantage:
The advantage of CISC processor is that the compiler requires little effort to translate high-level
programs or statement languages into assembly or machine language in CISC processors. The
disadvantage is that CISC chips are slower than RISC chips to execute per cycle instruction of each
program.
Characteristics:
Following are the main characteristics of the CISC processor:
1. The length of the code is short, so it requires very little RAM.
2. CISC or complex instructions may take longer than a single clock cycle to execute the code
3. Less instruction is needed to write an application.
4. It provides easier programming in assembly language.
5. Support for complex data structure and easy compilation of high-level languages.
6. It is composed of fewer registers and more addressing nodes, typically 5 to 20.
7. Instructions can be larger than a single word.
8. It emphasizes the building of instruction on hardware because it is faster to create than the software.
9
Computer science, XI Ch#3: Central Processing Unit
Larger set of instructions make the microprocessor more complicated and slower in operation.
Operating System and application programmers will find it easier to work with smaller instruction set.
One of the drawbacks of the RISC is that it puts a lot of burden on software due to its smaller size of
instruction set.
RISC emphasizes on software. Examples of RISC processor are IBM PowerPC, Sun SPARC, Microchip PIC
processors, RISC-V.Features of RISC Processor.
Characteristics:
Following are the main characteristics of the RISC processor:
1. One cycle execution time: For executing each instruction in a computer, the RISC processors require
one CPI (Clock per cycle).
2. Pipelining technique: The pipelining technique is used in the RISC processors to execute multiple
parts or stages of instructions to perform more efficiently.
3. A large number of registers: RISC processors are optimized with multiple registers that can be used to
store instruction and quickly respond to the computer andminimize interaction with computer memory.
4. It supports a simple addressing mode and fixed length of instruction for executing the pipeline.
5. It uses LOAD and STORE instruction to access thememory location.
6. Simple and limited instruction reduces the execution time of a process in a RISC.
Intel and AMD Processor: are the two major players in the CPU market, each offering a
range of processors for different needs Intel and AMD (Advanced Micro Devices) are the primary
manufacturers of processors. They make processors for desktop computers, laptops, notebooks and
mobile devices. Each type of processor has different functionality, but similarities do exist among various
types Both Intel and AMD make processors for a variety of systems. Intel makes the Core, Pentium and
Celeron families of processors, matched by the Phenom, Athlon and Sempron processors from AMD..
Here’s a brief overview of both:
Intel Processors
1. Architecture: Intel’s current architecture, known as "Alder Lake" and "Raptor Lake," combines
performance and efficiency cores for better multitasking and energy efficiency.
2. Performance: Generally, Intel processors have been known for strong single-core performance,
making them excellent for gaming and applications that rely heavily on single-threaded
performance.
3. Integrated Graphics: Most Intel CPUs come with integrated graphics, which can be a good
option for users who don’t need a dedicated GPU.
4. Platforms: Intel has several chipsets, with the most recent being the Z690 and Z790 for high-end
desktops. Their compatibility can vary, so it's essential to check motherboard support.
10
Computer science, XI Ch#3: Central Processing Unit
5. Price: Typically, Intel CPUs are priced at a premium, especially their high-end offerings.
AMD Processors
1. Architecture: AMD’s latest architecture, "Zen 3" and "Zen 4," offers strong multi-core
performance, making them ideal for tasks like content creation, video editing, and gaming.
2. Performance: AMD processors have gained ground in single-core performance and often lead in
multi-core scenarios due to higher core and thread counts in many models.
3. Integrated Graphics: AMD's Ryzen series also features models with integrated graphics (APUs),
providing a good balance for budget builds without a dedicated GPU.
4. Platforms: AMD's AM4 socket has supported multiple generations of Ryzen processors, making
upgrades easier for users. The new AM5 platform introduces support for next-gen features like
DDR5 RAM.
5. Price: AMD often provides better value for performance, especially in mid-range and budget
segments.
Intel P4:The Pentium 4 brand refers to Intel's line of CPUs introduced in November 20,
2000. The first Pentium 4 processor cores were capable of speeds from 1.3 to 2 GHz. Pentium
technology was succeeded by Intel's core technology e.g., Core i3, Core i5, Core i7, Core i9 etc.
11
Computer science, XI Ch#3: Central Processing Unit
MCQS:
1. What is the primary function of the data bus in a computer system?
a) Carrying addresses to memory
b) Carrying control signals
c) Transferring data and instructions between memory, CPU, and I/O devices
d) Managing program execution flow
4. Which of the following is used by the CPU to monitor and control other functional areas of the
computer?
a) Data bus
b) Address bus
c) Control bus
d) Power bus
5. In which step of the CPU operation does the processor fetch an instruction from memory?
a) Decode
b) Execute
c) Fetch
d) Store
7. Which instruction type is used to move data from one memory location to another?
a) Data Processing Instruction
b) Data Transfer Instruction
c) Program Control Instruction
d) Logical Instruction
12
Computer science, XI Ch#3: Central Processing Unit
c) AND
d) JMP
13. The instruction format that includes both an Op-code and a single operand is known as:
a) Zero Address Instruction
b) One-Address Instruction
c) Two-Address Instruction
d) Three-Address Instruction
16. Which stage of the instruction cycle retrieves an instruction from memory?
a) Decode
b) Fetch
13
Computer science, XI Ch#3: Central Processing Unit
c) Execute
d) Store
17. Which CPU architecture emphasizes on having a smaller number of instructions to simplify the
execution process?
a) CISC
b) RISC
c) Harvard
d) VLIW
18. In which of the following architectures are instructions typically more complex and can take multiple
clock cycles to execute?
a) RISC
b) CISC
c) SIMD
d) VLIW
21. The major difference between Intel and AMD processors in terms of multi-core performance is that:
a) Intel generally leads in multi-core performance
b) AMD generally has better multi-core performance due to higher core/thread count
c) Intel processors are typically better for content creation
d) AMD processors are slower in multi-core tasks
22. Which of the following processors is more likely to be integrated into budget builds with integrated
graphics?
a) Intel Core i7
b) Intel Pentium
c) AMD Ryzen APUs
d) Intel Xeon
23. Intel’s architecture that combines performance and efficiency cores for better multitasking is known
as:
a) Zen 4
b) Alder Lake
c) PowerPC
d) ARM Cortex
14
Computer science, XI Ch#3: Central Processing Unit
25. In the comparison between Intel Pentium 4 and AMD Athlon, which is true?
a) AMD Athlon processors typically run at higher clock speeds than Intel Pentium 4
b) Intel Pentium 4 uses a 64-bit architecture
c) AMD Athlon processors support faster memory speeds than Pentium 4
d) Intel Pentium 4 was released later than AMD Athlo n processors
15