The role of the cpu in the operation
Upcoming SlideShare
Loading in...5
×
 

The role of the cpu in the operation

on

  • 477 views

 

Statistics

Views

Total Views
477
Views on SlideShare
388
Embed Views
89

Actions

Likes
0
Downloads
6
Comments
0

1 Embed 89

http://sddhsc2012.wikispaces.com 89

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

The role of the cpu in the operation The role of the cpu in the operation Presentation Transcript

  • The role of the CPU in the operation of software Mary Ramsay
  • Fetch and Execute Cycleinstruction and decoding of software solutions
  • Fetch-Execute Cycle:- describes the manner in whichthe processor works. That is, it fetches the instructionfrom primary storage, decodes the instruction, executesthe instruction and stores the result.
  • The CPU is made up of different parts including:ALU – performs the arithmetic and logical operationscarried out by the processor.Registers – (memories) which provides areas to storeresults, locations of instructions. An Accumulator is oneregister which stores the data currently being processed.(like the display of a calculator)Control unit – This coordinates all the actions of theprocessor.
  • Specific CPU components – Programcounter 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.
  • LinkingWhen  a  program  requires  a  par0cular  sub  program,  its  address  is  incorporated  into  the  program  by  a  translaon  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.