chp 5 new
chp 5 new
chp 5 new
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.
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.
Instruction Decoding
1
Computer science,XI Ch#3: Central Processsing Unit
Execution Coordination
Directs the Arithmetic and Logic Unit (ALU) and other units to perform the specified tasks.
The CU regulates the movement of instructions and data within the CPU, ensuring efficient processing.
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
2
Computer science,XI Ch#3: Central Processsing Unit
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
Serial Operation
Transfers one bit at a time, which can simplify the design but may reduce speed compared to
parallel buses.
2 Registers
Registers are small, highspeed storage locations within the CPU that temporarily hold data and
instructions. 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.Theseare8-64bits registers.
The AX, BX, CX, and DX registers are key general-purpose registers.
3
Computer science,XI Ch#3: Central Processsing Unit
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
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.
4
Computer science,XI Ch#3: Central Processsing Unit
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.
MAR is a parallel load register containing the next memory address to be manipulated.
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.
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 word, it
must be allowing the processor and memory units to act independently.
Program Counter is also known as Instruction counter. It is a register in a computer processor that
contains the address (location) of the instruction being executed at the current time. As each instruction
gets fetched, the program counter increases in stored value by 1 After each instruction is fetched, the
program counter points to the next instruction in the sequence.
5
Computer science,XI Ch#3: Central Processsing Unit
6
Computer science,XI Ch#3: Central Processsing 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.
ii. Logical Instructions AND, OR, NOT, XOR operate on binary data stored in registers.iii. Shift
Instructions
Shift operation 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.
3. Instruction Formats
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.
Op-Code Operand
7
Computer science,XI Ch#3: Central Processsing Unit
Different instruction formats are used. A few of them are explained below.
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.
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:
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.
CPUs can be categorized based on their instruction set architectures (ISAs), which define the set of
instructions the CPU can execute. Here are some common types of CPU architectures based on their
instruction sets:
1. RISC (Reduced Instruction Set Computer) 2. RISC (Reduced Instruction Set Computing)
9
Computer science,XI Ch#3: Central Processsing Unit
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.
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.
10
Computer science,XI Ch#3: Central Processsing Unit
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.
AMD Athlon
Athlon is the brand name applied to a series of x86-compatible microprocessors designed and
manufacturedby AMD. Typical speed for these processors ranges from 1333 MHz to 2.33 GHz
and their bus speed lies in between 100 and 200 MHz. The original Athlon processors were 32
bit and the later Athlon64 are 64 bit processors. Latest AMD
11