SlideShare a Scribd company logo
ْ‫ح‬‫ه‬‫الر‬ ِ ‫ه‬‫اَّلل‬ ِ‫م‬ْ‫س‬ِ‫ب‬ِ‫ح‬‫ه‬‫الر‬ ِِ‫ن‬‫َم‬‫م‬
COMSATS Institute of information
technology
 Presentation Of COAL
 Presented by
Faiqa Saleem
Instruction Cycles
 Instruction is command which is given by the user to computer.
 An instruction cycle (sometimes called a fetch–decode–execute cycle) is the basic
operational process of a computer.
 It is the process by which a computer retrieves a program instruction from its
memory, determines what actions the instruction dictates, and carries out those
actions.
Continue ….
 Each instruction is further divided into sequence of
phases.
 After the execution the program counter is
incremented to point to the next instruction .
Components
 Program counter (PC)
 Memory address register (MAR)
 Memory data register (MDR)
 Instruction register (IR)
 Control unit (CU)
 Arithmetic logic unit (ALU)
 Floating point unit (FPU)
Program counter & memory address
 An incrementing counter that keeps track of the memory address of the instruction
that is to be executed next or in other words, holds the address of the instruction to
be executed next.
Memory address register (MAR)
 Holds the address of a block of memory for reading from or writing to.
Instruction register & Control unit
IR
A temporary holding ground for the instruction that has just been fetched
from memory.
Cu
Decodes the program instruction in the IR, selecting machine
resources, such as a data source register and a particular arithmetic
operation, and coordinates activation of those resources.
Memory data register & Arithmetic logic
unit
MDR
 A two-way register that holds data fetched from memory (and ready for the CPU to process)
or data waiting to be stored in memory. (This is also known as the memory buffer
register (MBR)
ALU
 Performs mathematical and logical operations.
 + - / * %
Floating point unit (FPU)
 Performs floating-point operations.
 Typical operations are addition, subtraction, multiplication, division, square root,
and bit shifting.
 Some systems (particularly older, microcode-based architectures) can also
perform various transcendental functions
 such as exponential or trigonometric calculations, though in most modern
processors these are done with software library routines.
Phases
 Fetch an instruction from memory
 Decode the instruction
 Read effective address
 Execute the instruction
Fetch an instruction from memory
 The next instruction is fetched from the memory address that is currently
stored in the program counter (PC), and stored in the instruction register (IR).
 At the end of the fetch operation, the PC points to the next instruction that will
be read at the next cycle.
Steps
 The CPU sends the PC to the MAR and sends a read command on the address bus
 In response to the read command (with address equal to PC), the memory returns
the data stored at the memory location indicated by PC on the data bus
 The CPU copies the data from the data bus into its MDR (also known as MBR, see
section components.
Continue …
 A fraction of a second later, the CPU copies the data from the MDR to the
instruction register (IR)
 The PC is incremented so that it points to the following instruction in memory.
This step prepares the CPU for the next cycle.
Decode the instruction
 Step 2 of the instruction Cycle is called the Decode Cycle.
 The decoding process allows the CPU to determine what instruction is to be
performed, so that the CPU can tell how many operands it needs to fetch in
order to perform the instruction.
 The op code fetched from the memory is decoded for the next steps and
moved to the appropriate registers. The decoding is done by the CPU.
 During this cycle the encoded instruction present in the IR is interpreted by the
decoder.
Read effective address
 In case of a memory instruction (direct or indirect) the execution phase will be
in the next clock pulse.
 If the instruction has an direct address the effective address is read from main
memory, and any required data is fetched from main memory to be processed
and then placed into data registers .
 If the instruction is direct, nothing is done at this clock pulses. If this is an I/O
instruction or a Register instruction, the operation is performed.
Execute the instruction
 Step 4 of the Instruction Cycle is the Execute Cycle.
 Here, the function of the instruction is performed. If the instruction involves
arithmetic or logic, the Arithmetic Logic Unit is utilized.
 This is the only stage of the instruction cycle that is useful from the perspective
of the end user.
 Everything else is overhead required to make the execute phase happen.
 reading values from registers, passing them to the ALU to perform mathematical
or logic functions on them, and writing the result back to a register. If the ALU is
involved, it sends a condition signal back to the CU.

More Related Content

What's hot

Memory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycleMemory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycle
chantellemallia
 
instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
sheetal singh
 
Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycle
Muhammad Ameer Mohavia
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
neclinux
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
mekind
 

What's hot (20)

Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
 
Instruction cycle with interrupts
Instruction cycle with interruptsInstruction cycle with interrupts
Instruction cycle with interrupts
 
Memory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycleMemory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycle
 
instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
 
Computer Organisation (DFT1113)
Computer Organisation (DFT1113)Computer Organisation (DFT1113)
Computer Organisation (DFT1113)
 
Coal 10 instruction cycle and interrupts in Assembly Programming
Coal 10 instruction cycle and interrupts in Assembly ProgrammingCoal 10 instruction cycle and interrupts in Assembly Programming
Coal 10 instruction cycle and interrupts in Assembly Programming
 
Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycle
 
Fetch execute cycle
Fetch execute cycleFetch execute cycle
Fetch execute cycle
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Cs intro-ca
Cs intro-caCs intro-ca
Cs intro-ca
 
Program execution
Program executionProgram execution
Program execution
 
CPU & RAM
CPU & RAMCPU & RAM
CPU & RAM
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
INSTRUCTION CYCLE
INSTRUCTION CYCLEINSTRUCTION CYCLE
INSTRUCTION CYCLE
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Run time, frequently, non-frequently reconfigurable system &
Run time, frequently, non-frequently reconfigurable system &Run time, frequently, non-frequently reconfigurable system &
Run time, frequently, non-frequently reconfigurable system &
 
Program control
Program controlProgram control
Program control
 
Fetch Execute Cycle
Fetch Execute CycleFetch Execute Cycle
Fetch Execute Cycle
 
Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
 

Similar to instruction cycle

Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
Kumar
 

Similar to instruction cycle (20)

Instruction Cycle in Computer Organization.pptx
Instruction Cycle in Computer Organization.pptxInstruction Cycle in Computer Organization.pptx
Instruction Cycle in Computer Organization.pptx
 
Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Control Unit (CU) – Part 2
Control Unit (CU) – Part 2
 
COMPUTER_ORGANIZATION.ppt
COMPUTER_ORGANIZATION.pptCOMPUTER_ORGANIZATION.ppt
COMPUTER_ORGANIZATION.ppt
 
Computer Organization (1).pdf
Computer Organization (1).pdfComputer Organization (1).pdf
Computer Organization (1).pdf
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Processor Basics
Processor BasicsProcessor Basics
Processor Basics
 
cpuorganisation-140723043011-phpapp02.pdf
cpuorganisation-140723043011-phpapp02.pdfcpuorganisation-140723043011-phpapp02.pdf
cpuorganisation-140723043011-phpapp02.pdf
 
Operating system
Operating systemOperating system
Operating system
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
03. top level view of computer function & interconnection
03. top level view of computer function & interconnection03. top level view of computer function & interconnection
03. top level view of computer function & interconnection
 
Assembly language
Assembly languageAssembly language
Assembly language
 
Bca examination 2015 csa
Bca examination 2015 csaBca examination 2015 csa
Bca examination 2015 csa
 
Cpu
CpuCpu
Cpu
 
INSTRUCTION TYPES
INSTRUCTION TYPESINSTRUCTION TYPES
INSTRUCTION TYPES
 
Central Processing Unit (Instruction Circle)
Central Processing Unit (Instruction Circle)Central Processing Unit (Instruction Circle)
Central Processing Unit (Instruction Circle)
 
Intro to cao &store program
Intro to cao &store programIntro to cao &store program
Intro to cao &store program
 
25 e
25 e25 e
25 e
 
computer architecture and the fetch execute cycle By ZAK
computer architecture and the fetch execute cycle By ZAKcomputer architecture and the fetch execute cycle By ZAK
computer architecture and the fetch execute cycle By ZAK
 
1.3.2 computer architecture and the fetch execute cycle By ZAK
1.3.2 computer architecture and the fetch execute cycle By ZAK1.3.2 computer architecture and the fetch execute cycle By ZAK
1.3.2 computer architecture and the fetch execute cycle By ZAK
 
COMPUTER_ORGANIZATION (1).pptx
COMPUTER_ORGANIZATION (1).pptxCOMPUTER_ORGANIZATION (1).pptx
COMPUTER_ORGANIZATION (1).pptx
 

More from faiqa saleem (9)

Alchemist novl presntation by faiqa saleem
Alchemist novl presntation by faiqa saleemAlchemist novl presntation by faiqa saleem
Alchemist novl presntation by faiqa saleem
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
manage teams
manage teams manage teams
manage teams
 
auditory model
auditory modelauditory model
auditory model
 
Presntation
PresntationPresntation
Presntation
 
Advancement in technology
Advancement in technologyAdvancement in technology
Advancement in technology
 
Motivation
MotivationMotivation
Motivation
 
Indian culture
Indian culture Indian culture
Indian culture
 
Actual meaning-of-change
Actual meaning-of-changeActual meaning-of-change
Actual meaning-of-change
 

Recently uploaded

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
YibeltalNibretu
 

Recently uploaded (20)

The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 

instruction cycle

  • 1. ْ‫ح‬‫ه‬‫الر‬ ِ ‫ه‬‫اَّلل‬ ِ‫م‬ْ‫س‬ِ‫ب‬ِ‫ح‬‫ه‬‫الر‬ ِِ‫ن‬‫َم‬‫م‬
  • 2. COMSATS Institute of information technology  Presentation Of COAL  Presented by Faiqa Saleem
  • 3. Instruction Cycles  Instruction is command which is given by the user to computer.  An instruction cycle (sometimes called a fetch–decode–execute cycle) is the basic operational process of a computer.  It is the process by which a computer retrieves a program instruction from its memory, determines what actions the instruction dictates, and carries out those actions.
  • 4. Continue ….  Each instruction is further divided into sequence of phases.  After the execution the program counter is incremented to point to the next instruction .
  • 5. Components  Program counter (PC)  Memory address register (MAR)  Memory data register (MDR)  Instruction register (IR)  Control unit (CU)  Arithmetic logic unit (ALU)  Floating point unit (FPU)
  • 6. Program counter & memory address  An incrementing counter that keeps track of the memory address of the instruction that is to be executed next or in other words, holds the address of the instruction to be executed next. Memory address register (MAR)  Holds the address of a block of memory for reading from or writing to.
  • 7. Instruction register & Control unit IR A temporary holding ground for the instruction that has just been fetched from memory. Cu Decodes the program instruction in the IR, selecting machine resources, such as a data source register and a particular arithmetic operation, and coordinates activation of those resources.
  • 8. Memory data register & Arithmetic logic unit MDR  A two-way register that holds data fetched from memory (and ready for the CPU to process) or data waiting to be stored in memory. (This is also known as the memory buffer register (MBR) ALU  Performs mathematical and logical operations.  + - / * %
  • 9. Floating point unit (FPU)  Performs floating-point operations.  Typical operations are addition, subtraction, multiplication, division, square root, and bit shifting.  Some systems (particularly older, microcode-based architectures) can also perform various transcendental functions  such as exponential or trigonometric calculations, though in most modern processors these are done with software library routines.
  • 10. Phases  Fetch an instruction from memory  Decode the instruction  Read effective address  Execute the instruction
  • 11. Fetch an instruction from memory  The next instruction is fetched from the memory address that is currently stored in the program counter (PC), and stored in the instruction register (IR).  At the end of the fetch operation, the PC points to the next instruction that will be read at the next cycle.
  • 12. Steps  The CPU sends the PC to the MAR and sends a read command on the address bus  In response to the read command (with address equal to PC), the memory returns the data stored at the memory location indicated by PC on the data bus  The CPU copies the data from the data bus into its MDR (also known as MBR, see section components.
  • 13. Continue …  A fraction of a second later, the CPU copies the data from the MDR to the instruction register (IR)  The PC is incremented so that it points to the following instruction in memory. This step prepares the CPU for the next cycle.
  • 14. Decode the instruction  Step 2 of the instruction Cycle is called the Decode Cycle.  The decoding process allows the CPU to determine what instruction is to be performed, so that the CPU can tell how many operands it needs to fetch in order to perform the instruction.  The op code fetched from the memory is decoded for the next steps and moved to the appropriate registers. The decoding is done by the CPU.  During this cycle the encoded instruction present in the IR is interpreted by the decoder.
  • 15. Read effective address  In case of a memory instruction (direct or indirect) the execution phase will be in the next clock pulse.  If the instruction has an direct address the effective address is read from main memory, and any required data is fetched from main memory to be processed and then placed into data registers .  If the instruction is direct, nothing is done at this clock pulses. If this is an I/O instruction or a Register instruction, the operation is performed.
  • 16. Execute the instruction  Step 4 of the Instruction Cycle is the Execute Cycle.  Here, the function of the instruction is performed. If the instruction involves arithmetic or logic, the Arithmetic Logic Unit is utilized.  This is the only stage of the instruction cycle that is useful from the perspective of the end user.  Everything else is overhead required to make the execute phase happen.  reading values from registers, passing them to the ALU to perform mathematical or logic functions on them, and writing the result back to a register. If the ALU is involved, it sends a condition signal back to the CU.