1 of 15

Reduced Instruction Set Computing

(RISC)

krraju.in

2 of 15

What you’ll learn

  • How CISC and RISC architectures are comparable?

2

Central Processing Unit: Introduction, General Register Organization, Stack Organization, Instruction Formats, Addressing Modes, Data Transfer and Manipulation, Program Control, Reduced Instruction Set Computer (RISC)

Unit-3

krraju.in

3 of 15

CISC and RISC

Before the 1970s: Trend was to construct more complex instruction sets containing hundreds of instructions and variations.

CISC (Complex Instruction Set Computer)

  • Designed to simplify compilation.
    • Single instruction for each high-level language statement.
  • Some of which may only be rarely used in practical programs.
    • Around 80% of them used 20% of the time only

RISC (Reduced Instruction Set Computer)

  • Simplification by implementing frequently used instructions,
  • Less common operations are implemented as subroutines
    • Additional execution time is offset by infrequent use

3

krraju.in

4 of 15

  • Many instructions (∼100 to 250) that implement complex tasks.
  • More complex addressing modes (∼5 to 20).
  • More complex instructions.
    • Programs that tend to be smaller in size
    • Some perform specialized tasks and are used infrequently.
    • An instruction may span multiple words.
  • Variable length instruction formats.
  • Instructions to manipulate operands in memory as well as registers.
  • Memory transfers using a single MOVE instruction.

4

CISC Characteristics

krraju.in

5 of 15

RISC Characteristics

  • Fewer instructions in the instruction set (∼100).
  • Simple addressing modes (∼3)
  • All instructions fitting in a single word. Fewer instruction formats.
  • Single-cycle instruction execution
  • A hardwired control unit
  • Minimized memory access
    • The CPU has a relatively large register set.
    • Ideally, most operations can be done register to register.
    • Memory access performed by load/store instructions only

5

krraju.in

6 of 15

RISC Characteristics contd..

  • Pipelined execution
    • Fast execution of all instructions by utilizing a large number of parallel data paths and overlapping the fetch and execute phases of successive instructions
  • Programs that tend to be larger in size,
    • because more, but simpler instructions are needed to perform complex tasks.
  • Support for most frequently used operations in the application inherently in the machine design, by using a judicious choice of instructions and optimized compilers

6

krraju.in

7 of 15

Performance

Computer performance, as measured by program execution time, is directly proportional to clock cycle time, the number of clock cycles per instruction, and the number of instructions in the program.

7

time

=

time

×

cycles

×

instructions

program

cycle

instruction

program

Shortening the clock cycle results in improved performance.

  • CISC machines increase performance by reducing the number of instructions per program.
  • RISC machines minimize the number of cycles per instruction.

krraju.in

8 of 15

Performance

At the gate level, both RISC and CISC systems perform an equivalent quantity of work

  • CISC machines rely on microcode to tackle instruction complexity.
  • In RISC systems, the complexity removed from the instruction set is pushed up a level into the domain of compiler
    • RISC designs move the complexity from hardware to software.

Compromise: For example, it is attractive to add some non-RISC instructions to a RISC processor in order to reduce the number of instructions executed, as long as execution of these instructions is fast

8

krraju.in

9 of 15

CISC vs RISC

Suppose register-to-register moves, adds, and loop operations each consume one clock cycle and multiplication requires 30 clock cycles to compute the product, 5 x 9:

9

CISC code

RISC code

mov ax, 9

mov bx, 5

mul bx, ax

Begin:

mov ax, 0

mov bx, 9

mov cx, 5

add ax, bx

loop Begin :causes a loop cx times

Total clock cycles= 32

{(2 movs×1)+(1 mul×30)}

Total clock cycles= 13

{(3 movs×1)+(5 adds×1)+(5 loops×1)}

Although code is shorter, it requires more clock cycles to execute.

Even though there are more instructions, the actual execution time is less for RISC than CISC. RISC clock cycles are often shorter than CISC clock cycles.

krraju.in

10 of 15

Chip Complexity

10

RISC design reduces instruction complexity resulting in simpler chips.

  • Transistors formerly employed in the execution of CISC instructions are used for pipelines, cache, and registers.

High-level languages depend on modularization for efficiency. Procedure calls and parameter passing

RISC chips having hundreds of registers, the saving and restoring sequence can be reduced to simply changing register environments.

  • When a program is executing in one environment, only one register set is visible. If the program changes to a different environment (when procedure is called), the visible set of registers for the new environment changes.

Typically 16 register sets (or windows) of 32 registers each are included

krraju.in

11 of 15

Register Windowing

11

Register windows are a feature which dedicates registers to a subroutine by dynamically aliasing a subset of internal registers to fixed, programmer-visible registers.

  • Implemented to improve the performance of a processor by reducing the number of stack operations required for function calls and returns

krraju.in

12 of 15

Register Windowing

12

Globals

A Inputs

A Locals

A Outputs

D Outputs

B Inputs

D Locals

B Locals

D Inputs

C Locals

B Outputs

C Outputs

C Inputs

Procedure A

(Window 1)

Procedure B

(Window 2)

Procedure C

(Window 3)

Procedure D

(Window 4)

R0

Globals

R0

Globals

R0

Globals

R0

Globals

...

...

...

...

R9

R9

R9

R9

R10

Inputs

cwp=10

R26

Outputs

...

...

R15

R31

R16

Locals

cwp=26

...

R25

R26

Outputs

R10

Inputs

...

...

R31

R15

R32

R16

Locals

cwp=42

...

...

R41

R25

R42

R26

Outputs

R10

Inputs

...

...

...

R47

R31

R15

R48

R16

Locals

cwp=58

...

...

R57

R25

R58

R26

Outputs

R10

Inputs

...

...

...

R63

R31

R15

R64

R16

Locals

...

...

R73

R25

CWP: Current window pointer

krraju.in

13 of 15

Register Window Relationships

13

  • G is the number of global registers,
  • L is the number of local registers in each window,
  • C is the number of registers common (input and output) to two windows
  • W is the number of windows

Then

Window size (number of registers available for each window) is L+2C+G

Register file (total number of registers needed in the processor) is (L+C)W+G

krraju.in

14 of 15

Recap

14

krraju.in

15 of 15

Video Links

15

krraju.in