SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
Datorarkitektur                                                             Fö 5/6 - 1         Datorarkitektur                                         Fö 5/6 - 2




                                                                                                         What are RISCs and why do we need them?



      REDUCED INSTRUCTION SET COMPUTERS
                                                                                                         •      RISC architectures represent an important
                    (RISC)                                                                                      innovation in the area of computer organization.
                                                                                                         •      The RISC architecture is an attempt to produce
                                                                                                                more CPU power by simplifying the instruction set
                                                                                                                of the CPU.
                                                                                                         •      The opposed trend to RISC is that of complex
                                                                                                                instruction set computers (CISC).

                                   1. Why do we need RISCs?

                                   2. Some Typical Features of Current Programs                      Both RISC and CISC architectures have been
                                                                                                     developed as an attempt to cover the semantic gap.
                                   3. Main Characteristics of RISC Architectures

                                   4. Are RISCs Really Better than CISCs?

                                   5. Examples




Petru Eles, IDA, LiTH                                                                          Petru Eles, IDA, LiTH




      Datorarkitektur                                                             Fö 5/6 - 3         Datorarkitektur                                         Fö 5/6 - 4




                                                               The Semantic Gap                                         The Semantic Gap (cont’d)
      growing abstraction level




                                  High-level language (HLL)
                                                                                                     Problem: How should new HLL programs be compiled
                                            the semantic gap




                                                                                                     and executed efficiently on a processor architecture?




                                                                                                     Two possible answers:

                                  Machine language (machine architecture fully visible)                  1. The CISC approach: design very complex
                                                                                                            architectures including a large number of
                                                                                                            instructions and addressing modes; include also
                                                                                                            instructions close to those present in HLL.
                              •    In order to improve the efficiency of software
                                   development, new and powerful programming
                                                                                                         2. The RISC approach: simplify the instruction set and
                                   languages have been developed (Ada, C++, Java).
                                                                                                            adapt it to the real requirements of user programs.
                                   They provide: high level of abstraction,
                                   conciseness, power.
                              •    By this evolution the semantic gap grows.




Petru Eles, IDA, LiTH                                                                          Petru Eles, IDA, LiTH
Datorarkitektur                                           Fö 5/6 - 5         Datorarkitektur                                          Fö 5/6 - 6




                        Evaluation of Program Execution                                              Frequency of Instructions Executed
                                  or                                                   •      Frequency distribution of executed machine
               What are Programs Doing Most of the Time?                                      instructions:
                                                                                                - moves: 33%
                                                                                                - conditional branch: 20%
          •      Several studies have been conducted to determine                               - Arithmetic/logic: 16%
                 the execution characteristics of machine instruction                           - others: Between 0.1% and 10%
                 sequences generated from HLL programs.                                •      Addressing modes: the overwhelming majority of
                                                                                              instructions uses simple addressing modes, in
          •      Aspects of interest:                                                         which the address can be calculated in a single
                                                                                              cycle (register, register indirect, displacement);
                  1. The frequency of operations performed.                                   complex addressing modes (memory indirect,
                  2. The types of operands and their frequency of                             indexed+indirect, displacement+indexed, stack) are
                     use.                                                                     used only by ~18% of the instructions.
                  3. Execution sequencing (frequency of jumps,
                     loops, subprogram calls).                                                                    Operand Types

                                                                                       •      74 to 80% of the operands are scalars (integers,
                                                                                              reals, characters, etc.) which can be hold in
                                                                                              registers;
                                                                                       •      the rest (20-26%) are arrays/structures; 90% of
                                                                                              them are global variables;
                                                                                       •      80% of the scalars are local variables.



                                                                                              The majority of operands are local variables of
                                                                                              scalar type, which can be stored in registers.




Petru Eles, IDA, LiTH                                                        Petru Eles, IDA, LiTH




      Datorarkitektur                                           Fö 5/6 - 7         Datorarkitektur                                          Fö 5/6 - 8




                                                                                                          Procedure Calls (cont’d)

                                Procedure Calls                                               int x, y; float z;

                                                                                              void proc3(int a, int b, int c) {
                                                                                                   - - - - - - - - - - - - - -- - -
      Investigations have been also performed about the                                            }
      percentage of the total execution time spent executing a                                ---------------------
      certain HLL instruction.                                                                void proc2(int k) {
                                                                                                   int j, q;
          •      It turned out that comparing HLL instructions, most                               -----------------
                 of the time is spent executing CALLs and                                          proc3(j, 5, q);
                 RETURNs.                                                                          }
          •      Even if only 15% of the executed HLL instructions                            ---------------------
                 is a CALL or RETURN, they are executed most of                               void proc1() {
                 the time, because of their complexity.                                            int i;
          •      A CALL or RETURN is compiled into a relatively                                    -----------------
                 long sequence of machine instructions with a lot of                               proc2(i);
                 memory references.                                                                }
                                                                                              ---------------------
                                                                                              main () {
                                                                                                   proc1();
                                                                                                   }

                                                                                   Some statistics concerning procedure calls:
                                                                                    • Only 1.25% of called procedures have more than
                                                                                      six parameters.
                                                                                    • Only 6.7% of called procedures have more than six
                                                                                      local variables.
                                                                                    • Chains of nested procedure calls are usually short
                                                                                      and only very seldom longer than 6.

Petru Eles, IDA, LiTH                                                        Petru Eles, IDA, LiTH
Datorarkitektur                                       Fö 5/6 - 9          Datorarkitektur                                                 Fö 5/6 - 10




                                                                                     Main Characteristics of RISC Architectures
       Conclusions from Evaluation of Program Execution

                                                                                    •      The instruction set is limited and includes only
                                                                                           simple instructions.
          •      An overwhelming preponderance of simple (ALU
                 and move) operations over complex operations.                                    - The goal is to create an instruction set contain-
          •      Preponderance of simple addressing modes.                                          ing instructions that execute quickly; most of the
          •      Large frequency of operand accesses; on average                                    RISC instructions are executed in a single
                 each instruction references 1.9 operands.                                          machine cycle (after fetched and decoded).
          •      Most of the referenced operands are scalars (so                                     • Pipeline operation (without memory reference):
                 they can be stored in a register) and are local
                 variables or parameters.                                                                                 FI DI EI
          •      Optimizing the procedure CALL/RETURN
                 mechanism promises large benefits in speed.
                                                                                                  - RISC instructions, being simple, are hard-wired,
                                                                                                    while CISC architectures have to use micropro-
                                                                                                    gramming in order to implement complex
      These conclusions have been at the starting point to the                                      instructions.
      Reduced Instruction Set Computer (RISC) approach.                                           - Having only simple instructions results in re-
                                                                                                    duced complexity of the control unit and the
                                                                                                    data path; as a consequence, the processor
                                                                                                    can work at a high clock frequency.
                                                                                                  - The pipelines are used efficiently if instructions
                                                                                                    are simple and of similar execution time.
                                                                                                  - Complex operations on RISCs are executed as
                                                                                                    a sequence of simple RISC instructions. In the
                                                                                                    case of CISCs they are executed as one single
                                                                                                    or a few complex instruction.




Petru Eles, IDA, LiTH                                                     Petru Eles, IDA, LiTH




      Datorarkitektur                                       Fö 5/6 - 11         Datorarkitektur                                                 Fö 5/6 - 12




        Main Characteristics of RISC Architectures (cont’d)                       Main Characteristics of RISC Architectures (cont’d)


      Let’s see some small example:
                                                                                    •      Load-and-store architecture
      Assume:                                                                               - Only LOAD and STORE instructions reference
           - we have a program with 80% of executed                                           data in memory; all other instructions operate
              instructions being simple and 20% complex;                                      only with registers (are register-to-register in-
                                                                                              structions); thus, only the few instructions ac-
           - on a CISC machine simple instructions take 4
                                                                                              cessing memory need more than one cycle to
              cycles, complex instructions take 8 cycles;
                                                                                              execute (after fetched and decoded).
              cycle time is 100 ns (10-7 s);
                                                                                               • Pipeline operation with memory reference:
           - on a RISC machine simple instructions are
              executed in one cycle; complex operations are                                               FI DI CA TR         CA: compute address
              implemented as a sequence of instructions; we
              consider on average 14 instructions (14 cycles)                                                                 TR: transfere
              for a complex operation; cycle time is 75 ns
              (0.75 * 10-7 s).                                                      •      Instructions use only few addressing modes
                                                                                             - Addressing modes are usually register, direct,
      How much time takes a program of 1 000 000 instructions?                                 register indirect, displacement.

              CISC: (106*0.80*4 + 106*0.20*8)*10-7 = 0.48 s
              RISC: (106*0.80*1 + 106*0.20*14)*0.75*10-7 = 0.27 s                   •      Instructions are of fixed length and uniform
                                                                                           format
          •      complex operations take more time on the RISC,                              - This makes the loading and decoding of
                 but their number is small;                                                    instructions simple and fast; it is not needed to
                                                                                               wait until the length of an instruction is known in
          •      because of its simplicity, the RISC works at a
                                                                                               order to start decoding the following one;
                 smaller cycle time; with the CISC, simple
                 instructions are slowed down because of the                                 - Decoding is simplified because opcode and ad-
                 increased data path length and the increased                                  dress fields are located in the same position for
                 control complexity.                                                           all instructions


Petru Eles, IDA, LiTH                                                     Petru Eles, IDA, LiTH
Datorarkitektur                                                     Fö 5/6 - 13         Datorarkitektur                                                   Fö 5/6 - 14




                                                                                                Main Characteristics of RISC Architectures (cont’d)
        Main Characteristics of RISC Architectures (cont’d)



                                                                                                         Is the above strategy realistic?
          •      A large number of registers is available

                                                                                                                - The strategy is realistic, because the number of
                        - Variables and intermediate results can be
                                                                                                                  local variables in procedures is not large. The
                          stored in registers and do not require repeated
                                                                                                                  chains of nested procedure calls is only excep-
                          loads and stores from/to memory.
                                                                                                                  tionally larger than 6.
                        - All local variables of procedures and the passed
                                                                                                                - If the chain of nested procedure calls becomes
                          parameters can be stored in registers (see slide
                                                                                                                  large, at a certain call there will be no registers
                          8 for comments on possible number of variables
                                                                                                                  to be assigned to the called procedure; in this
                          and parameters).
                                                                                                                  case local variables and parameters have to be
                                                                                                                  stored in memory.
                 What happens when a new procedure is called?

                        - Normally the registers have to be saved in                                     Why is a large number of registers typical for RISC
                          memory (they contain values of variables and                                   architectures?
                          parameters for the calling procedure); at return
                          to the calling procedure, the values have to be
                          again loaded from memory. This takes a lot of                                         - Because of the reduced complexity of the proc-
                          time.                                                                                   essor there is enough space on the chip to be
                                                                                                                  allocated to a large number of registers. This,
                        - If a large number of registers is available, a new
                                                                                                                  usually, is not the case with CISCs.
                          set of registers can be allocated to the called
                          procedure and the register set assigned to the
                          calling one remains untouched.




Petru Eles, IDA, LiTH                                                                   Petru Eles, IDA, LiTH




      Datorarkitektur                                                     Fö 5/6 - 15         Datorarkitektur                                                   Fö 5/6 - 16




        Main Characteristics of RISC Architectures (cont’d)                                                        The delayed load problem (cont’d)


                                                                                                  •      With delayed load the processor always executes
      The delayed load problem                                                                           the instruction following a LOAD, without a stall; It is
                                                                                                         the programmers (compilers) responsibility that this
                                                                                                         instruction does not need the loaded value.
          •      LOAD instructions (similar to the STORE) require
                 memory access and their execution cannot be
                 completed in a single clock cycle.
                 However, in the next cycle a new instruction is                              The following sequence is not correct with such a
                 started by the processor.                                                    processor, and a compiler will not generate something
                                                                                              like this:
                          LOAD R1,X           FI DI CA TR
                          ADD R2,R1               FI DI   stall   EI
                                                                                                                   LOAD    R1,X        loads from address X into R1
                                                                                                                   ADD     R2,R1       R2 ← R2 + R1
                          ADD R4,R3                  FI           DI EI
                                                                                                                   ADD     R4,R3       R4 ← R4 + R3
                                                                                                                   SUB     R2,R4       R2 ← R2 - R4


      Two possible solutions:
                                                                                                                                                    The value in R1 is
            1. The hardware should delay the execution of                                                                                           not yet available!
               the instruction following the LOAD, if this in-                                    LOAD R1,X                    FI DI CA TR
               struction needs the loaded value
                                                                                                  ADD R2,R1                       FI DI EI
            2. A more efficient, compiler based, solution,
               which has similarities with the delayed                                            ADD R4,R3                           FI DI EI
               branching, is the delayed load:                                                    SUB R2,R4                              FI DI EI




Petru Eles, IDA, LiTH                                                                   Petru Eles, IDA, LiTH
Datorarkitektur                                          Fö 5/6 - 17         Datorarkitektur                                            Fö 5/6 - 18




                        The delayed load problem (cont’d)                                       Are RISCs Really Better than CISCs?
      The following one is the correct sequence:
                LOAD R1,X          loads from address X into R1
                ADD R4,R3          R4 ← R4 + R3
                ADD R2,R1          R2 ← R2 + R1                                        •      RISC architectures have several advantages and
                                                                                              they were discussed throughout this lecture.
                SUB     R2,R4      R2 ← R2 - R4                                               However, a definitive answer to the above question
                                                                                              is difficult to give.
           LOAD R1,X              FI DI CA TR                                          •      A lot of performance comparisons have shown that
           ADD R4,R3                 FI DI EI                                                 benchmark programs are really running faster on
                                                                                              RISC processors than on processors with CISC
           ADD R2,R1                    FI DI EI
                                                                                              characteristics.
           SUB R2,R4                       FI DI EI                                    •      However, it is difficult to identify which feature of a
                                                                                              processor produces the higher performance. Some
                                                                                              "CISC fans" argue that the higher speed is not
      For the following sequence the compiler has generated a                                 produced by the typical RISC features but because
      NOP after the LOAD because there is no instruction to                                   of technology, better compilers, etc.
      fill the load-delay slot:                                                         •      An argument in favour of the CISC: the simpler
                 LOAD R1,X         loads from address X into R1                               instruction set of RISC processors results in a
                 NOP                                                                          larger memory requirement compared to the similar
                 ADD R2,R1         R2 ← R2 + R1                                               program compiled for a CISC architecture.
                 ADD R4,R2         R4 ← R4 + R2
                 STORE R4,X        stores from R4 to address X
                                                                                   Most of the current processors are not typical RISCs
             LOAD R1,X             FI DI CA TR                                     or CISCs but try to combine advantages of both
                                                                                   approaches
             NOP
             ADD R2,R1                   FI DI EI
             ADD R4,R2                      FI DI EI
             STORE R4,X                          FI DI CA TR


Petru Eles, IDA, LiTH                                                        Petru Eles, IDA, LiTH




      Datorarkitektur                                          Fö 5/6 - 19         Datorarkitektur                                            Fö 5/6 - 20




                         Some Processor Examples                                                                Summary
      CISC Architectures:
      VAX 11/780
           Nr. of instructions: 303                                                    •      Both RISCs and CISCs try to solve the same prob-
           Instruction size: 2 - 57                                                           lem: to cover the semantic gap. They do it in differ-
           Instruction format: not fixed                                                       ent ways. CISCs are going the traditional way of
                                                                                              implementing more and more complex instructions.
           Addressing modes: 22
                                                                                              RISCs try to simplify the instruction set.
           Number of general purpose registers: 16
                                                                                       •      Innovations in RISC architectures are based on a
      Pentium                                                                                 close analysis of a large set of widely used
           Nr. of instructions: 235                                                           programs.
           Instruction size: 1 - 11                                                    •      The main features of RISC architectures are:
           Instruction format: not fixed                                                       reduced number of simple instructions, few
           Addressing modes: 11                                                               addressing modes, load-store architecture,
           Number of general purpose registers: 8                                             instructions are of fixed length and format, a large
                                                                                              number of registers is available.
                                                                                       •      One of the main concerns of RISC designers was
      RISC Architectures:
                                                                                              to maximise the efficiency of pipelining.
      Sun SPARC
                                                                                       •      Present architectures often include both RISC and
          Nr. of instructions: 52                                                             CISC features.
          Instruction size: 4
          Instruction format: fixed
          Addressing modes: 2
          Number of general purpose registers: up to 520
      PowerPC
          Nr. of instructions: 206
          Instruction size: 4
          Instruction format: not fixed (but small differences)
          Addressing modes: 2
          Number of general purpose registers: 32


Petru Eles, IDA, LiTH                                                        Petru Eles, IDA, LiTH

Mais conteúdo relacionado

Mais procurados

Risc and cisc casestudy
Risc and cisc casestudyRisc and cisc casestudy
Risc and cisc casestudyjvs71294
 
Risc and cisc eugene clewlow
Risc and cisc   eugene clewlowRisc and cisc   eugene clewlow
Risc and cisc eugene clewlowChaudhary Manzoor
 
CISC vs RISC Processor Architecture
CISC vs RISC Processor ArchitectureCISC vs RISC Processor Architecture
CISC vs RISC Processor ArchitectureKaushik Patra
 
Risc and cisc eugene clewlow
Risc and cisc   eugene clewlowRisc and cisc   eugene clewlow
Risc and cisc eugene clewlowManish Prajapati
 
Dsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issuesDsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issuesHome
 
16bit RISC Processor
16bit RISC Processor16bit RISC Processor
16bit RISC ProcessorShashi Suman
 
RISC and CISC Processors
RISC and CISC ProcessorsRISC and CISC Processors
RISC and CISC ProcessorsAdeel Rasheed
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRavikumar Tiwari
 
Comparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCComparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCApurv Nerlekar
 
Central processing unit
Central processing unitCentral processing unit
Central processing unitKamal Acharya
 
Risc and cisc computers
Risc and cisc computersRisc and cisc computers
Risc and cisc computersankita mundhra
 
A 64-Bit RISC Processor Design and Implementation Using VHDL
A 64-Bit RISC Processor Design and Implementation Using VHDL A 64-Bit RISC Processor Design and Implementation Using VHDL
A 64-Bit RISC Processor Design and Implementation Using VHDL Andrew Yoila
 

Mais procurados (20)

Risc and cisc casestudy
Risc and cisc casestudyRisc and cisc casestudy
Risc and cisc casestudy
 
Tibor
TiborTibor
Tibor
 
Risc and cisc eugene clewlow
Risc and cisc   eugene clewlowRisc and cisc   eugene clewlow
Risc and cisc eugene clewlow
 
CISC vs RISC Processor Architecture
CISC vs RISC Processor ArchitectureCISC vs RISC Processor Architecture
CISC vs RISC Processor Architecture
 
Risc and cisc eugene clewlow
Risc and cisc   eugene clewlowRisc and cisc   eugene clewlow
Risc and cisc eugene clewlow
 
Dsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issuesDsdco IE: RISC and CISC architectures and design issues
Dsdco IE: RISC and CISC architectures and design issues
 
16bit RISC Processor
16bit RISC Processor16bit RISC Processor
16bit RISC Processor
 
ITFT_Risc
ITFT_RiscITFT_Risc
ITFT_Risc
 
Risc vs cisc
Risc vs ciscRisc vs cisc
Risc vs cisc
 
RISC and CISC Processors
RISC and CISC ProcessorsRISC and CISC Processors
RISC and CISC Processors
 
CISC VS CISC
CISC VS CISCCISC VS CISC
CISC VS CISC
 
Risc and cisc
Risc and ciscRisc and cisc
Risc and cisc
 
Risc
RiscRisc
Risc
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
 
Risc and cisc
Risc and ciscRisc and cisc
Risc and cisc
 
Comparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCComparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARC
 
Central processing unit
Central processing unitCentral processing unit
Central processing unit
 
Risc and cisc computers
Risc and cisc computersRisc and cisc computers
Risc and cisc computers
 
Presentation on risc pipeline
Presentation on risc pipelinePresentation on risc pipeline
Presentation on risc pipeline
 
A 64-Bit RISC Processor Design and Implementation Using VHDL
A 64-Bit RISC Processor Design and Implementation Using VHDL A 64-Bit RISC Processor Design and Implementation Using VHDL
A 64-Bit RISC Processor Design and Implementation Using VHDL
 

Destaque

Risc cisc Difference
Risc cisc DifferenceRisc cisc Difference
Risc cisc DifferenceSehrish Asif
 
Computer architecture
Computer architectureComputer architecture
Computer architectureZuhaib Zaroon
 
Lec18 pipeline
Lec18 pipelineLec18 pipeline
Lec18 pipelineGRajendra
 
10 instruction sets characteristics
10 instruction sets characteristics10 instruction sets characteristics
10 instruction sets characteristicsSher Shah Merkhel
 
An intel architecture, which is a cisc 2
An intel architecture, which is a cisc 2An intel architecture, which is a cisc 2
An intel architecture, which is a cisc 2Azhar Abbas
 
Advanced Computer Architecture: Risc-Cisc by Nisarg Vasavada
Advanced Computer Architecture: Risc-Cisc by Nisarg VasavadaAdvanced Computer Architecture: Risc-Cisc by Nisarg Vasavada
Advanced Computer Architecture: Risc-Cisc by Nisarg VasavadaNisarg Vasavada
 
Base des systèmes à microprocesseur
Base des systèmes à microprocesseurBase des systèmes à microprocesseur
Base des systèmes à microprocesseurPeronnin Eric
 
Lecture 2
Lecture 2Lecture 2
Lecture 2GIKI
 
Arm système embarqué
Arm système embarquéArm système embarqué
Arm système embarquéHoussem Rouini
 
Lecture 1
Lecture 1Lecture 1
Lecture 1GIKI
 
pipeline and vector processing
pipeline and vector processingpipeline and vector processing
pipeline and vector processingAcad
 
External memory - Computer Architecture
External memory - Computer ArchitectureExternal memory - Computer Architecture
External memory - Computer ArchitectureBretz Harllynne Moltio
 
Ch8 (1) morris mano
Ch8 (1) morris manoCh8 (1) morris mano
Ch8 (1) morris manoKIRTI89
 
Routing algorithm network layer
Routing algorithm  network layerRouting algorithm  network layer
Routing algorithm network layersambhenilesh
 

Destaque (20)

CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
Risc cisc Difference
Risc cisc DifferenceRisc cisc Difference
Risc cisc Difference
 
13 risc
13 risc13 risc
13 risc
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Lec18 pipeline
Lec18 pipelineLec18 pipeline
Lec18 pipeline
 
10 instruction sets characteristics
10 instruction sets characteristics10 instruction sets characteristics
10 instruction sets characteristics
 
Risc and cisc
Risc and ciscRisc and cisc
Risc and cisc
 
An intel architecture, which is a cisc 2
An intel architecture, which is a cisc 2An intel architecture, which is a cisc 2
An intel architecture, which is a cisc 2
 
Nmas ass
Nmas assNmas ass
Nmas ass
 
Advanced Computer Architecture: Risc-Cisc by Nisarg Vasavada
Advanced Computer Architecture: Risc-Cisc by Nisarg VasavadaAdvanced Computer Architecture: Risc-Cisc by Nisarg Vasavada
Advanced Computer Architecture: Risc-Cisc by Nisarg Vasavada
 
Io (2)
Io (2)Io (2)
Io (2)
 
Base des systèmes à microprocesseur
Base des systèmes à microprocesseurBase des systèmes à microprocesseur
Base des systèmes à microprocesseur
 
Program control
Program controlProgram control
Program control
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Arm système embarqué
Arm système embarquéArm système embarqué
Arm système embarqué
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
pipeline and vector processing
pipeline and vector processingpipeline and vector processing
pipeline and vector processing
 
External memory - Computer Architecture
External memory - Computer ArchitectureExternal memory - Computer Architecture
External memory - Computer Architecture
 
Ch8 (1) morris mano
Ch8 (1) morris manoCh8 (1) morris mano
Ch8 (1) morris mano
 
Routing algorithm network layer
Routing algorithm  network layerRouting algorithm  network layer
Routing algorithm network layer
 

Semelhante a Reduced instruction set computers

Risc processors all syllabus5
Risc processors all syllabus5Risc processors all syllabus5
Risc processors all syllabus5faiyaz_vt
 
A Software Factory Integrating Rational Team Concert and WebSphere tools
A Software Factory Integrating Rational Team Concert and WebSphere toolsA Software Factory Integrating Rational Team Concert and WebSphere tools
A Software Factory Integrating Rational Team Concert and WebSphere toolsProlifics
 
WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...
WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...
WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...KumarSuman24
 
Exploring NISC Architectures for Matrix Application
Exploring NISC Architectures for Matrix ApplicationExploring NISC Architectures for Matrix Application
Exploring NISC Architectures for Matrix ApplicationIDES Editor
 
Presentation date -20-nov-2012 for prof. chen
Presentation date -20-nov-2012 for prof. chenPresentation date -20-nov-2012 for prof. chen
Presentation date -20-nov-2012 for prof. chenTAIWAN
 
Singularity Rethinking The Software Stack
Singularity    Rethinking The  Software  StackSingularity    Rethinking The  Software  Stack
Singularity Rethinking The Software Stackalanocu
 
CSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.ppt
CSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.pptCSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.ppt
CSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.pptEricSifuna1
 
OLA Conf 2002 - OLA in SoC Design Environment - paper
OLA Conf 2002 - OLA in SoC Design Environment - paperOLA Conf 2002 - OLA in SoC Design Environment - paper
OLA Conf 2002 - OLA in SoC Design Environment - paperTim55Ehrler
 
OpenHPC: A Comprehensive System Software Stack
OpenHPC: A Comprehensive System Software StackOpenHPC: A Comprehensive System Software Stack
OpenHPC: A Comprehensive System Software Stackinside-BigData.com
 
CS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptxCS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptxAsst.prof M.Gokilavani
 
Computer Organisation and Architecture Teaching Trends
Computer Organisation and Architecture Teaching TrendsComputer Organisation and Architecture Teaching Trends
Computer Organisation and Architecture Teaching Trendsyogesh1617
 
Computer Oraganisation and Architecture
Computer Oraganisation and ArchitectureComputer Oraganisation and Architecture
Computer Oraganisation and Architectureyogesh1617
 
Computer architecture overview
Computer architecture overviewComputer architecture overview
Computer architecture overviewMuhammad Ishaq
 

Semelhante a Reduced instruction set computers (20)

Risc processors all syllabus5
Risc processors all syllabus5Risc processors all syllabus5
Risc processors all syllabus5
 
A Software Factory Integrating Rational Team Concert and WebSphere tools
A Software Factory Integrating Rational Team Concert and WebSphere toolsA Software Factory Integrating Rational Team Concert and WebSphere tools
A Software Factory Integrating Rational Team Concert and WebSphere tools
 
Software engg lect1
Software engg lect1Software engg lect1
Software engg lect1
 
R&c
R&cR&c
R&c
 
WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...
WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...
WINSEM2023-24_BCSE429L_TH_CH2023240501528_Reference_Material_III_S3-Homoheter...
 
Exploring NISC Architectures for Matrix Application
Exploring NISC Architectures for Matrix ApplicationExploring NISC Architectures for Matrix Application
Exploring NISC Architectures for Matrix Application
 
Presentation date -20-nov-2012 for prof. chen
Presentation date -20-nov-2012 for prof. chenPresentation date -20-nov-2012 for prof. chen
Presentation date -20-nov-2012 for prof. chen
 
Unit1
Unit1Unit1
Unit1
 
Singularity Rethinking The Software Stack
Singularity    Rethinking The  Software  StackSingularity    Rethinking The  Software  Stack
Singularity Rethinking The Software Stack
 
CSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.ppt
CSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.pptCSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.ppt
CSC 457 - Advanced Microprocessor Architecture Lecture Notes - 31.08.2021.ppt
 
ctchou-resume
ctchou-resumectchou-resume
ctchou-resume
 
Unit I_MT2301.pdf
Unit I_MT2301.pdfUnit I_MT2301.pdf
Unit I_MT2301.pdf
 
OLA Conf 2002 - OLA in SoC Design Environment - paper
OLA Conf 2002 - OLA in SoC Design Environment - paperOLA Conf 2002 - OLA in SoC Design Environment - paper
OLA Conf 2002 - OLA in SoC Design Environment - paper
 
OpenHPC: A Comprehensive System Software Stack
OpenHPC: A Comprehensive System Software StackOpenHPC: A Comprehensive System Software Stack
OpenHPC: A Comprehensive System Software Stack
 
CS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptxCS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptx
 
Architectures
ArchitecturesArchitectures
Architectures
 
ctchou-resume
ctchou-resumectchou-resume
ctchou-resume
 
Computer Organisation and Architecture Teaching Trends
Computer Organisation and Architecture Teaching TrendsComputer Organisation and Architecture Teaching Trends
Computer Organisation and Architecture Teaching Trends
 
Computer Oraganisation and Architecture
Computer Oraganisation and ArchitectureComputer Oraganisation and Architecture
Computer Oraganisation and Architecture
 
Computer architecture overview
Computer architecture overviewComputer architecture overview
Computer architecture overview
 

Reduced instruction set computers

  • 1. Datorarkitektur Fö 5/6 - 1 Datorarkitektur Fö 5/6 - 2 What are RISCs and why do we need them? REDUCED INSTRUCTION SET COMPUTERS • RISC architectures represent an important (RISC) innovation in the area of computer organization. • The RISC architecture is an attempt to produce more CPU power by simplifying the instruction set of the CPU. • The opposed trend to RISC is that of complex instruction set computers (CISC). 1. Why do we need RISCs? 2. Some Typical Features of Current Programs Both RISC and CISC architectures have been developed as an attempt to cover the semantic gap. 3. Main Characteristics of RISC Architectures 4. Are RISCs Really Better than CISCs? 5. Examples Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH Datorarkitektur Fö 5/6 - 3 Datorarkitektur Fö 5/6 - 4 The Semantic Gap The Semantic Gap (cont’d) growing abstraction level High-level language (HLL) Problem: How should new HLL programs be compiled the semantic gap and executed efficiently on a processor architecture? Two possible answers: Machine language (machine architecture fully visible) 1. The CISC approach: design very complex architectures including a large number of instructions and addressing modes; include also instructions close to those present in HLL. • In order to improve the efficiency of software development, new and powerful programming 2. The RISC approach: simplify the instruction set and languages have been developed (Ada, C++, Java). adapt it to the real requirements of user programs. They provide: high level of abstraction, conciseness, power. • By this evolution the semantic gap grows. Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
  • 2. Datorarkitektur Fö 5/6 - 5 Datorarkitektur Fö 5/6 - 6 Evaluation of Program Execution Frequency of Instructions Executed or • Frequency distribution of executed machine What are Programs Doing Most of the Time? instructions: - moves: 33% - conditional branch: 20% • Several studies have been conducted to determine - Arithmetic/logic: 16% the execution characteristics of machine instruction - others: Between 0.1% and 10% sequences generated from HLL programs. • Addressing modes: the overwhelming majority of instructions uses simple addressing modes, in • Aspects of interest: which the address can be calculated in a single cycle (register, register indirect, displacement); 1. The frequency of operations performed. complex addressing modes (memory indirect, 2. The types of operands and their frequency of indexed+indirect, displacement+indexed, stack) are use. used only by ~18% of the instructions. 3. Execution sequencing (frequency of jumps, loops, subprogram calls). Operand Types • 74 to 80% of the operands are scalars (integers, reals, characters, etc.) which can be hold in registers; • the rest (20-26%) are arrays/structures; 90% of them are global variables; • 80% of the scalars are local variables. The majority of operands are local variables of scalar type, which can be stored in registers. Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH Datorarkitektur Fö 5/6 - 7 Datorarkitektur Fö 5/6 - 8 Procedure Calls (cont’d) Procedure Calls int x, y; float z; void proc3(int a, int b, int c) { - - - - - - - - - - - - - -- - - Investigations have been also performed about the } percentage of the total execution time spent executing a --------------------- certain HLL instruction. void proc2(int k) { int j, q; • It turned out that comparing HLL instructions, most ----------------- of the time is spent executing CALLs and proc3(j, 5, q); RETURNs. } • Even if only 15% of the executed HLL instructions --------------------- is a CALL or RETURN, they are executed most of void proc1() { the time, because of their complexity. int i; • A CALL or RETURN is compiled into a relatively ----------------- long sequence of machine instructions with a lot of proc2(i); memory references. } --------------------- main () { proc1(); } Some statistics concerning procedure calls: • Only 1.25% of called procedures have more than six parameters. • Only 6.7% of called procedures have more than six local variables. • Chains of nested procedure calls are usually short and only very seldom longer than 6. Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
  • 3. Datorarkitektur Fö 5/6 - 9 Datorarkitektur Fö 5/6 - 10 Main Characteristics of RISC Architectures Conclusions from Evaluation of Program Execution • The instruction set is limited and includes only simple instructions. • An overwhelming preponderance of simple (ALU and move) operations over complex operations. - The goal is to create an instruction set contain- • Preponderance of simple addressing modes. ing instructions that execute quickly; most of the • Large frequency of operand accesses; on average RISC instructions are executed in a single each instruction references 1.9 operands. machine cycle (after fetched and decoded). • Most of the referenced operands are scalars (so • Pipeline operation (without memory reference): they can be stored in a register) and are local variables or parameters. FI DI EI • Optimizing the procedure CALL/RETURN mechanism promises large benefits in speed. - RISC instructions, being simple, are hard-wired, while CISC architectures have to use micropro- gramming in order to implement complex These conclusions have been at the starting point to the instructions. Reduced Instruction Set Computer (RISC) approach. - Having only simple instructions results in re- duced complexity of the control unit and the data path; as a consequence, the processor can work at a high clock frequency. - The pipelines are used efficiently if instructions are simple and of similar execution time. - Complex operations on RISCs are executed as a sequence of simple RISC instructions. In the case of CISCs they are executed as one single or a few complex instruction. Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH Datorarkitektur Fö 5/6 - 11 Datorarkitektur Fö 5/6 - 12 Main Characteristics of RISC Architectures (cont’d) Main Characteristics of RISC Architectures (cont’d) Let’s see some small example: • Load-and-store architecture Assume: - Only LOAD and STORE instructions reference - we have a program with 80% of executed data in memory; all other instructions operate instructions being simple and 20% complex; only with registers (are register-to-register in- structions); thus, only the few instructions ac- - on a CISC machine simple instructions take 4 cessing memory need more than one cycle to cycles, complex instructions take 8 cycles; execute (after fetched and decoded). cycle time is 100 ns (10-7 s); • Pipeline operation with memory reference: - on a RISC machine simple instructions are executed in one cycle; complex operations are FI DI CA TR CA: compute address implemented as a sequence of instructions; we consider on average 14 instructions (14 cycles) TR: transfere for a complex operation; cycle time is 75 ns (0.75 * 10-7 s). • Instructions use only few addressing modes - Addressing modes are usually register, direct, How much time takes a program of 1 000 000 instructions? register indirect, displacement. CISC: (106*0.80*4 + 106*0.20*8)*10-7 = 0.48 s RISC: (106*0.80*1 + 106*0.20*14)*0.75*10-7 = 0.27 s • Instructions are of fixed length and uniform format • complex operations take more time on the RISC, - This makes the loading and decoding of but their number is small; instructions simple and fast; it is not needed to wait until the length of an instruction is known in • because of its simplicity, the RISC works at a order to start decoding the following one; smaller cycle time; with the CISC, simple instructions are slowed down because of the - Decoding is simplified because opcode and ad- increased data path length and the increased dress fields are located in the same position for control complexity. all instructions Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
  • 4. Datorarkitektur Fö 5/6 - 13 Datorarkitektur Fö 5/6 - 14 Main Characteristics of RISC Architectures (cont’d) Main Characteristics of RISC Architectures (cont’d) Is the above strategy realistic? • A large number of registers is available - The strategy is realistic, because the number of - Variables and intermediate results can be local variables in procedures is not large. The stored in registers and do not require repeated chains of nested procedure calls is only excep- loads and stores from/to memory. tionally larger than 6. - All local variables of procedures and the passed - If the chain of nested procedure calls becomes parameters can be stored in registers (see slide large, at a certain call there will be no registers 8 for comments on possible number of variables to be assigned to the called procedure; in this and parameters). case local variables and parameters have to be stored in memory. What happens when a new procedure is called? - Normally the registers have to be saved in Why is a large number of registers typical for RISC memory (they contain values of variables and architectures? parameters for the calling procedure); at return to the calling procedure, the values have to be again loaded from memory. This takes a lot of - Because of the reduced complexity of the proc- time. essor there is enough space on the chip to be allocated to a large number of registers. This, - If a large number of registers is available, a new usually, is not the case with CISCs. set of registers can be allocated to the called procedure and the register set assigned to the calling one remains untouched. Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH Datorarkitektur Fö 5/6 - 15 Datorarkitektur Fö 5/6 - 16 Main Characteristics of RISC Architectures (cont’d) The delayed load problem (cont’d) • With delayed load the processor always executes The delayed load problem the instruction following a LOAD, without a stall; It is the programmers (compilers) responsibility that this instruction does not need the loaded value. • LOAD instructions (similar to the STORE) require memory access and their execution cannot be completed in a single clock cycle. However, in the next cycle a new instruction is The following sequence is not correct with such a started by the processor. processor, and a compiler will not generate something like this: LOAD R1,X FI DI CA TR ADD R2,R1 FI DI stall EI LOAD R1,X loads from address X into R1 ADD R2,R1 R2 ← R2 + R1 ADD R4,R3 FI DI EI ADD R4,R3 R4 ← R4 + R3 SUB R2,R4 R2 ← R2 - R4 Two possible solutions: The value in R1 is 1. The hardware should delay the execution of not yet available! the instruction following the LOAD, if this in- LOAD R1,X FI DI CA TR struction needs the loaded value ADD R2,R1 FI DI EI 2. A more efficient, compiler based, solution, which has similarities with the delayed ADD R4,R3 FI DI EI branching, is the delayed load: SUB R2,R4 FI DI EI Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH
  • 5. Datorarkitektur Fö 5/6 - 17 Datorarkitektur Fö 5/6 - 18 The delayed load problem (cont’d) Are RISCs Really Better than CISCs? The following one is the correct sequence: LOAD R1,X loads from address X into R1 ADD R4,R3 R4 ← R4 + R3 ADD R2,R1 R2 ← R2 + R1 • RISC architectures have several advantages and they were discussed throughout this lecture. SUB R2,R4 R2 ← R2 - R4 However, a definitive answer to the above question is difficult to give. LOAD R1,X FI DI CA TR • A lot of performance comparisons have shown that ADD R4,R3 FI DI EI benchmark programs are really running faster on RISC processors than on processors with CISC ADD R2,R1 FI DI EI characteristics. SUB R2,R4 FI DI EI • However, it is difficult to identify which feature of a processor produces the higher performance. Some "CISC fans" argue that the higher speed is not For the following sequence the compiler has generated a produced by the typical RISC features but because NOP after the LOAD because there is no instruction to of technology, better compilers, etc. fill the load-delay slot: • An argument in favour of the CISC: the simpler LOAD R1,X loads from address X into R1 instruction set of RISC processors results in a NOP larger memory requirement compared to the similar ADD R2,R1 R2 ← R2 + R1 program compiled for a CISC architecture. ADD R4,R2 R4 ← R4 + R2 STORE R4,X stores from R4 to address X Most of the current processors are not typical RISCs LOAD R1,X FI DI CA TR or CISCs but try to combine advantages of both approaches NOP ADD R2,R1 FI DI EI ADD R4,R2 FI DI EI STORE R4,X FI DI CA TR Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH Datorarkitektur Fö 5/6 - 19 Datorarkitektur Fö 5/6 - 20 Some Processor Examples Summary CISC Architectures: VAX 11/780 Nr. of instructions: 303 • Both RISCs and CISCs try to solve the same prob- Instruction size: 2 - 57 lem: to cover the semantic gap. They do it in differ- Instruction format: not fixed ent ways. CISCs are going the traditional way of implementing more and more complex instructions. Addressing modes: 22 RISCs try to simplify the instruction set. Number of general purpose registers: 16 • Innovations in RISC architectures are based on a Pentium close analysis of a large set of widely used Nr. of instructions: 235 programs. Instruction size: 1 - 11 • The main features of RISC architectures are: Instruction format: not fixed reduced number of simple instructions, few Addressing modes: 11 addressing modes, load-store architecture, Number of general purpose registers: 8 instructions are of fixed length and format, a large number of registers is available. • One of the main concerns of RISC designers was RISC Architectures: to maximise the efficiency of pipelining. Sun SPARC • Present architectures often include both RISC and Nr. of instructions: 52 CISC features. Instruction size: 4 Instruction format: fixed Addressing modes: 2 Number of general purpose registers: up to 520 PowerPC Nr. of instructions: 206 Instruction size: 4 Instruction format: not fixed (but small differences) Addressing modes: 2 Number of general purpose registers: 32 Petru Eles, IDA, LiTH Petru Eles, IDA, LiTH