Chapter No 3
Chapter No 3
PROCESSING UNIT(CPU)
• CPU
• Integrated part a computer system.
• It is the brain of computer system.
• Just like human brain it cantor all the attached parts/devices.
• CPU is connected with all parts of the computer directly /in directly.
• BASIC COMPONENTS OF CPU
• Arithmetic and Logic Unit(ALU)
• Control Unit(CU)
• Registers
• Cache Memory
• Internal Buses
• Arithmetic and Logic Unit(ALU)
• Main part of CPU.
• It performs arithmetic and logical operation.
• Arithmetic operation is Addition,Subtraction,Multiflication and
Division.
• Logical operation is the comparison between two data items.
• It process data according to the given instruction and give result.
• Control Unit(CU)
• It manages/control the overall functions performed by different
parts of the computer.
• It coordinates among different parts of the computer.
• It execute the program instruction via different devices.
• It is just like an administrator.
• It act as human brain can act.
• It can assign task to different parts of the computer.
• The control unit (CU) is a component of a computer's central
processing unit (CPU) that directs the operation of the processor
• It tells the computer's memory, arithmetic/logic unit and input and
output devices on how to respond to a program's instructions.
• Registers
• These are small memory devices/parts available in the CPU.
• They are used to store data temporarily.
• CPU registers are at the top of the memory hierarchy.
• It provide the fastest way for a CPU to access data.
• Each register are designed for a special purpose and the size of each
are varies.
• A processor register (CPU register) is one of a small set of data
holding places that are part of the computer processor.
• A register may hold an instruction, a storage address, or any kind of
data (such as a bit sequence or individual characters).
• TYPES OF REGISTERS
• There are two main types of CPU registers.
• 1) General Purpose Registers
• 2) Special Purpose Registers
• 1) General Purpose Registers
• Register that are used to store data as well as addresses.
• They are combined data and address registers.
• These are used for arithmetic and data movement.
• These registers are 8‐32 bit registers.
• Types of General Purpose Registers are as under
• A) Accumulator (AX)
• General purpose register
• Used for performing arithmetic and logic operations.
• It hold the result of those operations.
• A) Accumulator (AX)
• General purpose register
• Used for performing arithmetic and logic operations.
• It hold the result of those operations.
• The accumulator value is initially 0 and then each number in turn is
added to the value in the accumulator.
• It consist of two 8‐bit registers which can be combined together and
used as a one 16‐ bit register.
• B) Base Register(BX)
• It perform arithmetic and data movement.
• It has some special addressing abilities.
• It can hold memory address that points to another variable.
• It contains a data pointer.
• C) Counter Register (CX)
• It acts as counter for repeating or looping instructions.
• The given instructions are automatically repeated and will
decrement the value of CX and quits when it is equal to 0.
• D) Data Register(DX)
• It has special role in multiply and divide operations.
• It works like a buffer and holds anything that is copied from the
memory ready for the processor to use it.
• It also consist of two 8‐ bits register.
• 2) Special Purpose Registers
• 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 and by
the operating system programs to control the execution of the programs.
• Following are the special purpose registers.
• A) Instruction Register (IR)
• It is a part of control unit which stores the instructions currently being
executed.
• Each instruction to be executed is loaded into the instruction register.
• It is also called current instruction register because it holds the current
instruction being executed.
• B) Memory Address Register(MAR)
• It 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.
• It can basically holds the memory location of the data that needs to
be accessed.
• When reading from memory, the data addressed by MAR is fed into
the MDR and then is used by the CPU.
• C ) Memory Buffer Register(MBR)
• It holds the contents of the memory which are to be moved from
memory to other components or from components to the memory.
• In order to store a word it must be transferred to the MBR and then
form here it will go to the specific memory location.
• E) Program Counter(PC)
• It is also called Instruction Pointer.
• It is a register in a computer processor that contains the
address(location) of the instruction being executed at the current
time.
• As the instruction get fetched the program counter increases its
stored value by 1.
• Cache Memory
• It is small amount of memory located between main memory and
processor.
• It is also called high speed buffer or on chip memory.
• Microprocessor stores a copy of most frequently used data and
instructions in the cache memory.
• When microprocessor desired data it can first look it in the cache
memory.
• Due to it the speed of the processor is increased.
• There are different level of cache memory.
• Level 1(L1) Cache Memory
• It resides inside the microprocessor.
• Very fast form other memories.
• Level 2(L2) Cache Memory
• It lies outside the microprocessor.
• Slow as compared to Level 1 cache memory but fast form other
memories.
• Data is checked and store after L1.
• Internal Buses
• It is a subsystem that transfers data between computer components
inside a computer/mother board.
• It is used to connect all the components to the mother board.
• Is used as link/channel for communication between internal
components.
• The communication via bus may be serial or parallel.
• SYSTEM BUS
• A bus is a data communication path over which information is transferred a
byte or word at a time.
• It connect central processing unit to main memory on the mother board.
• Majority of them have 50 to 100 distinct lines for communication.
• Types of System Bus
• 1) Data Bus
• It is bidirectional bus.
• It communicate in two ways but in one direction at a time.
• It handles the transfer of data and instructions.
• It is used to transfer instructions from memory to the CPU for execution.
• It also carries data to and from the CPU and memory as required.
• It also used to transfer data between memory and I/O devices.
• 2) Address Bus
• It carries addresses not data.
• Address is a label, symbol or other set of characters used to
designate a location or register where information is stored.
• Before data or instructions can be written into or read form memory
by the CPU or I/O sections an address must be transmitted to
memory over the address bus.
• 3) Control Bus
• It is used by the CPU to direct and monitor the actions of the other
functional areas of the 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.
CONTROL BUS
S
U
B
T
A
D
CENTRAL
PROCESSING UNIT MEMORY
S
U
D
D
B
A
T
E
S
S
CONTROL BUS
INPUT/OUTPUT
• INSTRUCTIONS
• It is a group of bits that tells the computer to perform a specific
operation.
• It is an elementary operation that the processor can accomplish.
• It is stored in the main memory, waiting to be processed by the
processor.
• It has two fields.
• OPERATION CODE‐which represents the action that the processor
execute.
• OPERAND CODE‐which defines the parameters of the action.
• It can be data of memory address.
• TYPES OF INSTRUCTIONS
• 1) Data Transfer Instructions
• It is used when the data need to be moved from memory location to
register.
• It can transfer data from one location in the computer to another location
without changing the data.
• It transfer data between
• Registers and memory
• Registers and I/O
• Registers to Registers
• E.G
• MOV A,B
• LD A
• STO
• 2) Data Processing Instructions
• It is used for arithmetic and logic operations.
• It is performed on the values and the results are stored/placed in a
register.
• A)Arithmetic Instructions‐These are ADD,SUB,MUL,DIV
• B)Logical Instructions‐These are AND,OR,NOT,XOR
• C)Shift Instructions‐It is used for transfer of bits either to the left or to the
right of an operand.
• 3) Program Control Instructions
• Used to specify conditions for altering the sequence of program
execution or in other words the content of PC register.
• JMP‐used for jumping execution to another location.
• LOOP‐used for number of statements to be repeated.
• INSTRUCTION FORMAT
• It defines the layout of the bits of an instruction.
• It includes two things
• 1‐Op‐code(operation code)
• 2‐Operand
• A) Zero Address Instruction
• It have only Op‐Code and having no operand to work with.
• Eg STOP,END,SRTAT
• B) One Address Instruction
• It has one op‐Code and one operand.
• E.G
• JMP AX
• C) Two Address Instruction
• It have one op‐code and two operands.
• E.G
• ADD A,B
• Instruction Cycle
• It also called fetch and execute cycle, fetch decode‐execute cycle.
• It is a basic operation cycle of a computer.
• It is a process by which a computer can execute a program.
• Steps in Fetch and execute Cycle.
• 1) Fetch the instruction
• The instruction is fetch from the memory address that is currently in the
Program Counter and store it in the Instruction Register.
• 2) Decode the instruction
• The instruction decoder interprets the instruction.,
• If the instruction has an indirect address the effective address is read from
main memory and any required data is fetched from main memory to be
processed and then placed into data registers.
• During this phase the instruction inside the IR gets decoded.
• 3) Execute the instruction
• The Cu passes the decoded information as a sequence of control signals to
the relevant function units of the CPU to perform the actions required by
the instruction such as reading values form registers, passing them to the
ALU to perform mathematical or logic functions on them.
• 4) Store results
• The result generated by the operation is stored in the main memory or sent
to an output device.
• But this condition is not always required.
• CISC AND RISC ARCHETECTURE
• CISC(COMPLEX INSTRCUTION SET COMPUTER)
• It is processor architecture.
• The instruction which the processor could execute were built into the chip.
• In common CISC chips are relatively slow per instruction.
• It is a bit complex because it is used at the hardware level.
• RISC(REDUCED INSTURION SET COMPUTER)
• It is a microprocessor architecture that is designed to perform a smaller
number of instructions.
• It was made in 1980 as a reaction to the CISC chips.
• It is designed to perform smaller number of instructions in order to operate
on a higher speed.
• It has limited and simple instruction set.
• History of Intel Pentium
• The Intel Pentium processor was first introduced in 1993. Being the first
Pentium processor, it was simply called the Pentium Processor. The
Pentium name, however, has come to represent several subsequent CPU
models, including the Pentium 2, Pentium 3, Pentium 4 and Pentium Dual‐
Core CPUs. Each succeeding CPU model has improved on the last in
multiple ways, most notable by increasing the CPU's processing speed and
memory cache size. The "Pentium" name helped Intel gain a near‐
monopoly over the CPU market for a large part of the 1990s.
• History of AMD Athlon
• Intel's near‐monopoly was shattered when AMD introduced its Athlon line
of processors in 1999. Like the Intel Pentium brand, Athlon has branded
several AMD processors, including the Athlon XP, Athlon X2 and Athlon 64.
Though technically "inferior" (on paper) to their Intel counterparts, these
processors offer consumers the same, if not better performance, through a
few technological differences.
Intel Pentium
PROPERTY AMD Athlon 64