Central Processing Unit CPU Central Processing Unit Visit for more Learning Resources 1
3.2 Components of the CPU Control unit Arithmetic logic unit (ALU) Moves data and instructions between main memory and registers Arithmetic logic unit (ALU) Performs computation and comparison operations Set of registers Storage locations that hold inputs and outputs for the ALU 2
3
CPU Structure CPU must: Fetch instructions Interpret instructions Fetch data Process data Write data 22
CPU With Systems Bus
CPU Internal Structure
Actions Performed by CPU Fetch cycle CPU: Fetches an instruction from primary storage Increments a pointer to location of next instruction Separates instruction into components (instruction code and data inputs) Stores each component in a separate register Execution cycle ALU: Retrieves instruction code from a register Retrieves data inputs from registers Passes data inputs through internal circuits to perform data transformation Stores results in a register 7
Register A, special, high-speed storage area within the CPU. All data must be represented in a register before it can be processed. For example, if two numbers are to be multiplied, both numbers must be in registers, and the result is also placed in a register. The power and speed of a CPU determined by the number of registers that a CPU has and the size of each (number of bits) For example a 32-bit CPU is one in which each register is 32 bits wide. Therefore, each CPU instruction can manipulate 32 bits of data. 8
Registers Fast stand-alone storage locations that hold data temporarily in CPU. PC (Program Counter) Keep track of the instruction currently being executed. Incremented after execution of the instruction. Instruction Register Store the instruction currently being executed Data Registers Hold data before it can be processed 9
CPU Registers Primary roles Hold data for currently executing program that is needed quickly or frequently (general-purpose registers) Store information about currently executing program and about status of CPU (special- purpose registers) 10
General-Purpose Registers Hold intermediate results and frequently needed data items Used only by currently executing program Implemented within the CPU; contents can be read or written quickly Increasing their number usually decreases program execution time to a point 11
Special-Purpose Registers Track processor and program status Types Instruction register Instruction pointer Program status word (PSW) Stores results of comparison operation Controls conditional branch execution Indicates actual or potential error conditions 12
ALU Arithmetic operations: Logical operations: Increment Decrement Add Subtract Multiply Divide Logical operations: NOT AND OR XOR 13
Control Unit Like the part of the human brain that control the operation of each part of the body. Controlling is achieved through wires (form Control unit to ALU) that can be on/off. 4 wires 16 operations 14
A B C 10 20 30 CA+B ADD I ← M[PC] PC++ R1 ← A R2 ← B R3 ← R1 + R2 . 2000 CA+B 2004 CC-5 10 A 20 B 30 C 10 20 30 CA+B ADD 2000
3.3 The Physical CPU Electrical device implemented as silicon- based microprocessor Contains millions of switches, which perform basic processing functions Physical implementation of switches and circuits 16
For more detail contact us 17