SlideShare a Scribd company logo
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.
The role of the cpu in the operation
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

PPT
Oracle GoldenGate
DOC
Sap Access Risks Procedures
PDF
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫
PDF
Oracle Cloud Infrastructure:2023年2月度サービス・アップデート
PDF
PCCC20 日本オラクル株式会社「Oracle Cloud Infrastructure for HPC」
PDF
新機能によるデータベースシステムの改善ポイント
PPTX
AWS Step Functionsを使ったバックアップシステム
PDF
[온라인교육시리즈] NKS에서 Cluster & Pods Autoscaling 적용
Oracle GoldenGate
Sap Access Risks Procedures
C22 Oracle Database を監視しようぜ! by 山下正/内山義夫
Oracle Cloud Infrastructure:2023年2月度サービス・アップデート
PCCC20 日本オラクル株式会社「Oracle Cloud Infrastructure for HPC」
新機能によるデータベースシステムの改善ポイント
AWS Step Functionsを使ったバックアップシステム
[온라인교육시리즈] NKS에서 Cluster & Pods Autoscaling 적용

What's hot (20)

PDF
[C33] 24時間365日「本当に」止まらないデータベースシステムの導入 ~AlwaysOn+Qシステムで完全無停止運用~ by Nobuyuki Sa...
PDF
単なるキャッシュじゃないよ!?infinispanの紹介
PPTX
AEM Meetup Personalization with ContextHub
PPTX
WAFs.pptx
PPTX
Oracle Audit Vault and Database Vault のご紹介
PPT
oracle-reports6i
PDF
PyData NYC 2015 - Automatically Detecting Outliers with Datadog
PDF
GitLabのAutoDevOpsを試してみた
PDF
Alphorm.com Formation Elastic : Maitriser les fondamentaux
PPTX
最近のKeycloakのご紹介 ~クライアントポリシーとFAPI~
PPTX
Seasar2で作った俺たちのサービスの今
PDF
他山の石勉強会 DRBD編
PDF
04 geographies ig
PDF
Sql server よく聞く設定とその効果
PPTX
Norikra + Fluentd + Elasticsearch + Kibana リアルタイムストリーミング処理 ログ集計による異常検知
PPTX
Spring Boot ユーザの方のための Quarkus 入門
PDF
Introduction to kotlin
PPTX
L’area siro palestinese
PDF
Intrinsic Methods in HotSpot VM
PPTX
KeycloakでAPI認可に入門する
[C33] 24時間365日「本当に」止まらないデータベースシステムの導入 ~AlwaysOn+Qシステムで完全無停止運用~ by Nobuyuki Sa...
単なるキャッシュじゃないよ!?infinispanの紹介
AEM Meetup Personalization with ContextHub
WAFs.pptx
Oracle Audit Vault and Database Vault のご紹介
oracle-reports6i
PyData NYC 2015 - Automatically Detecting Outliers with Datadog
GitLabのAutoDevOpsを試してみた
Alphorm.com Formation Elastic : Maitriser les fondamentaux
最近のKeycloakのご紹介 ~クライアントポリシーとFAPI~
Seasar2で作った俺たちのサービスの今
他山の石勉強会 DRBD編
04 geographies ig
Sql server よく聞く設定とその効果
Norikra + Fluentd + Elasticsearch + Kibana リアルタイムストリーミング処理 ログ集計による異常検知
Spring Boot ユーザの方のための Quarkus 入門
Introduction to kotlin
L’area siro palestinese
Intrinsic Methods in HotSpot VM
KeycloakでAPI認可に入門する
Ad

Viewers also liked (15)

PPT
Sdd Testing & Evaluating
PPTX
6 multimedia elements - www
PPT
Error Correction Techniques
KEY
Maintaining Code
PPTX
Meta Languages Railroad Diagrams
KEY
Cmyk vs rgb
PDF
Circumference of a Circle
PPTX
2008 Exam Questions Social And Ethical
PPTX
Algorithms Vs Meta Language
PDF
Desk Chekcing Algorithms
PPT
User Interaction Design
PPTX
5 multimedia elements - animation
PPTX
Stem 71 24 multimedia elements - graphics
PPTX
3 multimedia elements - audio
PPT
Cmp104 lec 7 algorithm and flowcharts
Sdd Testing & Evaluating
6 multimedia elements - www
Error Correction Techniques
Maintaining Code
Meta Languages Railroad Diagrams
Cmyk vs rgb
Circumference of a Circle
2008 Exam Questions Social And Ethical
Algorithms Vs Meta Language
Desk Chekcing Algorithms
User Interaction Design
5 multimedia elements - animation
Stem 71 24 multimedia elements - graphics
3 multimedia elements - audio
Cmp104 lec 7 algorithm and flowcharts
Ad

Similar to The role of the cpu in the operation (20)

PPTX
Pros and cons of c as a compiler language
DOCX
COMPILER DESIGN.docx
DOC
PPTX
Compiler Design Introduction
PPTX
Language processor
PDF
Compiler Design Introduction
PPT
Introduction to C for Btech 1st year.ppt
PPT
computer languages
PPTX
Phases of Compiler.pptx
PDF
Module4.pdf ,...................................
PPTX
Chapter 5-programming
PPTX
Agro informatics centre up State of Lec 6.pptx
PPTX
IT ppt (Computer Languages).ppt, computer languages
PDF
Lecture 01 introduction to compiler
PPTX
Computer Programming In C.pptx
PPTX
Compiler Construction
PDF
C lecture notes new
PPTX
COMPILER DESIGN OPTIONS
PDF
Unit 1
PPTX
CD module 1.pptx Introduction to compiler Design
Pros and cons of c as a compiler language
COMPILER DESIGN.docx
Compiler Design Introduction
Language processor
Compiler Design Introduction
Introduction to C for Btech 1st year.ppt
computer languages
Phases of Compiler.pptx
Module4.pdf ,...................................
Chapter 5-programming
Agro informatics centre up State of Lec 6.pptx
IT ppt (Computer Languages).ppt, computer languages
Lecture 01 introduction to compiler
Computer Programming In C.pptx
Compiler Construction
C lecture notes new
COMPILER DESIGN OPTIONS
Unit 1
CD module 1.pptx Introduction to compiler Design

More from mary_ramsay (10)

PDF
RWG 5 For Mac Training Guide
PDF
Sdd HSC Summary
PDF
All meta languages
PDF
Sdd metalanguage
PDF
Sorting & Extracting Data
PDF
SQL Structure Query Language
PDF
URL_universal Resourse Locator
PDF
IPT Assessment Schedule 2012
PDF
IPT HSC Summary
PDF
Normalisation student summary
RWG 5 For Mac Training Guide
Sdd HSC Summary
All meta languages
Sdd metalanguage
Sorting & Extracting Data
SQL Structure Query Language
URL_universal Resourse Locator
IPT Assessment Schedule 2012
IPT HSC Summary
Normalisation student summary

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PPTX
A Presentation on Artificial Intelligence
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Approach and Philosophy of On baking technology
OMC Textile Division Presentation 2021.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Group 1 Presentation -Planning and Decision Making .pptx
NewMind AI Weekly Chronicles - August'25-Week II
Encapsulation_ Review paper, used for researhc scholars
Spectral efficient network and resource selection model in 5G networks
Assigned Numbers - 2025 - Bluetooth® Document
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
A Presentation on Artificial Intelligence
Building Integrated photovoltaic BIPV_UPV.pdf
Mushroom cultivation and it's methods.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Getting Started with Data Integration: FME Form 101
A comparative study of natural language inference in Swahili using monolingua...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

The role of the cpu in the operation

  • 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.
  • 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.