Central Processing Unit

THE CPU:- 

CPU stands for Central Processing Unit . It is also called a processor, central processor, or microprocessor. It carries out all the important functions of a computer. It receives instructions from both the hardware and active software and produces output accordingly. It stores all important programs like operating systems and application software. CPU also helps Input and output devices to communicate with each other. Owing to these features of CPU, it is often referred to as the brain of the computer.All functions and processes that is done on a computer is performed directly or indirectly by the processor.

A CPU has three components:
  1. Control Unit
  2. ALU (Arithmetic Logic Unit)
  3. Memory or Storage Unit

1) Control Unit 

Control Unit is the hardware part of the computer’s central processing unit (CPU), which directs the operation of the processor. It was included as part of the Von Neumann Architecture by John von Neumann. It is the responsibility of the Control Unit to tell the computer’s memory, arithmetic/logic unit and input and output devices how to respond to the instructions that have been sent to the processor. It fetches internal instructions of the programs from the main memory to the processor instruction register, and based on this register contents, the control unit generates a control signal that supervises the execution of these instructions.

A control unit works by receiving input information to which it converts into control signals, which are then sent to the central processor. The computer’s processor then tells the attached hardware what operations to perform. The functions that a control unit performs are dependent on the type of CPU because the architecture of CPU varies from manufacturer to manufacturer. Examples of devices that require a CU are:
Control Processing Units(CPUs)

Graphics Processing Units(GPUs)




Functions of the Control Unit –

  • It coordinates the sequence of data movements into, out of, and between a processor’s many sub-units.
  • It interprets instructions.
  • It controls data flow inside the processor.
  • It receives external instructions or commands to which it converts to sequence of control signals.
  • It controls many execution units(i.e. ALU, data buffers and registers) contained within a CPU.
  • It also handles multiple tasks, such as fetching, decoding, execution handling and storing results.
2.) ALU (Arithmetic Logic Unit)

An arithmetic logic unit (ALU) is a digital circuit used to perform arithmetic and logic operations. It represents the fundamental building block of the central processing unit (CPU) of a computer. Modern CPUs contain very powerful and complex ALUs. In addition to ALUs, modern CPUs contain a control unit (CU).


Most of the operations of a CPU are performed by one or more ALUs, which load data from input registers. A register is a small amount of storage available as part of a CPU. The control unit tells the ALU what operation to perform on that data, and the ALU stores the result in an output register. The control unit moves the data between these registers, the ALU, and memory.

How an ALU Works

Representing and storing numbers were the basic of operation of the computers of earlier times. The real needs occurs when computation, manipulating numbers like adding, multiplying came into picture. These operations are handled by computer’s arithmetic logic unit (ALU). The ALU is the mathematical brain of a computer. The first ALU was INTEL 74181 implemented as a 7400 series is a TTL integrated circuit which was released in 1970.

An ALU performs basic arithmetic and logic operations. Examples of arithmetic operations are addition, subtraction, multiplication, and division. Examples of logic operations are comparisons of values such as NOT, AND, and OR.

All information in a computer is stored and manipulated in the form of binary numbers, i.e. 0 and 1. Transistor switches are used to manipulate binary numbers since there are only two possible states of a switch: open or closed. An open transistor, through which there is no current, represents a 0. A closed transistor, through which there is a current, represents a 1.

Operations can be accomplished by connecting multiple transistors. One transistor can be used to control a second one - in effect, turning the transistor switch on or off depending on the state of the second transistor. This is referred to as a gate because the arrangement can be used to allow or stop a current.

Operands and Results

The operands and results of the ALU are machine words of two kinds: 

i)Arithmetic words:- which represent numerical values in digital form. 
                  Arithmetic words consist of digit vectors (strings of digits).

ii)Logic words:- which represent arbitrary sets of digitally encoded symbols. 



Operator: Operator is arithmetic or logical operation that is performed on the operand given in instructions.

Flag: ALU uses many types of the flag during processing instructions. All these bits are stored in status or flag registers.

Functional Organization of an ALU

A typical ALU consists of three types of functional parts: 
i)   storage registers
ii)  operations logic
iii) sequencing logic.

Arithmetic Logical Unit (ALU) Architecture

ALU is formed through the combinational circuit. The combinational circuit used logical gates like AND, OR, NOT, XOR for their construction. The combinational circuit does not have any memory element to store a previous data bit. Adders are the main part of the arithmetic logic unit to perform addition, subtraction by 2’s complement.

Control unit generates the selection signals for selecting the function performed by ALU.

Registers : Registers are a very important component in ALU to store instruction, intermediate data, output, and input.

Logic Gates

Logic gates are building a block of ALU. Logic gates are constructed from diode, resistors or transistors. These gates are used in Integrated circuit represent binary input as ‘ON’ and ‘OFF’ state. Binary number 0 is represented by ‘OFF’ and Binary Number ’1’ is represented by ‘ON’ state in an integrated circuit.

OR gate 

OR gate can take two or more inputs. The output of OR gate is always 1 if any of the inputs is 1 and 0 if all the inputs are false. OR gate performs an addition operation on all operand given in instructions. It can be expressed as X=A+B or X=A+B+C.        
                              
AND gate 


AND gate takes two or more inputs. The output of AND gate is 1 if all inputs are 1. AND gate gives 0 results if any one of input in given data is 0. AND gate performs multiplication option on all inputs operands. It is represented by ‘.’ symbol. We can write it as- X=A.B or X=A.B.C.
NOT gate 


Not gate is used to reverse the result of gates or reverse Boolean state from 0 to 1 and 1 to 0.Not gate is also used with ‘AND’ and ‘OR’ gate. While using with AND or ‘OR’ gate, NOT gate is representing an as small circle in front of both gates. After using NOT gate, AND gates convert into NAND or ‘OR’ gate convert into NOR.
XOR gate (Exclusive - OR)


XOR gate can take two or more inputs. The output of XOR gate is always 1 if both of the inputs are different and 0 if all the inputs are same. 

3.) Memory or Storage Unit

Registers: 

Registers provide fast memory access as a comparison to cache, RAM, hard disk. They are built on CPU. Register are small in size. Processing Intermediate data stored in registers.A number of registers used for specific purpose. ALU used four general purpose register. All these four registers are 16-bit register is divided into registers. 16-bit register implies that register can store maximum 16 bit of data.

Accumulator : 

Accumulator is 16 bit by default and general purpose register. By default means that any operand in instruction does not specify a particular register for holding the operand. That time operand will automatically store in AC. AC is used as two separate registers of 7 bit AL and AH. AC located inside the ALU. Intermediate data and result after execution will store in AC. AC used MBR to deal with memory.

Program Counter:

PC stands for program counter. It is 16-bit register. It counts the number of instruction left for execution. It acts as a pointer for instructions and also known as Instruction pointer register. PC holds the address of next instruction to be executed. When an instruction is fetched from the register. Register get automatically incremented by one and point to the address of next instruction.

Memory Address Register: 

Address register holds the address of memory where data is residing. CPU fetches the address from the register and access the location to acquire data. In the same way, MAR is used to write the data into memory.
Data Register: Data registers also Known as Memory Data Register. It holds the content or instruction fetched from memory location for reading and writing purpose. It is 16-bit register means that can store 216bytes of data. From Data, register instruction moves in Instruction register and data content moves to AC for manipulation.
Instruction register: 

Instruction holds the instruction to be executed .control unit of CPU fetch the instruction, decode it and execute the instruction by accessing appropriate content.IR is 16-bit register. It has two fields – Opcode and operand.
PC holds the address of the instruction to be executed. Once the address is fetched it gets incremented by 1.PC hold the address of next instructions. In this situation, IR holds the address of the current instruction.

Input /output register:

Input register holds the input from input devices and output register hold the output that has to give to output devices.

Flag register : 

it is also known as a Status register or Program Status register. Flag register holds the Boolean value of status word used by the process.

Auxiliary Flag : if two numbers are to be added such that if in the beginning of higher bit there is a carry. This is known as auxiliary bit.

Carry bit : Carry bit is indicate the most significant borrow or carry bit by subtracting a greater number than a smaller number or adding two numbers.

Sign Bit : Sign bit is a most significant bit in 2’s complement to show that result is negative or positive. It is also known as negative bit. If the final carry over here after the sum of last most significant bit is 1, it is dropped and the result is positive.
If there is no carry over here then 2’s complement will negative and negative bit set as 1.

Overflow bit : Overflow bit used to indicate that stack is overflow or not after processing the instruction. It is set to be 1 means that stack is overflow if it is 0 then its reverse to happen.

Parity Bit : Parity bit represent odd or even set of ’1’ bits in given string. It is used as error detecting code. Parity bit has two types: Even parity bit and an Odd parity bit.
In Even parity bit, we count the occurrence of 1’s in the string. If a number of 1 bit is odd in counting than we will add even parity bit to make it even or if the number of 1 bit are even then even parity bit is 0.

  Data        Number of 1 bits     even parity bit    Data including Even Parity bit
1010111            5                         1                                11010111


SHARE

Ved Prakash

Hello guys, I am Ved, from Dehradun, A MCA student of Graphic Era University Dehradun. Graduated with BCA In 2014 from VEER KUNWAR SINGH University. My Professional Career Start Early At My 2nd University Year of BCA, Utilizing My Passion for Computer System, I Start Working as Computer Teacher at Unisoft Solutions. I spend most of my free time reading books, articles and papers. Hundreds of books and thousands of hours serving online helped me expand my knowledge of the world and improve my understanding of what, I do..

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment