### Ticker

6/recent/ticker-posts

# CPU Structure and Function

### CPU Structure

As there are a great many variations in architecture between the different kinds of CPU, a simplified model of the structure is looking here. The simplified model consists of five parts:

Control Unit

Arithmetic and Logic Unit (ALU)

Register Array

System Bus

Memory Unit

### (a) Control Unit

The Control Unit interprets any instruction it receives from memory and directs the sequences of events necessary to execute the instruction. It is also responsible for performing the instruction execution cycle. It consists of a decoder, control logic circuits and a clock to ensure everything happens at the correct time.

Control unit uses a system clock which synchronizes all tasks by sending out electrical pulses. The clock speed of a CPU is defined as the frequency that a processor executes instructions or that data is processed. This clock speed is measured in millions of cycles per second or megahertz (MHz) and is the main element in determining the speed of the processor. Computer speed is also measured by the ‘Number of Instructions Completed Per Second’ or ‘Millions Per Second (MPS)’ or ‘Instructions Per Second (MIPS)’. Hertz is the unit of frequency that measures the number of cycles per second in a periodic signal.

### Arithmetic and Logic Unit

The Arithmetic and Logic Unit (ALU) is that part of CPU where actual data processing occurs. All calculations (mathematical) and all comparisons (logic function) take place in this unit. Basic arithmetic functions which an ALU can carry out are addition and subtraction. More powerful CPUs can support additional mathematical operations like multiplication and division.

In addition to arithmetic functions, the ALU also performs logic functions. The logical operation which can it can carry out greater than, equal to, less than comparison between two numbers. Besides these operations, some processors also supports operations which check if particular bits are on or off.

The ALU is made up of devices called gates that receive one or more inputs and based upon what function they are designed to perform, output a result. The ALU in example performs one of seven functions: NOT, Left Shift, Right Shift, Add, Subtract, AND, OR.

Every arithmetic step requires at least two numbers and then it produces a result. Multiplication,

for example, uses a multiplicand and a multiplier to get a product. Although every ALU must be able to manage the two data words and the result, different processing and storage techniques are used in different models.

### (a) Register Array

Registers are temporary memory units that store a computer instruction, a storage address or any kind of data (such as a bit sequence or individual characters). The registers are located in the processor, instead of in RAM, so data can be accessed and stored faster. When a program is debugged, register contents may be analyzed to determine the computer’s status at the time of failure. Each of the registers is 16 bits long, i.e., can contain a 16-bit binary number. Group of flip flops and gates form a register. Register is a special purpose memory. This memory is vital for moving data in and out of the main memory and to process the data. When CPU executes the instructions, there is a transfer of information between various units of the computer system. CPU uses these registers to handle the process of execution effectively and efficiently. They are a part of the central processing unit but cannot be considered as a part of main memory. They can hold only one piece of data at a time. Registers receive the information, hold it temporarily and pass it on as directed by the control unit. The number of registers varies from computer to computer, each one designed to perform a specific function.

### Types of Registers

A processor often contains several kinds of registers, that can be classified according to their content or instructions that operate on them:

User-accessible registers are divided into data registers and address registers.

Data registers are used to hold numeric values such as integer and floating-point values.

Address registers hold addresses and are used by instructions that indirectly access memory.

Index register are used to store the index of memory address.

Conditional registers hold truth values often used to determine whether some instruction should or should not be executed.

General purpose registers (GPRs) are combined with Data and Address registers. They can be used by the programmer for data manipulation.

Floating point registers (FPRs) are the type of data registers that store floating point numbers in many architectures.

Accumulator register is special data register which stores the result of the last processing step of the ALU.

Constant registers are used to store read only values such as zero, one, or pi.

Vector registers hold data for vector processing done by SIMD instructions (Single Instruction, Multiple Data).

Special purpose registers (SPRs) hold program state. This have two special registers – Status Registers and Control Registers.

Status registers has two special registers –
• Stack Pointer: Contains the last address of a stack of.
• Status Register: Also flag register or condition code register (CCR)) is a collection of flag bits for a processor.

Control registers has two special registers –

• Program Counter (PC): Contains the address (in binary) in main memory of the next instruction.
• Instruction Register (IR): Contains the instruction (in binary) that is currently being executed.

Model-specific registers (also called machine-specific registers) store data and settings related to the processor itself.

### System Bus

The system bus is a cable which carries data communication between the major components of the computer, including the microprocessor. These wires carry information in terms of voltage. If 5V at a wire indicates Bit 1, 0V indicate Bit 0. The system bus consists of three different groups of wiring, called the data bus, control bus and address bus. These all have separate responsibilities and characteristics, which can be outlined as follows:

An address bus carries the address of memory location or address of the peripheral. If the computer used 8 bits to represent the address of a location, then it can address upto 28 – 256 location. Sometimes, the address bus is combined with the data bus also. This is said to be address bus multiplexed with data bus. Bits flow from the microprocessor to peripheral is undirectional.

(ii) Data Bus

A Data Bus carries the data to the memory location or input/output units. In 8-bit computer, the width of the Bus is 8 lines. It can carry only 8-bits at a time. The control unit will distinguish whether the data is to be sent for input or output. Data flow between microprocessor and memory and peripheral is bidirectional.

(iii) Control Bus

This Bus carries control signals used to control overall operations of the computer. This Bus sends appropriate signals at the appropriate time to all the parts of the computer. These provide timing and control signals.

### Memory Unit

The memory is not an actual part of the CPU itself, and is instead housed elsewhere on the motherboard. However, it is here that the program being executed is stored, and as such is a crucial part of the overall structure involved in program execution. For more information about memory, please see next pages.

ALSO SEARCH:

"cpu structure and function"
"structure of cpu with diagram"
"function of cpu"
"what is internal structure of cpu"
"what is cpu"
"components of cpu"
"what are the four functions of cpu"
"10 functions of cpu"