21

Cpu execution

Embed Size (px)

Citation preview

Page 1: Cpu execution
Page 2: Cpu execution

CPU EXECUTION OF STATEMENTS

ARUN RJ

[email protected]

Facebook Profile

Twitter Profile

Linkedin /ARUN RJ

Page 3: Cpu execution

Disclaimer: This presentation is prepared by trainees ofbaabtra.com as a part of mentoring program. This is notofficial document of baabtra.com – Mentoring Partner

Page 4: Cpu execution

CPU

• CPU or central processing unit is the brain of all computer.

Page 5: Cpu execution

ALU

Arithematic or Logic unit contains electronic circuitry thatexecutes all arithematic and logic operations

CONTROL UNIT

• Control unit of the cpu contains circitry that uses electricalsignals to direct the entire computer system to carry out orexecute stored program instructions

• The control unit must communicate with both the ALU andmemory

Page 6: Cpu execution

SYSTEM BUS

CONTROL BUSThe control bus is used by the computer to direct and monitor the actions of the the other functional areas of the computer

ADDRESS BUSAddress bus consists of all the signals to define any of the memory location in the computer

Page 7: Cpu execution

DATA BUSThe bi directional data bus carries all data and instructions between functional areas of computer

Page 8: Cpu execution

REGISTERS

GENERAL PURPOSE REGISTERSA general purpose register is amemory cellEach general purpose register has aunique nameIt is used to store intrmediate result of complex computation

ACCUMULATOR

This register is used for storing the results those are produced by the register

Page 9: Cpu execution

INSTRUCTION REGISTER

IR contains the current instructions being executed by the cpuThe CPU will perform the operation indicated by the instruction code contained in the IR

MAR(MEMORY ADDRESS REGISTER)

This register holds the memory address of data and instructions.This register is used to access data and instructions from memory during the execution of an instruction.

Page 10: Cpu execution

MDR(MEMORY DATA REGISTER)

It is the register that contain the data to be stored in the computer storage or data after a fetch from the computer storageIt acts like a buffer and holds anything that is copied from the memory ready for the processor to use it.

INDEX REGISTERA hardware element which holds a number that can be added to the address portion of a computer instruction to form an effective addressAn index registrer in a cpu is a register used for modifying operand address during the run of a program

Page 11: Cpu execution

DATA REGISTERA register used in microcomputers to temporarily store data being transmitted to or from a peripheral device

PROGRAM COUNTER

This register contains the address of next instructionThe value in the program counter will be increased after the cpu finishes executing one instruction

Page 12: Cpu execution

PROCESS STATUS REGISTER

This register contains the various information about the cpu.For example the result of a comparison operation.When cpu compares 2 numbers a and b the outcome of comparison is stored in the PSR.The outcome of a compare operation will allow the cpu to determine the following fact between a and b.

equalnot equalgreater thangreater than or equalless thanless than or equal

PRO

Page 13: Cpu execution

INSTRUCTION EXECUTION CYCLE

FETCH THE INSTRUCTION

DECODE THE INSTRUCTIONEXECUTE THE INSTRUCTIONSTORE THE INSTRUCTION

Page 14: Cpu execution

FETCH

1 Load the address of next instruction in the PC to MAR,sothat the control unit can fetch the instruction from right part of the memory2 Copy the instruction/data that is in the memory address given by the MAR into the MDR3 Increment the PC by 1,so thaat it contains address of next instruction,assuming that the instructions are in consequtivelocation 4 Load the instruction or data that is in the MDR into the IR

Page 15: Cpu execution

EXECUTE

If the instruction is jump instruction then,load the address part of the instruction in IR into PC

If the instruction is an input or load(directly) instruction then take input and place in accumulator

If the instruction is an a load(from memory) instruction then take input and place in accumulator

copy address of the instruction(to load from)in the IR into MAR

copy data from memory address held in MAR to MDRcopy data in MDR into accumulator

Page 16: Cpu execution

• Execute contdIf the instruction is a store instruction then:Copy address part of the instruction (to store in) in the IR in to MAR.Copy data in to accumulator to MDR.Copy data in to MDR in to memory address held in MAR.

If the instruction is a add instruction then:Copy address part of the instruction (of number to add ) in the IR in to MAR.Copy number from memory address held in MAR in to MDR.Add number in MDR to number in accumulater.

Page 17: Cpu execution

If the instruction is an output (from memory) instruction then:

Copy address part of the instruction (of data to output) in the IR

into MAR.Output contents of MDR.

Page 18: Cpu execution

STORE THE OUTPUT

Result of calculations in CPU stored in main memory or sent to output devicesProgram counter could be updated to a new address

Page 19: Cpu execution

THANK YOU

Page 20: Cpu execution

Follow us @ twitter.com/baabtra

Like us @ facebook.com/baabtra

Subscribe to us @ youtube.com/baabtra

Become a follower @ slideshare.net/BaabtraMentoringPartner

Connect to us @ in.linkedin.com/in/baabtra

Give a feedback @ massbaab.com/baabtra

Thanks in advance

www.baabtra.com | www.massbaab.com |www.baabte.com

Page 21: Cpu execution

Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

Cafit Square,Hilite Business Park,Near Pantheerankavu,Kozhikode

Start up VillageEranakulam,Kerala, India.

Email: [email protected]

Contact Us