SlideShare a Scribd company logo
1 of 40
Faculty Development Programme
             on
     Performance Tuning

           Dijesh P
         27 July 2012
Quantitative Principles of Computer
              Design
• The most important principle of computer
  design is to make the common case fast.
• That is Favor the frequent case over the
  infrequent case.
• Improving the frequent event over the
  infrequent event     will help improving
  performance.
• Amdahl’s law can be used to quantify this
  principle.
Amdahl’s Law
• States that “the performance improvement
  to be gained from using some faster mode
  of execution is limited by the time the
  faster mode can be used”.
• Amdahl’s law defines “Speedup” that can
  be gained by using a particular feature.
• We can make an enhancement to a
  machine that will improve the performance
  when it is used.
• Speedup =
  – Performance for entire task using enhancement when
    possible

  – Performance for entire task without using enhancement

  – Alternatively,
  – Speedup =
     • Execution time for entire task without using enhancement

     • Execution time for entire task using enhancement when
       possible
• Speedup tells us how much faster a task will run
  using the m/c with the enhancement, as opposed
  by the original m/c.
• Amdahl’s law gives a quick way to find the
  speedup from some enhancement, which
  depends on two factors.
• The fraction of computation time in the
  original machine that can be converted to
  take advantage of the enhancement.
  (Fraction will always be less than or equal
  to 1).
• The improvement gained by the enhanced
  mode of execution; that is how much faster
  the task would run if the enhanced mode
  were used for the entire program.
• Execution timenew =Execution timeold X


• (1 – Fractionenhanced) + Fractionenhanced
•
•                Speedupenhanced
• The overall speedup is the ratio of the execution
  times.

• Speedupoverall = Execution timeold

                             Execution timenew


   =                1

       (1 - Fractionenhanced) + Fractionenhanced


                     Speedupenhanced
The CPU performance Equation
• All computers are constructed using a
  clock running at a constant rate.
• These time events are called ticks, clock
  ticks, clock periods, clocks, cycles, or
  clock cycles.
• Designers refer to the time of a clock
  period by its duration (Eg. 1 ns) or by its
  rate (Eg. 1 GHz).
• CPU time for a program can be expressed
  in two ways.
  – CPU time = ( CPU clock cycles for a program )
    X ( Clock cycle time ) .

       – OR


  – CPU time = CPU clock cycles for a program
                        Clock rate
• We can also count the number of
  instruction executed – Instruction count
  (IC)
• IF we know the number of clock cycles and
  the instruction count, we can calculate the
  average number of clock cycles per
  instructions (CPI).
• CPI = CPU clock cycles for a program
                Instruction Count
• CPU time = Instrn Count X Clock cycle
  time X Cycles per instrn.
• CPU time is dependent on three
  characteristics:
  – Clock Cycles (Clock rate)  H/W technology
    and organization
  – Clock cycles per instrn Organization and
    ISA.
  – Instrn Count ISA and Compiler technology.
Principle of Locality
• Programs tend to reuse data               and
  instructions they have used recently.
  – Temporal Locality Recently accessed items
    are likely to be accessed in the near future.
  – Spatial Locality Items whose addresses are
    near one another tend to be referenced close
    together in time.
• We can predict what instructions and data
  a program will use in the near future
  based on its accesses in the recent past.
Instruction Set Architecture
• The type of internal storage in a processor
  is the basic difference.
• The major choices are: Stack, Accumulator
  (AC) or a set of registers.
• The operands in a stack architecture are
  implicitly on the top of the stack.
• In an AC architecture, one operand is
  implicitly the AC.
TOS
• The General purpose register architecture
  have only explicit operands – either
  registers or memory locations.
• Consider the instruction C = A + B.
•   Stack    Accumulator   Register      Register
•                          (Reg – Mem)   (Load-store)
•   PUSH A   LOAD A        LOAD R1, A    LOAD R1,A
•   PUSH B   ADD B         ADD R3,R1,B   LOAD R2,B
•   Add      STORE C       STORE R3,C    ADD R3,R1,R2
•   POP C                                STORE R3,C
• There are two classes of register
  computers       :Register     –     Memory
  architecture and Register- Register
  architecture.
• Reg-mem architecture can access memory
  as part of any instruction, and the other
  can access memory only with load and
  store instruction.
• A third class is also there, not used now a
  days – Memory-Memory architecture.
  (Keeps all the operands in memory)
• Some ISA have more registers than a
  single accumulator, but places restriction
  on uses of these special purpose registers.
• Such an architecture is called extended
  accumulator or special – purpose register
  computer.
• Almost all the computers now a days are
  based on load-store register based. There
  are two reasons for this. (Registers are
  very fast and Compilers can efficiently use
  registers).
• Registers can be used to hold variables.
• When variables are allocated to registers,
  the memory traffic reduces, and the
  program speeds up.
• Two major concern in the ISA are:
  – Whether an ALU instruction has two or three
    operands.
  – How many of the operands may be memory
    addressed in ALU instruction.
• This divides the GPR architecture into
  different sub-categories.
No. of Mem Max no of   Architecture   Eg.
Addresses operands


0             3        Reg-Mem        MIPS, ARM,
                                      PowerPC
1             2        Reg-Mem        IBM 360/370
                                      Intel 80x86
2             2        Mem-Mem        VAX

3             3        Mem-Mem        VAX
VAX is a 32-bit computing architecture that supports
 virtual addressing. It was developed in the mid-
 1970s by Digital Equipment Corporation (DEC).
 DEC was later purchased by Compaq, which in
 turn was purchased by Hewlett-Packard.
Register- Register
• Advantages:
  – Simple, fixed length instructions.
  – Simple Code generation model
  – Instructions take similar number of clock
    cycles.
• Disadvantages:
  – Higher instruction count than memory ref.
  – More instructions leads to larger programs.
Register - Memory
• Advantages:
  – Data can be accessed without a separate load
    instruction first.
  – Instruction format can be easily encoded.
• Disadvantages:
  – Operands are not equal.
  – Restriction on the number of registers. (Due to
    encoding a register number and a memory address in
    each instruction)
  – Clocks per instruction vary.
Memory – Memory(2,2) or (3,3)
• Advantages:
  – Most compact.
  – Doesn’t waste registers for temporary data.
• Disadvantages:
  – Large variation in instruction size (three
    operand instruction)
  – Large variation in work per instruction.
  – Memory access creates memory bottleneck.
Memory Addressing
• An architecture should specify, how
  memory addresses are interpreted,
  irrespective of whether the architecture is
  register-register.
• The measurement presented here are
  largely computer independent.
• In some cases the measurements are
  affected by the compiler technology.
Interpreting Memory Addresses
• All instruction sets are assumed to be byte
  addressed and provide access for bytes (8
  bits), half words (16 bits), words (32 bits),
  and most computers provide access for
  double words (64 bits).
• There are two conventions for ordering the
  bytes within a large object: Little endian
  and Big endian.
• Little endian byte order put the byte whose
  address is “x….x000” at the least-significant
  position in the double word.
• The bytes are numbered
    7     6    5    4    3    2    1    0



• Big endian byte order puts the byte whose
  address is “x….x000” at the most-significant
  position in the double word.
• The bytes are numbered
     0    1    2    3    4     5    6    7
Issues in memory interpreting
• Little endian ordering fails to match normal
  ordering of words when strings are
  compared.
• Strings appear “SDRAWKCAB” in the reg.
• Access to objects larger than a byte must
  be aligned.
• An access to an object of size s bytes at
  byte address A is aligned if A mod s = 0.
• Misalignment        causes       hardware
  complications, since memory is usually
  aligned on a multiple of word or double
  word boundary.
• A misaligned memory access may take
  multiple aligned memory references.
• In computers that allow misaligned access,
  programs with aligned access run faster.
Addressing modes
• If an address is given, memory can be
  accessed.
• Addressing modes specify constants and
  registers in additions to locations in
  memory.
• When a memory location is used, the
  actual memory address specified by the
  addressing mode is called effective
  address.
Categories
• Addressing Mode Eg. Instrn            Meaning
• Register       Add R4, R3             Reg[R4]
                                        Reg[R4]+Reg[R3]

• Immediate        Add R4, #3           R4 R4+3

• Displacement     Add R4, 100(R1)      R4 R4+Mem
                                        [100+Reg [R1]]

• Register Indirect Add R4, (R1)         Reg [R4] Reg
                                   [R4] +Mem [Reg [R1]]
• Indexed         Add R3, (R1+R2) Reg [R3] Reg
                           [R3]+Mem [ Reg [R1] + Reg
  [ R2]]

• Direct          Add R1, (1001)    Reg [ R1]
                              Reg [ R1] + Mem [1001]

• Mem Indirect    Add R1, (R3)      Reg [R1]
                    Reg [R1]+ Mem [ Mem [ Reg [ R3]]]
• Autoincrement   Add R1, (R2)+     Reg[R1] Reg[R1]
                                    +Mem[Reg[R2]]
                               Reg[R2] Reg[R2] + d
• Autodecrement   Add    R1,-(R2)      Reg[R2]
                               Reg[R2] – d
                                  Reg[R1] Reg[R1] +
                               Mem[Reg[R2]]
• Scaled          Add   R1,100(R2)[R3]      Reg[R1]
                        Reg[R1]+Mem[100+Reg[R2]
                        + Reg[R3] *d]
Usage of different addressing modes

• Register When a value is in register.
• Immediate For Constants
• Displacement       Accessing       Local
  variables.
• Reg Indirect Accessing using a pointer
  or an address.
• Indexed Array addressing. (R1= base of
  array and R2=index amount)
• Direct Sometimes useful for accessing
  static data.
• Mem Indirect If R3 is the address of a
  pointer p, then mode yields *p;
• Autoincrement Stepping through arrays
  within a loop. R2 points to start of an
  array; each reference increment R2 by
  size of an element d.
Operations in the Instruction Set
• Operator Type              Example
•   Arithmetic and logical   add, subtract, and, or
•   Data transfer            Loads – stores
•   Control                  Branch, jump, procedure call
•   System                   OS call, VM mgt instructions
•   Floating point           add, multiply, divide, compare
•   Decimal                  add, multiply, dec–char conversion
•   String                   move, search, compare
•   Graphics                 pixel and vertex operations,
                             compression, decompression
Instructions for control flow
• Four different    types   of   control   flow
  changes:

  – Conditional branches
  – Jumps
  – Procedure calls
  – Procedure returns
Encoding an instruction set
• Different factors affect how the instructions are
  encoded into a binary representation.
• The representation affects the size of the
  compiled program and the implementation of the
  processor (which decode the rep to quickly find
  the operations and operands).
• Operation is specified in one field called opcode.
• Important is how to encode the addressing
  modes with the operations.
• This depends on the range of addressing
  modes.
• Some older computers have one to five
  operands with 10 addressing modes for
  each operand.
• For such large number of combinations, a
  separate address specifier is needed for
  each operand.
• When encoding an instruction, the no of
  registers and no of addressing modes both
  have an impact on the size of instruction.
Competing forces – instruction encoding

1. Desire to have as many registers and
   addressing modes as possible.
2. Impact of size of the register and
   addressing mode fields on the average
   instruction size. (!!! Hence the average of
   program size)
3. Desire to have instructions encoded into
   lengths that will be easy to handle in a
   pipelined implementation.
• Three choices for encoding an instruction
  set are:
  – Fixed Combines the operation and the
    addressing mode into the opcode. Have only
    a single size for all instructions.
  – Variable Allows all addressing modes to be
    with all operations. This style is best when
    there are many addressing modes and
    operations.
  – Hybrid Has multiple formats.
Thank You

More Related Content

What's hot

11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes dilip kumar
 
System design techniques and networks
System design techniques and networksSystem design techniques and networks
System design techniques and networksRAMPRAKASHT1
 
10 instruction sets characteristics
10 instruction sets characteristics10 instruction sets characteristics
10 instruction sets characteristicsSher Shah Merkhel
 
Computer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary MemoryComputer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary MemoryBudditha Hettige
 
Pipelining, processors, risc and cisc
Pipelining, processors, risc and ciscPipelining, processors, risc and cisc
Pipelining, processors, risc and ciscMark Gibbs
 
chap 18 multicore computers
chap 18 multicore computers chap 18 multicore computers
chap 18 multicore computers Sher Shah Merkhel
 
18 parallel processing
18 parallel processing18 parallel processing
18 parallel processingdilip kumar
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processorMuhammad Ishaq
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
SOC Chip Basics
SOC Chip BasicsSOC Chip Basics
SOC Chip BasicsA B Shinde
 

What's hot (20)

11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
System design techniques and networks
System design techniques and networksSystem design techniques and networks
System design techniques and networks
 
10 instruction sets characteristics
10 instruction sets characteristics10 instruction sets characteristics
10 instruction sets characteristics
 
Computer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary MemoryComputer System Architecture Lecture Note 8.1 primary Memory
Computer System Architecture Lecture Note 8.1 primary Memory
 
Debate on RISC-CISC
Debate on RISC-CISCDebate on RISC-CISC
Debate on RISC-CISC
 
13 risc
13 risc13 risc
13 risc
 
13 risc
13 risc13 risc
13 risc
 
Pipelining, processors, risc and cisc
Pipelining, processors, risc and ciscPipelining, processors, risc and cisc
Pipelining, processors, risc and cisc
 
07 input output
07 input output07 input output
07 input output
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
chap 18 multicore computers
chap 18 multicore computers chap 18 multicore computers
chap 18 multicore computers
 
18 parallel processing
18 parallel processing18 parallel processing
18 parallel processing
 
Risc & cisk
Risc & ciskRisc & cisk
Risc & cisk
 
16 control unit
16 control unit16 control unit
16 control unit
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processor
 
Rtos
RtosRtos
Rtos
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Ch8
Ch8Ch8
Ch8
 
SOC Chip Basics
SOC Chip BasicsSOC Chip Basics
SOC Chip Basics
 

Viewers also liked

Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)PlusOrMinusZero
 
Guidelines for technical writing documents
Guidelines for technical writing documentsGuidelines for technical writing documents
Guidelines for technical writing documentsRajesh Singamsetty
 
Technical writing: Some guidelines
Technical writing: Some guidelinesTechnical writing: Some guidelines
Technical writing: Some guidelinesPlusOrMinusZero
 
Guidelines for preparing powerpoint presentations
Guidelines for preparing powerpoint presentationsGuidelines for preparing powerpoint presentations
Guidelines for preparing powerpoint presentationsVikram Kumar Gupta
 
Powerpoint Guidelines
Powerpoint GuidelinesPowerpoint Guidelines
Powerpoint GuidelinesKathryn Harth
 
Slide Presentation Guidelines
Slide Presentation GuidelinesSlide Presentation Guidelines
Slide Presentation GuidelinesPlusOrMinusZero
 

Viewers also liked (7)

Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)Preseenting Vidya Mobile (An Android app for VAST)
Preseenting Vidya Mobile (An Android app for VAST)
 
Guidelines for technical writing documents
Guidelines for technical writing documentsGuidelines for technical writing documents
Guidelines for technical writing documents
 
Technical writing: Some guidelines
Technical writing: Some guidelinesTechnical writing: Some guidelines
Technical writing: Some guidelines
 
Basic Power Point Guidelines
Basic Power Point GuidelinesBasic Power Point Guidelines
Basic Power Point Guidelines
 
Guidelines for preparing powerpoint presentations
Guidelines for preparing powerpoint presentationsGuidelines for preparing powerpoint presentations
Guidelines for preparing powerpoint presentations
 
Powerpoint Guidelines
Powerpoint GuidelinesPowerpoint Guidelines
Powerpoint Guidelines
 
Slide Presentation Guidelines
Slide Presentation GuidelinesSlide Presentation Guidelines
Slide Presentation Guidelines
 

Similar to Faculty Development Programme on Performance Tuning

Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basicsDeepak John
 
Parallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesParallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesMurtadha Alsabbagh
 
Fundamentals.pptx
Fundamentals.pptxFundamentals.pptx
Fundamentals.pptxdhivyak49
 
4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdfarpowersarps
 
Challenges in Embedded Computing
Challenges in Embedded ComputingChallenges in Embedded Computing
Challenges in Embedded ComputingPradeep Kumar TS
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD) Ali Raza
 
Computer_Organization and architecture _unit 1.pptx
Computer_Organization and architecture _unit 1.pptxComputer_Organization and architecture _unit 1.pptx
Computer_Organization and architecture _unit 1.pptxManimegalaM3
 
Reduced instruction set computers
Reduced instruction set computersReduced instruction set computers
Reduced instruction set computersSyed Zaid Irshad
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxAmanuelmergia
 
Unit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsUnit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsBalaji Vignesh
 
RISC Vs CISC Computer architecture and design
RISC Vs CISC Computer architecture and designRISC Vs CISC Computer architecture and design
RISC Vs CISC Computer architecture and designyousefzahdeh
 
Introduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationIntroduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationDr. Balaji Ganesh Rajagopal
 
introduction COA(M1).pptx
introduction COA(M1).pptxintroduction COA(M1).pptx
introduction COA(M1).pptxBhavanaMinchu
 
UNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsUNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsButtaRajasekhar2
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptxPratik Gohel
 

Similar to Faculty Development Programme on Performance Tuning (20)

Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
 
Parallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesParallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and Disadvantages
 
Fundamentals.pptx
Fundamentals.pptxFundamentals.pptx
Fundamentals.pptx
 
4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf
 
Challenges in Embedded Computing
Challenges in Embedded ComputingChallenges in Embedded Computing
Challenges in Embedded Computing
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD)
 
Processors selection
Processors selectionProcessors selection
Processors selection
 
Computer_Organization and architecture _unit 1.pptx
Computer_Organization and architecture _unit 1.pptxComputer_Organization and architecture _unit 1.pptx
Computer_Organization and architecture _unit 1.pptx
 
Reduced instruction set computers
Reduced instruction set computersReduced instruction set computers
Reduced instruction set computers
 
RISC.ppt
RISC.pptRISC.ppt
RISC.ppt
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Unit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsUnit 1 Computer organization and Instructions
Unit 1 Computer organization and Instructions
 
Chap2 slides
Chap2 slidesChap2 slides
Chap2 slides
 
RISC Vs CISC Computer architecture and design
RISC Vs CISC Computer architecture and designRISC Vs CISC Computer architecture and design
RISC Vs CISC Computer architecture and design
 
Introduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationIntroduction to Computer Architecture and Organization
Introduction to Computer Architecture and Organization
 
04 performance
04 performance04 performance
04 performance
 
introduction COA(M1).pptx
introduction COA(M1).pptxintroduction COA(M1).pptx
introduction COA(M1).pptx
 
Mod 3.pptx
Mod 3.pptxMod 3.pptx
Mod 3.pptx
 
UNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsUNIT 3 - General Purpose Processors
UNIT 3 - General Purpose Processors
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 

More from PlusOrMinusZero

Deep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from BasicsDeep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from BasicsPlusOrMinusZero
 
The Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of ClaculusThe Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of ClaculusPlusOrMinusZero
 
World environment day 2019 celebration
World environment day 2019 celebrationWorld environment day 2019 celebration
World environment day 2019 celebrationPlusOrMinusZero
 
An introduction to TeX and LaTeX
An introduction to TeX and LaTeXAn introduction to TeX and LaTeX
An introduction to TeX and LaTeXPlusOrMinusZero
 
Fractional calculus and applications
Fractional calculus and applicationsFractional calculus and applications
Fractional calculus and applicationsPlusOrMinusZero
 
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...PlusOrMinusZero
 
Linear algebra behind Google search
Linear algebra behind Google searchLinear algebra behind Google search
Linear algebra behind Google searchPlusOrMinusZero
 
Almost all about Google Drive
Almost all about Google DriveAlmost all about Google Drive
Almost all about Google DrivePlusOrMinusZero
 
First Introduction to Fractals
First Introduction to FractalsFirst Introduction to Fractals
First Introduction to FractalsPlusOrMinusZero
 
Mobile Communications Sajay K R
Mobile Communications Sajay K RMobile Communications Sajay K R
Mobile Communications Sajay K RPlusOrMinusZero
 
On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...PlusOrMinusZero
 
First introduction to wireless sensor networks
First introduction to wireless sensor networksFirst introduction to wireless sensor networks
First introduction to wireless sensor networksPlusOrMinusZero
 
World environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankarWorld environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankarPlusOrMinusZero
 
World environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazarWorld environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazarPlusOrMinusZero
 
An introduction to free software
An introduction to free softwareAn introduction to free software
An introduction to free softwarePlusOrMinusZero
 
Introduction to Computer Algebra Systems
Introduction to Computer Algebra SystemsIntroduction to Computer Algebra Systems
Introduction to Computer Algebra SystemsPlusOrMinusZero
 
pi to a trillion digits : How and Why?
pi to a trillion digits : How and Why?pi to a trillion digits : How and Why?
pi to a trillion digits : How and Why?PlusOrMinusZero
 
A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...PlusOrMinusZero
 
Perfectly Legal Illegal Resources In The Web Catching Slumdogs Using The Net
Perfectly Legal Illegal Resources In The Web   Catching Slumdogs Using The NetPerfectly Legal Illegal Resources In The Web   Catching Slumdogs Using The Net
Perfectly Legal Illegal Resources In The Web Catching Slumdogs Using The NetPlusOrMinusZero
 

More from PlusOrMinusZero (19)

Deep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from BasicsDeep into to Deep Learning Starting from Basics
Deep into to Deep Learning Starting from Basics
 
The Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of ClaculusThe Untold Story of Indian Origins of Claculus
The Untold Story of Indian Origins of Claculus
 
World environment day 2019 celebration
World environment day 2019 celebrationWorld environment day 2019 celebration
World environment day 2019 celebration
 
An introduction to TeX and LaTeX
An introduction to TeX and LaTeXAn introduction to TeX and LaTeX
An introduction to TeX and LaTeX
 
Fractional calculus and applications
Fractional calculus and applicationsFractional calculus and applications
Fractional calculus and applications
 
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
On Sangamagrama Madhava's (c.1350 - c.1425) Algorithms for the Computation of...
 
Linear algebra behind Google search
Linear algebra behind Google searchLinear algebra behind Google search
Linear algebra behind Google search
 
Almost all about Google Drive
Almost all about Google DriveAlmost all about Google Drive
Almost all about Google Drive
 
First Introduction to Fractals
First Introduction to FractalsFirst Introduction to Fractals
First Introduction to Fractals
 
Mobile Communications Sajay K R
Mobile Communications Sajay K RMobile Communications Sajay K R
Mobile Communications Sajay K R
 
On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...
 
First introduction to wireless sensor networks
First introduction to wireless sensor networksFirst introduction to wireless sensor networks
First introduction to wireless sensor networks
 
World environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankarWorld environment day 2010 vidya academy mca renjith sankar
World environment day 2010 vidya academy mca renjith sankar
 
World environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazarWorld environment day 2010 vidya academy mca steffi lazar
World environment day 2010 vidya academy mca steffi lazar
 
An introduction to free software
An introduction to free softwareAn introduction to free software
An introduction to free software
 
Introduction to Computer Algebra Systems
Introduction to Computer Algebra SystemsIntroduction to Computer Algebra Systems
Introduction to Computer Algebra Systems
 
pi to a trillion digits : How and Why?
pi to a trillion digits : How and Why?pi to a trillion digits : How and Why?
pi to a trillion digits : How and Why?
 
A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...A prize winning entry in a two-hour slide-show presentation contest on World ...
A prize winning entry in a two-hour slide-show presentation contest on World ...
 
Perfectly Legal Illegal Resources In The Web Catching Slumdogs Using The Net
Perfectly Legal Illegal Resources In The Web   Catching Slumdogs Using The NetPerfectly Legal Illegal Resources In The Web   Catching Slumdogs Using The Net
Perfectly Legal Illegal Resources In The Web Catching Slumdogs Using The Net
 

Recently uploaded

4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 

Recently uploaded (20)

4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 

Faculty Development Programme on Performance Tuning

  • 1. Faculty Development Programme on Performance Tuning Dijesh P 27 July 2012
  • 2. Quantitative Principles of Computer Design • The most important principle of computer design is to make the common case fast. • That is Favor the frequent case over the infrequent case. • Improving the frequent event over the infrequent event will help improving performance. • Amdahl’s law can be used to quantify this principle.
  • 3. Amdahl’s Law • States that “the performance improvement to be gained from using some faster mode of execution is limited by the time the faster mode can be used”. • Amdahl’s law defines “Speedup” that can be gained by using a particular feature. • We can make an enhancement to a machine that will improve the performance when it is used.
  • 4. • Speedup = – Performance for entire task using enhancement when possible – Performance for entire task without using enhancement – Alternatively, – Speedup = • Execution time for entire task without using enhancement • Execution time for entire task using enhancement when possible • Speedup tells us how much faster a task will run using the m/c with the enhancement, as opposed by the original m/c.
  • 5. • Amdahl’s law gives a quick way to find the speedup from some enhancement, which depends on two factors. • The fraction of computation time in the original machine that can be converted to take advantage of the enhancement. (Fraction will always be less than or equal to 1). • The improvement gained by the enhanced mode of execution; that is how much faster the task would run if the enhanced mode were used for the entire program.
  • 6. • Execution timenew =Execution timeold X • (1 – Fractionenhanced) + Fractionenhanced • • Speedupenhanced
  • 7. • The overall speedup is the ratio of the execution times. • Speedupoverall = Execution timeold Execution timenew = 1 (1 - Fractionenhanced) + Fractionenhanced Speedupenhanced
  • 8. The CPU performance Equation • All computers are constructed using a clock running at a constant rate. • These time events are called ticks, clock ticks, clock periods, clocks, cycles, or clock cycles. • Designers refer to the time of a clock period by its duration (Eg. 1 ns) or by its rate (Eg. 1 GHz).
  • 9. • CPU time for a program can be expressed in two ways. – CPU time = ( CPU clock cycles for a program ) X ( Clock cycle time ) . – OR – CPU time = CPU clock cycles for a program Clock rate
  • 10. • We can also count the number of instruction executed – Instruction count (IC) • IF we know the number of clock cycles and the instruction count, we can calculate the average number of clock cycles per instructions (CPI). • CPI = CPU clock cycles for a program Instruction Count
  • 11. • CPU time = Instrn Count X Clock cycle time X Cycles per instrn. • CPU time is dependent on three characteristics: – Clock Cycles (Clock rate)  H/W technology and organization – Clock cycles per instrn Organization and ISA. – Instrn Count ISA and Compiler technology.
  • 12. Principle of Locality • Programs tend to reuse data and instructions they have used recently. – Temporal Locality Recently accessed items are likely to be accessed in the near future. – Spatial Locality Items whose addresses are near one another tend to be referenced close together in time. • We can predict what instructions and data a program will use in the near future based on its accesses in the recent past.
  • 13. Instruction Set Architecture • The type of internal storage in a processor is the basic difference. • The major choices are: Stack, Accumulator (AC) or a set of registers. • The operands in a stack architecture are implicitly on the top of the stack. • In an AC architecture, one operand is implicitly the AC.
  • 14. TOS
  • 15. • The General purpose register architecture have only explicit operands – either registers or memory locations. • Consider the instruction C = A + B. • Stack Accumulator Register Register • (Reg – Mem) (Load-store) • PUSH A LOAD A LOAD R1, A LOAD R1,A • PUSH B ADD B ADD R3,R1,B LOAD R2,B • Add STORE C STORE R3,C ADD R3,R1,R2 • POP C STORE R3,C
  • 16. • There are two classes of register computers :Register – Memory architecture and Register- Register architecture. • Reg-mem architecture can access memory as part of any instruction, and the other can access memory only with load and store instruction. • A third class is also there, not used now a days – Memory-Memory architecture. (Keeps all the operands in memory)
  • 17. • Some ISA have more registers than a single accumulator, but places restriction on uses of these special purpose registers. • Such an architecture is called extended accumulator or special – purpose register computer. • Almost all the computers now a days are based on load-store register based. There are two reasons for this. (Registers are very fast and Compilers can efficiently use registers).
  • 18. • Registers can be used to hold variables. • When variables are allocated to registers, the memory traffic reduces, and the program speeds up. • Two major concern in the ISA are: – Whether an ALU instruction has two or three operands. – How many of the operands may be memory addressed in ALU instruction. • This divides the GPR architecture into different sub-categories.
  • 19. No. of Mem Max no of Architecture Eg. Addresses operands 0 3 Reg-Mem MIPS, ARM, PowerPC 1 2 Reg-Mem IBM 360/370 Intel 80x86 2 2 Mem-Mem VAX 3 3 Mem-Mem VAX VAX is a 32-bit computing architecture that supports virtual addressing. It was developed in the mid- 1970s by Digital Equipment Corporation (DEC). DEC was later purchased by Compaq, which in turn was purchased by Hewlett-Packard.
  • 20. Register- Register • Advantages: – Simple, fixed length instructions. – Simple Code generation model – Instructions take similar number of clock cycles. • Disadvantages: – Higher instruction count than memory ref. – More instructions leads to larger programs.
  • 21. Register - Memory • Advantages: – Data can be accessed without a separate load instruction first. – Instruction format can be easily encoded. • Disadvantages: – Operands are not equal. – Restriction on the number of registers. (Due to encoding a register number and a memory address in each instruction) – Clocks per instruction vary.
  • 22. Memory – Memory(2,2) or (3,3) • Advantages: – Most compact. – Doesn’t waste registers for temporary data. • Disadvantages: – Large variation in instruction size (three operand instruction) – Large variation in work per instruction. – Memory access creates memory bottleneck.
  • 23. Memory Addressing • An architecture should specify, how memory addresses are interpreted, irrespective of whether the architecture is register-register. • The measurement presented here are largely computer independent. • In some cases the measurements are affected by the compiler technology.
  • 24. Interpreting Memory Addresses • All instruction sets are assumed to be byte addressed and provide access for bytes (8 bits), half words (16 bits), words (32 bits), and most computers provide access for double words (64 bits). • There are two conventions for ordering the bytes within a large object: Little endian and Big endian.
  • 25. • Little endian byte order put the byte whose address is “x….x000” at the least-significant position in the double word. • The bytes are numbered 7 6 5 4 3 2 1 0 • Big endian byte order puts the byte whose address is “x….x000” at the most-significant position in the double word. • The bytes are numbered 0 1 2 3 4 5 6 7
  • 26. Issues in memory interpreting • Little endian ordering fails to match normal ordering of words when strings are compared. • Strings appear “SDRAWKCAB” in the reg. • Access to objects larger than a byte must be aligned. • An access to an object of size s bytes at byte address A is aligned if A mod s = 0.
  • 27. • Misalignment causes hardware complications, since memory is usually aligned on a multiple of word or double word boundary. • A misaligned memory access may take multiple aligned memory references. • In computers that allow misaligned access, programs with aligned access run faster.
  • 28. Addressing modes • If an address is given, memory can be accessed. • Addressing modes specify constants and registers in additions to locations in memory. • When a memory location is used, the actual memory address specified by the addressing mode is called effective address.
  • 29. Categories • Addressing Mode Eg. Instrn Meaning • Register Add R4, R3 Reg[R4] Reg[R4]+Reg[R3] • Immediate Add R4, #3 R4 R4+3 • Displacement Add R4, 100(R1) R4 R4+Mem [100+Reg [R1]] • Register Indirect Add R4, (R1) Reg [R4] Reg [R4] +Mem [Reg [R1]]
  • 30. • Indexed Add R3, (R1+R2) Reg [R3] Reg [R3]+Mem [ Reg [R1] + Reg [ R2]] • Direct Add R1, (1001) Reg [ R1] Reg [ R1] + Mem [1001] • Mem Indirect Add R1, (R3) Reg [R1] Reg [R1]+ Mem [ Mem [ Reg [ R3]]] • Autoincrement Add R1, (R2)+ Reg[R1] Reg[R1] +Mem[Reg[R2]] Reg[R2] Reg[R2] + d
  • 31. • Autodecrement Add R1,-(R2) Reg[R2] Reg[R2] – d Reg[R1] Reg[R1] + Mem[Reg[R2]] • Scaled Add R1,100(R2)[R3] Reg[R1] Reg[R1]+Mem[100+Reg[R2] + Reg[R3] *d]
  • 32. Usage of different addressing modes • Register When a value is in register. • Immediate For Constants • Displacement Accessing Local variables. • Reg Indirect Accessing using a pointer or an address. • Indexed Array addressing. (R1= base of array and R2=index amount)
  • 33. • Direct Sometimes useful for accessing static data. • Mem Indirect If R3 is the address of a pointer p, then mode yields *p; • Autoincrement Stepping through arrays within a loop. R2 points to start of an array; each reference increment R2 by size of an element d.
  • 34. Operations in the Instruction Set • Operator Type Example • Arithmetic and logical add, subtract, and, or • Data transfer Loads – stores • Control Branch, jump, procedure call • System OS call, VM mgt instructions • Floating point add, multiply, divide, compare • Decimal add, multiply, dec–char conversion • String move, search, compare • Graphics pixel and vertex operations, compression, decompression
  • 35. Instructions for control flow • Four different types of control flow changes: – Conditional branches – Jumps – Procedure calls – Procedure returns
  • 36. Encoding an instruction set • Different factors affect how the instructions are encoded into a binary representation. • The representation affects the size of the compiled program and the implementation of the processor (which decode the rep to quickly find the operations and operands). • Operation is specified in one field called opcode. • Important is how to encode the addressing modes with the operations.
  • 37. • This depends on the range of addressing modes. • Some older computers have one to five operands with 10 addressing modes for each operand. • For such large number of combinations, a separate address specifier is needed for each operand. • When encoding an instruction, the no of registers and no of addressing modes both have an impact on the size of instruction.
  • 38. Competing forces – instruction encoding 1. Desire to have as many registers and addressing modes as possible. 2. Impact of size of the register and addressing mode fields on the average instruction size. (!!! Hence the average of program size) 3. Desire to have instructions encoded into lengths that will be easy to handle in a pipelined implementation.
  • 39. • Three choices for encoding an instruction set are: – Fixed Combines the operation and the addressing mode into the opcode. Have only a single size for all instructions. – Variable Allows all addressing modes to be with all operations. This style is best when there are many addressing modes and operations. – Hybrid Has multiple formats.