Reduced Instruction Set Computing
(RISC)
krraju.in
What you’ll learn
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
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)
RISC (Reduced Instruction Set Computer)
3
krraju.in
4
CISC Characteristics
krraju.in
RISC Characteristics
5
krraju.in
RISC Characteristics contd..
6
krraju.in
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.
krraju.in
Performance
At the gate level, both RISC and CISC systems perform an equivalent quantity of work
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
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
Chip Complexity
10
RISC design reduces instruction complexity resulting in simpler chips.
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.
Typically 16 register sets (or windows) of 32 registers each are included
krraju.in
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.
krraju.in
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
Register Window Relationships
13
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
Recap
14
krraju.in