SlideShare a Scribd company logo
2
Most read
5
Most read
22
Most read
Cpu & its execution of instruction
CPU & ITS EXECUTION OF
INSTRUCTION
Rajishma T
rajishmatnair@gmail.com
www.facebook.com/
Rajishma T Nair
twitter.com/username
in.linkedin.com/in/profilena
me
9020217968
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
CPU
• Cpu or central processing unit is the brain of
every computer.
• Structure of a cpu:
• ALU
– The arithmatic/logic unit contains electronic circuitry that
executes all arithmatic and logical operations.
• CONTROL UNIT
– The control unit of the CPU contains cicuitry that uses
electrical signals to direct the entire computer system to carry
out,or execute,stored program instructions.
– The control unit must communicate with both the
arithmetic/logic unit and memory.
System bus
• Control bus
– The control bus is used by the CPU to direct and monitor the
actions of the other functional areas of the computer.
• Address bus
– The address bus consists of all the signals necessary to define any
of the possible memory address locations within the computer.
– The control bus is used by the CPU to direct and monitor the
actions of the other functional areas of the computer.
• Data Bus
– The bidirectional data bus, sometimes called the memory
bus, handles the transfer of all data and instructions between
functional areas of the computer.
Registers
• General purpose registers:
– A general purpose register is a memory cell.
– Each general purpose register has a unique name
– It is used to store intermediate result of complex computation
• Accumulator
– This Register is used for storing the Results those are produced by the
System..
• Instruction register:
– Instruction register Contains the current instruction being executed by
the CPU.
– The CPU will perform the operation indicated by the instruction code
contained in the instruction register.
• MAR(memory address register):
– This register holds the memory addresses of data and instructions.
– This regster is used to access data and instructions from memory during
the execution of an instruction.
• MDR(Memory data register)
– It is the register that contains the data to be stored in the
computer storage or data after a fetch from the computer
storage.
– It acts like a buffer and holds anything that is copied from the
memory ready for the processor to use it,
• Index register:
– A hardware element which holds a number that can be added
to (or, in some cases, subtracted from) the address portion of
a computer instruction to form an effective address.
– An index register in a computer's CPU is a processor register
used for modifying operand addresses during the run of a
program.
• Data register:
– A register used in microcomputers to temporarily store data
being transmitted to or from a peripheral device.
• Program counter:
– This register contains the address of the next instruction
– The value in the program counter will be increased after the
cpu finishes executing one instruction.
• Process status register:
– This register contains the various information about the cpu.
– For ex: the result of a comparison operation.
– When the CPU compares 2 numbers a and b the outcome of
the 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
• Equal
• Not equal
• Greater than
• Greater than or equal
• Less than
• Less than or equal
Types of instruction
• Cpu executes following 3 types of instructions
• Arithmatic and logic operation
• Eg: +,-,and,or
• The result of an arithmatic operation is often stored
in general purpose registers.
• Memory transfer instruction
• Transfer the content from some specific memory
location to a specific register(memory cell) in the cpu
and vice versa
• Branch instructions
– A branch instruction will cause the cpu to branch or jump to
the specified location in memory.
– after the jump has occurred the cpu will continue to execute
the instructions in sequence until another branch or jump
instruction is encountered
– There are two types of branch instructions:
• A unconditional branch instruction always cause
the cpu to jump to the target location.
• A conditional branch instruction will only cause
the cpu to jump to the target location when the
specified condition is met.
Instruction execution cycle
• Fetch the instruction
• Decode the instruction
• Execute the instruction
• Store the instruction
fetch
1. Load the address of next instruction in the PC into the MAR.
– So that the control unit can fetch the instruction from the right part
of the memory.
2. Copy the instruction/data that is in the memory address
given by the MAR into the MDR.
– MDR is used whenever anything is to go from the CPU to main
memory, or vice versa.
3. Increment the PC by 1.
– So that it contains the address of the next instruction, assuming that
the instructions are in consecutive locations.
4. Load the instruction/data that is now in the MDR into the IR.
– Thus the next instruction is copied from memory -> MDR -> IR.
decode
1. Contents of IR split into operation code and
address if present e.g. store, add or jump
instructions.
2. Decode the instruction that is in the IR
execute
• If the instruction is a jump instruction then
– Load the address part of the instruction in the IR into the PC.
• If the instruction is an input / load (directly) instruction then
take data input and place in accumulator.
• If the instruction is a load (from memory) instruction.
– Copy address part of the instruction (to load from) in the IR into MAR.
– Copy data from memory address held in MAR to MDR.
– Copy data in MDR into accumulator
• Execute contd
• If the instruction is a store instruction then:
– Copy address part of the instruction (to store in) in the IR into MAR.
– Copy data in accumulator to MDR.
– Copy data in MDR into memory address held in MAR.
• If the instruction is an add instruction then:
– Copy address part of the instruction (of number to add) in the IR
into MAR.
– Copy number from memory address held in MAR into MDR.
– Add number in MDR to number in accumulator (accumulator will
now hold the result).
• If the instruction is an output (from memory) instruction
then:
– Copy address part of part of the instruction (of data to output) in IR
into MAR.
– Output contents of MDR.
Store the output
• Result of calculations in cpu stored in main
memory or sent to output devices.
• program Counter could be updated to a new
address
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

More Related Content

PPTX
Microprogrammed Control Unit
PPTX
Register organization, stack
PPTX
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
PPS
Interrupts
PPS
Timing and-control-unit
PPTX
Basic Computer Organization and Design
PDF
COMPUTER ORGANIZATION NOTES Unit 7
Microprogrammed Control Unit
Register organization, stack
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
Interrupts
Timing and-control-unit
Basic Computer Organization and Design
COMPUTER ORGANIZATION NOTES Unit 7

What's hot (20)

PPT
Instruction cycle
PPT
Instruction codes and computer registers
PPTX
General register organization (computer organization)
PPT
Registers
PPTX
Unit-4 (IO Interface).pptx
PPTX
Register transfer language
PPT
Pipeline hazards in computer Architecture ppt
PPTX
Input Output Organization
PPT
Data transfer and manipulation
PPTX
Risc and cisc
PDF
R&c
PPTX
Computer registers
PPT
Types of instructions
PPTX
CS304PC:Computer Organization and Architecture Session 11 general register or...
PPTX
PIC-18 Microcontroller
PPTX
Instruction set of 8085 microprocessor
PPTX
DMA and DMA controller
PPTX
INTERCONNECTION STRUCTURE
PDF
Pipelining
Instruction cycle
Instruction codes and computer registers
General register organization (computer organization)
Registers
Unit-4 (IO Interface).pptx
Register transfer language
Pipeline hazards in computer Architecture ppt
Input Output Organization
Data transfer and manipulation
Risc and cisc
R&c
Computer registers
Types of instructions
CS304PC:Computer Organization and Architecture Session 11 general register or...
PIC-18 Microcontroller
Instruction set of 8085 microprocessor
DMA and DMA controller
INTERCONNECTION STRUCTURE
Pipelining
Ad

Viewers also liked (10)

PDF
New Coding Vocabulary
PPTX
Ch1 introducing computer systems
PPT
Fetch Execute Cycle
PPTX
instruction cycle ppt
PDF
Instruction cycle
PPS
Computer instructions
PPTX
Introduction to computer
PPT
Cpu ppt cse
PDF
Introduction to Computers
PPTX
Computer networking devices
New Coding Vocabulary
Ch1 introducing computer systems
Fetch Execute Cycle
instruction cycle ppt
Instruction cycle
Computer instructions
Introduction to computer
Cpu ppt cse
Introduction to Computers
Computer networking devices
Ad

Similar to Cpu & its execution of instruction (20)

PPTX
Cpu and its execution statements
PPTX
Cpu & its execution of instruction
PPTX
CPU and its execution of instruction
PPTX
oLecture09-Internal Organization of CPU.pptx
PPTX
basicfunctionalunit-190124043726555.pptx
PPTX
Computer architecture chapter 5 bca.pptx
PDF
CPU Architecture
PPTX
Chapter 3 Assembly level machine organization Assembly level machine organiza...
PDF
Central processing unit i
PDF
embedded system and computer architecure
PPT
Presentation of mpu
PPT
Unit2 control unit
PPTX
Computer Architecture - Program Execution
PPT
Data path of Computer Architecture ALU and other components
PPTX
lecture2.pptx
PPTX
computer organisation and architecture Module 2.pptx
PPT
Introduction to C programing for problem
Cpu and its execution statements
Cpu & its execution of instruction
CPU and its execution of instruction
oLecture09-Internal Organization of CPU.pptx
basicfunctionalunit-190124043726555.pptx
Computer architecture chapter 5 bca.pptx
CPU Architecture
Chapter 3 Assembly level machine organization Assembly level machine organiza...
Central processing unit i
embedded system and computer architecure
Presentation of mpu
Unit2 control unit
Computer Architecture - Program Execution
Data path of Computer Architecture ALU and other components
lecture2.pptx
computer organisation and architecture Module 2.pptx
Introduction to C programing for problem

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
KodekX | Application Modernization Development
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Understanding_Digital_Forensics_Presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KodekX | Application Modernization Development
Unlocking AI with Model Context Protocol (MCP)
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
Modernizing your data center with Dell and AMD
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Cpu & its execution of instruction

  • 2. CPU & ITS EXECUTION OF INSTRUCTION Rajishma T rajishmatnair@gmail.com www.facebook.com/ Rajishma T Nair twitter.com/username in.linkedin.com/in/profilena me 9020217968
  • 3. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 4. CPU • Cpu or central processing unit is the brain of every computer. • Structure of a cpu:
  • 5. • ALU – The arithmatic/logic unit contains electronic circuitry that executes all arithmatic and logical operations. • CONTROL UNIT – The control unit of the CPU contains cicuitry that uses electrical signals to direct the entire computer system to carry out,or execute,stored program instructions. – The control unit must communicate with both the arithmetic/logic unit and memory.
  • 6. System bus • Control bus – The control bus is used by the CPU to direct and monitor the actions of the other functional areas of the computer. • Address bus – The address bus consists of all the signals necessary to define any of the possible memory address locations within the computer. – The control bus is used by the CPU to direct and monitor the actions of the other functional areas of the computer. • Data Bus – The bidirectional data bus, sometimes called the memory bus, handles the transfer of all data and instructions between functional areas of the computer.
  • 7. Registers • General purpose registers: – A general purpose register is a memory cell. – Each general purpose register has a unique name – It is used to store intermediate result of complex computation • Accumulator – This Register is used for storing the Results those are produced by the System..
  • 8. • Instruction register: – Instruction register Contains the current instruction being executed by the CPU. – The CPU will perform the operation indicated by the instruction code contained in the instruction register. • MAR(memory address register): – This register holds the memory addresses of data and instructions. – This regster is used to access data and instructions from memory during the execution of an instruction.
  • 9. • MDR(Memory data register) – It is the register that contains the data to be stored in the computer storage or data after a fetch from the computer storage. – It acts like a buffer and holds anything that is copied from the memory ready for the processor to use it, • Index register: – A hardware element which holds a number that can be added to (or, in some cases, subtracted from) the address portion of a computer instruction to form an effective address. – An index register in a computer's CPU is a processor register used for modifying operand addresses during the run of a program.
  • 10. • Data register: – A register used in microcomputers to temporarily store data being transmitted to or from a peripheral device. • Program counter: – This register contains the address of the next instruction – The value in the program counter will be increased after the cpu finishes executing one instruction.
  • 11. • Process status register: – This register contains the various information about the cpu. – For ex: the result of a comparison operation. – When the CPU compares 2 numbers a and b the outcome of the 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 • Equal • Not equal • Greater than • Greater than or equal • Less than • Less than or equal
  • 12. Types of instruction • Cpu executes following 3 types of instructions • Arithmatic and logic operation • Eg: +,-,and,or • The result of an arithmatic operation is often stored in general purpose registers. • Memory transfer instruction • Transfer the content from some specific memory location to a specific register(memory cell) in the cpu and vice versa
  • 13. • Branch instructions – A branch instruction will cause the cpu to branch or jump to the specified location in memory. – after the jump has occurred the cpu will continue to execute the instructions in sequence until another branch or jump instruction is encountered – There are two types of branch instructions: • A unconditional branch instruction always cause the cpu to jump to the target location. • A conditional branch instruction will only cause the cpu to jump to the target location when the specified condition is met.
  • 14. Instruction execution cycle • Fetch the instruction • Decode the instruction • Execute the instruction • Store the instruction
  • 15. fetch 1. Load the address of next instruction in the PC into the MAR. – So that the control unit can fetch the instruction from the right part of the memory. 2. Copy the instruction/data that is in the memory address given by the MAR into the MDR. – MDR is used whenever anything is to go from the CPU to main memory, or vice versa. 3. Increment the PC by 1. – So that it contains the address of the next instruction, assuming that the instructions are in consecutive locations. 4. Load the instruction/data that is now in the MDR into the IR. – Thus the next instruction is copied from memory -> MDR -> IR.
  • 16. decode 1. Contents of IR split into operation code and address if present e.g. store, add or jump instructions. 2. Decode the instruction that is in the IR
  • 17. execute • If the instruction is a jump instruction then – Load the address part of the instruction in the IR into the PC. • If the instruction is an input / load (directly) instruction then take data input and place in accumulator. • If the instruction is a load (from memory) instruction. – Copy address part of the instruction (to load from) in the IR into MAR. – Copy data from memory address held in MAR to MDR. – Copy data in MDR into accumulator
  • 18. • Execute contd • If the instruction is a store instruction then: – Copy address part of the instruction (to store in) in the IR into MAR. – Copy data in accumulator to MDR. – Copy data in MDR into memory address held in MAR. • If the instruction is an add instruction then: – Copy address part of the instruction (of number to add) in the IR into MAR. – Copy number from memory address held in MAR into MDR. – Add number in MDR to number in accumulator (accumulator will now hold the result).
  • 19. • If the instruction is an output (from memory) instruction then: – Copy address part of part of the instruction (of data to output) in IR into MAR. – Output contents of MDR.
  • 20. Store the output • Result of calculations in cpu stored in main memory or sent to output devices. • program Counter could be updated to a new address
  • 21. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 22. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com