SlideShare a Scribd company logo
1 of 14
Download to read offline
The role of the CPU in the
     operation of software
                 Mary Ramsay
Fetch and Execute Cycle
instruction and decoding of software solutions
Fetch-Execute Cycle:- describes the manner in which
the processor works. That is, it fetches the instruction
from primary storage, decodes the instruction, executes
the instruction and stores the result.
The CPU is made up of different parts including:
ALU – performs the arithmetic and logical operations
carried out by the processor.
Registers – (memories) which provides areas to store
results, locations of instructions. An Accumulator is one
register which stores the data currently being processed.
(like the display of a calculator)
Control unit – This coordinates all the actions of the
processor.
Specific CPU components – Program
counter
 Is a type of register that stores the location of the next instruction to be processed.

 The program counter is just like a counter used in an array.

 (used to located an array element)

 The program counter is used to locate the next the instruction and then the counter is
 increased (incremented) to point to the next instruction. See page 149 of text book.
Linking

When	
  a	
  program	
  requires	
  a	
  par0cular	
  sub	
  program,	
  its	
  address	
  is	
  incorporated	
  
into	
  the	
  program	
  by	
  a	
  transla'on	
  system	
  called	
  a	
  linker.	
  	
  
Many	
  programs	
  are	
  complied	
  at	
  a	
  modular	
  level	
  (mainline)	
  and	
  sub	
  modules.	
  A	
  
linker	
  is	
  used	
  to	
  join	
  these	
  compiled	
  modules	
  together.	
  A	
  linker	
  is	
  like	
  calling	
  a	
  
module	
  that	
  needs	
  to	
  be	
  processed	
  by	
  the	
  CPU.	
  
For	
  example	
  	
  
          1.      A	
  program	
  is	
  complied	
  and	
  translated	
  into	
  machine	
  code	
  (exe)	
  
          2.      The	
  machine	
  code	
  is	
  loaded	
  into	
  main	
  memory	
  to	
  be	
  executed.	
  
          3.      The	
  mainline	
  is	
  executed	
  first	
  –	
  with	
  the	
  use	
  of	
  a	
  linker	
  only	
  the	
  modules	
  required	
  are	
  loaded	
  
                  into	
  RAM.	
  (This	
  reduces	
  the	
  amount	
  of	
  instruc0ons	
  loaded	
  into	
  RAM	
  at	
  one	
  0me)	
  	
  
          4.      The	
  linker	
  also	
  used	
  for	
  library	
  rou0nes.	
  If	
  the	
  program	
  calls	
  a	
  library	
  rou0ne	
  it	
  is	
  only	
  called	
  
                  and	
  loaded	
  into	
  main	
  memory	
  when	
  required.	
  Again	
  this	
  saves	
  memory	
  resources.	
  
DLL’s (Dynamic Linking Libraries
  Is	
  a	
  collec0on	
  of	
  programs	
  in	
  machine	
  code	
  which	
  can	
  be	
  accessed	
  by	
  other	
  
  programs	
  to	
  perform	
  a	
  specific	
  task.	
  	
  

  	
  

  E.g	
  prin0ng	
  –	
  when	
  a	
  user	
  chooses	
  to	
  print	
  the	
  CPU	
  will	
  look	
  in	
  the	
  DLL	
  file	
  to	
  get	
  
  the	
  saved	
  machine	
  code	
  (instruc0ons)	
  to	
  print	
  rather	
  than	
  searching	
  the	
  
  translated	
  code.	
  

  	
  

  The	
  DLL	
  file	
  is	
  loaded	
  into	
  RAM	
  instead.	
  As	
  a	
  result	
  processing	
  and	
  RAM	
  
  resources	
  are	
  minimsed.	
  
Translation methods in software solutions
Advantages of a compiler
}    Compiled	
  programs	
  will	
  run	
  faster	
  than	
  those	
  that	
  have	
  been	
  interpreted	
  
      as	
  they	
  are	
  already	
  in	
  a	
  form	
  that	
  the	
  processor	
  understands.	
  

}    Compiled	
  programs	
  hide	
  the	
  code	
  from	
  view	
  so	
  that	
  it	
  is	
  more	
  difficult	
  to	
  
      determine	
  the	
  algorithms	
  used.	
  

}    A	
  compiled	
  program	
  is	
  oTen	
  a	
  lot	
  smaller	
  that	
  the	
  high-­‐level	
  code	
  that	
  
      generated	
  it.	
  

}    A	
  compiled	
  program	
  cannot	
  be	
  easily	
  modified	
  by	
  an	
  inexperienced	
  user.	
  
Disadvantages of a compiler
}    Run-­‐0me	
  errors	
  are	
  not	
  apparent	
  un0l	
  the	
  program	
  has	
  been	
  completely	
  
      compiled.	
  

}    When	
  a	
  compiled	
  program	
  is	
  modified,	
  the	
  whole	
  of	
  the	
  program	
  has	
  to	
  be	
  
      re-­‐compiled,	
  regardless	
  of	
  the	
  nature	
  of	
  the	
  modifica0on.	
  Even	
  if	
  a	
  minor	
  
      modifica0on	
  is	
  made,	
  the	
  whole	
  program	
  has	
  to	
  be	
  re-­‐compiled.	
  This	
  can	
  
      make	
  the	
  tes0ng	
  process	
  tedious.	
  
Advantages of an interpreter
}  • During testing, both run-time and translation errors
    become apparent as the code is
}  being executed. These errors may then be corrected as
    they are found. This allows the
}  programmer to more quickly debug a program, as the
    code does not need to be
}  completely translated after the changes have been made.
}  • The process of interpretation also allows the
    programmer to quickly add and remove
}  debugging aids such as flags and debugging output
    statements.
}  Disadvantages of an interpreter
}  • Programs that are interpreted will run far more slowly
    than those that have been
}  compiled, as each line of code has to be translated before
    it is executed.
}  • The code of an interpreted program is easily accessible
    to any user or other programmer.
}  This means that the illegal use of modules is easier.
}  • Programs that are interpreted will generally take up
    more storage than a similar program
}  that has been compiled.
Advantage	
  of	
  an	
  incremental	
  compiler
}    Programs	
  will	
  run	
  faster	
  than	
  those	
  of	
  an	
  interpreter;	
  
      however,	
  the	
  incremental	
  compiler	
  retains	
  the	
  advantage	
  
      for	
  a	
  programmer	
  that	
  both	
  run-­‐0me	
  and	
  syntax	
  errors	
  
      can	
  be	
  iden0fied	
  as	
  they	
  are	
  reached.	
  
	
  
Disadvantages	
  of	
  an	
  incremental	
  compiler	
  
}  Programs	
  are	
  not	
  executed	
  as	
  quickly	
  as	
  for	
  a	
  compiled	
  
     program.	
  
}  Code	
  is	
  s0ll	
  accessible	
  to	
  users	
  and	
  others.	
  

More Related Content

Viewers also liked

Maintaining Code
Maintaining CodeMaintaining Code
Maintaining CodeKelly Bauer
 
Meta Languages Railroad Diagrams
Meta Languages Railroad DiagramsMeta Languages Railroad Diagrams
Meta Languages Railroad DiagramsKelly Bauer
 
Circumference of a Circle
Circumference of a CircleCircumference of a Circle
Circumference of a Circlemary_ramsay
 
2008 Exam Questions Social And Ethical
2008 Exam Questions Social And Ethical2008 Exam Questions Social And Ethical
2008 Exam Questions Social And EthicalKelly Bauer
 
Algorithms Vs Meta Language
Algorithms Vs Meta LanguageAlgorithms Vs Meta Language
Algorithms Vs Meta LanguageKelly Bauer
 
Desk Chekcing Algorithms
Desk Chekcing AlgorithmsDesk Chekcing Algorithms
Desk Chekcing AlgorithmsKelly Bauer
 
User Interaction Design
User Interaction DesignUser Interaction Design
User Interaction DesignKelly Bauer
 
5 multimedia elements - animation
5   multimedia elements - animation5   multimedia elements - animation
5 multimedia elements - animationKelly Bauer
 
Stem 71 24 multimedia elements - graphics
Stem 71 24   multimedia elements - graphicsStem 71 24   multimedia elements - graphics
Stem 71 24 multimedia elements - graphicsKelly Bauer
 
3 multimedia elements - audio
3   multimedia elements - audio3   multimedia elements - audio
3 multimedia elements - audioKelly Bauer
 
Cmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowchartsCmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowchartskapil078
 

Viewers also liked (12)

Maintaining Code
Maintaining CodeMaintaining Code
Maintaining Code
 
Meta Languages Railroad Diagrams
Meta Languages Railroad DiagramsMeta Languages Railroad Diagrams
Meta Languages Railroad Diagrams
 
Cmyk vs rgb
Cmyk vs rgbCmyk vs rgb
Cmyk vs rgb
 
Circumference of a Circle
Circumference of a CircleCircumference of a Circle
Circumference of a Circle
 
2008 Exam Questions Social And Ethical
2008 Exam Questions Social And Ethical2008 Exam Questions Social And Ethical
2008 Exam Questions Social And Ethical
 
Algorithms Vs Meta Language
Algorithms Vs Meta LanguageAlgorithms Vs Meta Language
Algorithms Vs Meta Language
 
Desk Chekcing Algorithms
Desk Chekcing AlgorithmsDesk Chekcing Algorithms
Desk Chekcing Algorithms
 
User Interaction Design
User Interaction DesignUser Interaction Design
User Interaction Design
 
5 multimedia elements - animation
5   multimedia elements - animation5   multimedia elements - animation
5 multimedia elements - animation
 
Stem 71 24 multimedia elements - graphics
Stem 71 24   multimedia elements - graphicsStem 71 24   multimedia elements - graphics
Stem 71 24 multimedia elements - graphics
 
3 multimedia elements - audio
3   multimedia elements - audio3   multimedia elements - audio
3 multimedia elements - audio
 
Cmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowchartsCmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowcharts
 

Similar to CPU Role Fetch Execute

PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxAliyahAli19
 
Hm system programming class 1
Hm system programming class 1Hm system programming class 1
Hm system programming class 1Hitesh Mohapatra
 
The Role Of The Cpu
The Role Of The CpuThe Role Of The Cpu
The Role Of The Cpugavhays
 
C program execution and algorithm
C program execution and algorithm C program execution and algorithm
C program execution and algorithm Kunal Pandhram
 
Computer software and operating system
Computer software and operating systemComputer software and operating system
Computer software and operating systemsonykhan3
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program executionRumman Ansari
 
system prgramming - loaders-linkers.pdf
system prgramming - loaders-linkers.pdfsystem prgramming - loaders-linkers.pdf
system prgramming - loaders-linkers.pdfSATHYABAMAMADHANKUMA
 
EVOLUTION OF SYSTEM
EVOLUTION OF SYSTEM EVOLUTION OF SYSTEM
EVOLUTION OF SYSTEM Sahil Garg
 
Neethu Narayanan- Operating System
 Neethu Narayanan- Operating System Neethu Narayanan- Operating System
Neethu Narayanan- Operating System19940213
 
Loaders ( system programming )
Loaders ( system programming ) Loaders ( system programming )
Loaders ( system programming ) Adarsh Patel
 
SPCC:System programming and compiler construction
SPCC:System programming and compiler constructionSPCC:System programming and compiler construction
SPCC:System programming and compiler constructionmohdumaira1
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdfRakibRahman19
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution pptKeerty Smile
 
ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)
ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)
ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)SURBHI SAROHA
 

Similar to CPU Role Fetch Execute (20)

Spr ch-01
Spr ch-01Spr ch-01
Spr ch-01
 
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
 
Hm system programming class 1
Hm system programming class 1Hm system programming class 1
Hm system programming class 1
 
The Role Of The Cpu
The Role Of The CpuThe Role Of The Cpu
The Role Of The Cpu
 
Running a Program.pdf
Running a Program.pdfRunning a Program.pdf
Running a Program.pdf
 
C program execution and algorithm
C program execution and algorithm C program execution and algorithm
C program execution and algorithm
 
Computer software and operating system
Computer software and operating systemComputer software and operating system
Computer software and operating system
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
 
system prgramming - loaders-linkers.pdf
system prgramming - loaders-linkers.pdfsystem prgramming - loaders-linkers.pdf
system prgramming - loaders-linkers.pdf
 
EVOLUTION OF SYSTEM
EVOLUTION OF SYSTEM EVOLUTION OF SYSTEM
EVOLUTION OF SYSTEM
 
Computer Software
Computer SoftwareComputer Software
Computer Software
 
Neethu Narayanan- Operating System
 Neethu Narayanan- Operating System Neethu Narayanan- Operating System
Neethu Narayanan- Operating System
 
Loaders ( system programming )
Loaders ( system programming ) Loaders ( system programming )
Loaders ( system programming )
 
SPCC:System programming and compiler construction
SPCC:System programming and compiler constructionSPCC:System programming and compiler construction
SPCC:System programming and compiler construction
 
Richa garg itm
Richa garg itmRicha garg itm
Richa garg itm
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdf
 
Chap 2_ans.pdf
Chap 2_ans.pdfChap 2_ans.pdf
Chap 2_ans.pdf
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
Reconfigurable computing
Reconfigurable computingReconfigurable computing
Reconfigurable computing
 
ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)
ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)
ESSENTIAL COMPONENTS OF COMPUTERS(UNIT 2)
 

More from mary_ramsay

RWG 5 For Mac Training Guide
RWG 5 For Mac Training GuideRWG 5 For Mac Training Guide
RWG 5 For Mac Training Guidemary_ramsay
 
All meta languages
All meta languagesAll meta languages
All meta languagesmary_ramsay
 
Sdd metalanguage
Sdd metalanguageSdd metalanguage
Sdd metalanguagemary_ramsay
 
Sorting & Extracting Data
Sorting & Extracting DataSorting & Extracting Data
Sorting & Extracting Datamary_ramsay
 
SQL Structure Query Language
SQL Structure Query LanguageSQL Structure Query Language
SQL Structure Query Languagemary_ramsay
 
URL_universal Resourse Locator
URL_universal Resourse LocatorURL_universal Resourse Locator
URL_universal Resourse Locatormary_ramsay
 
IPT Assessment Schedule 2012
IPT Assessment Schedule 2012IPT Assessment Schedule 2012
IPT Assessment Schedule 2012mary_ramsay
 
Normalisation student summary
Normalisation student summaryNormalisation student summary
Normalisation student summarymary_ramsay
 

More from mary_ramsay (10)

RWG 5 For Mac Training Guide
RWG 5 For Mac Training GuideRWG 5 For Mac Training Guide
RWG 5 For Mac Training Guide
 
Sdd HSC Summary
Sdd HSC SummarySdd HSC Summary
Sdd HSC Summary
 
All meta languages
All meta languagesAll meta languages
All meta languages
 
Sdd metalanguage
Sdd metalanguageSdd metalanguage
Sdd metalanguage
 
Sorting & Extracting Data
Sorting & Extracting DataSorting & Extracting Data
Sorting & Extracting Data
 
SQL Structure Query Language
SQL Structure Query LanguageSQL Structure Query Language
SQL Structure Query Language
 
URL_universal Resourse Locator
URL_universal Resourse LocatorURL_universal Resourse Locator
URL_universal Resourse Locator
 
IPT Assessment Schedule 2012
IPT Assessment Schedule 2012IPT Assessment Schedule 2012
IPT Assessment Schedule 2012
 
IPT HSC Summary
IPT HSC SummaryIPT HSC Summary
IPT HSC Summary
 
Normalisation student summary
Normalisation student summaryNormalisation student summary
Normalisation student summary
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

CPU Role Fetch Execute

  • 1. The role of the CPU in the operation of software Mary Ramsay
  • 2. Fetch and Execute Cycle instruction and decoding of software solutions
  • 3. Fetch-Execute Cycle:- describes the manner in which the processor works. That is, it fetches the instruction from primary storage, decodes the instruction, executes the instruction and stores the result.
  • 4. The CPU is made up of different parts including: ALU – performs the arithmetic and logical operations carried out by the processor. Registers – (memories) which provides areas to store results, locations of instructions. An Accumulator is one register which stores the data currently being processed. (like the display of a calculator) Control unit – This coordinates all the actions of the processor.
  • 5.
  • 6. Specific CPU components – Program counter Is a type of register that stores the location of the next instruction to be processed. The program counter is just like a counter used in an array. (used to located an array element) The program counter is used to locate the next the instruction and then the counter is increased (incremented) to point to the next instruction. See page 149 of text book.
  • 7. Linking When  a  program  requires  a  par0cular  sub  program,  its  address  is  incorporated   into  the  program  by  a  transla'on  system  called  a  linker.     Many  programs  are  complied  at  a  modular  level  (mainline)  and  sub  modules.  A   linker  is  used  to  join  these  compiled  modules  together.  A  linker  is  like  calling  a   module  that  needs  to  be  processed  by  the  CPU.   For  example     1.  A  program  is  complied  and  translated  into  machine  code  (exe)   2.  The  machine  code  is  loaded  into  main  memory  to  be  executed.   3.  The  mainline  is  executed  first  –  with  the  use  of  a  linker  only  the  modules  required  are  loaded   into  RAM.  (This  reduces  the  amount  of  instruc0ons  loaded  into  RAM  at  one  0me)     4.  The  linker  also  used  for  library  rou0nes.  If  the  program  calls  a  library  rou0ne  it  is  only  called   and  loaded  into  main  memory  when  required.  Again  this  saves  memory  resources.  
  • 8. DLL’s (Dynamic Linking Libraries Is  a  collec0on  of  programs  in  machine  code  which  can  be  accessed  by  other   programs  to  perform  a  specific  task.       E.g  prin0ng  –  when  a  user  chooses  to  print  the  CPU  will  look  in  the  DLL  file  to  get   the  saved  machine  code  (instruc0ons)  to  print  rather  than  searching  the   translated  code.     The  DLL  file  is  loaded  into  RAM  instead.  As  a  result  processing  and  RAM   resources  are  minimsed.  
  • 9. Translation methods in software solutions
  • 10. Advantages of a compiler }  Compiled  programs  will  run  faster  than  those  that  have  been  interpreted   as  they  are  already  in  a  form  that  the  processor  understands.   }  Compiled  programs  hide  the  code  from  view  so  that  it  is  more  difficult  to   determine  the  algorithms  used.   }  A  compiled  program  is  oTen  a  lot  smaller  that  the  high-­‐level  code  that   generated  it.   }  A  compiled  program  cannot  be  easily  modified  by  an  inexperienced  user.  
  • 11. Disadvantages of a compiler }  Run-­‐0me  errors  are  not  apparent  un0l  the  program  has  been  completely   compiled.   }  When  a  compiled  program  is  modified,  the  whole  of  the  program  has  to  be   re-­‐compiled,  regardless  of  the  nature  of  the  modifica0on.  Even  if  a  minor   modifica0on  is  made,  the  whole  program  has  to  be  re-­‐compiled.  This  can   make  the  tes0ng  process  tedious.  
  • 12. Advantages of an interpreter }  • During testing, both run-time and translation errors become apparent as the code is }  being executed. These errors may then be corrected as they are found. This allows the }  programmer to more quickly debug a program, as the code does not need to be }  completely translated after the changes have been made. }  • The process of interpretation also allows the programmer to quickly add and remove }  debugging aids such as flags and debugging output statements.
  • 13. }  Disadvantages of an interpreter }  • Programs that are interpreted will run far more slowly than those that have been }  compiled, as each line of code has to be translated before it is executed. }  • The code of an interpreted program is easily accessible to any user or other programmer. }  This means that the illegal use of modules is easier. }  • Programs that are interpreted will generally take up more storage than a similar program }  that has been compiled.
  • 14. Advantage  of  an  incremental  compiler }  Programs  will  run  faster  than  those  of  an  interpreter;   however,  the  incremental  compiler  retains  the  advantage   for  a  programmer  that  both  run-­‐0me  and  syntax  errors   can  be  iden0fied  as  they  are  reached.     Disadvantages  of  an  incremental  compiler   }  Programs  are  not  executed  as  quickly  as  for  a  compiled   program.   }  Code  is  s0ll  accessible  to  users  and  others.