BCA Paper-VII Block-2 Unit-8
BCA Paper-VII Block-2 Unit-8
BCA Paper-VII Block-2 Unit-8
Lesson Structure
8.0 Objectives
8.1 Introduction
8.7 Summary
8.8 Questions
8.0 Objectives
After going through this Unit you should be able to :
define and describe the reasons for developing RISC;
describe the design principles of RISC;
describe why large register file are important for fast processing;
define and describe RISC pipelining and the optimisation in RISC pipelining.
Reduced Instruction Set Computer Architecture
8.1 Introduction
We have already discussed the instruction set, register organization and
pipelining, and control unit organization in the previous unit. In the early years a
large instruction set, a large number of addressing modes and about 16-32 registers
were used. But it was required to make the instruction set simple and less. This led
to the development of a new type of computers called Reduced Instruction Set
Computer (RISC). In this unit, we will discuss about the RISC machines. Our
emphasis will be on discussing the basic principles of RISC and its pipelining along
with a comparative analysis of RISC and CISC architecture.
resources inside the chip. The RISC processors are considered to support a smaller
list of simpler instructions and hardwired control unit which help in fast execution.,
as it takes shorter duration in finding the requisite instruction.
8.2.1 Importance of RISC Processors
RISC processors exhibit certain distinct features compared to the CISC
processors. They include :
Few Powerful Instructions
Single clock Cycle execution (for most instruction)
Register-based execution
Highly Pipelined Superscalar Architecture
Fixed Instruction Format and fixed length instruction
Large register set or register windows
Hardwired control Unit
Highly Integrated Architecture
Examples of RISC processor
RISC has fewer design bugs, its simple instructions reduce design time. Thus,
because of all the above important reasons RISC processors have become very
popular. Some of the RISC processors are :
i860, SPARC Processors
Sun 4/350 SPARCserver 350, Sun 4/360 SPARCserver 360, Sun 4/370
SPARCserver 370, Sun 4/20, SPARCstation SLC, Sun 4/40 SPARCstation IPC, Sun
4/75, SPARCstation 2.
PowerPC Processors (Power refers to Optimisation with enhanced RISC).
MPC755, MPC7400/7410, MPC745X, MPC7450, MPC8240, MPC8245.
Titanium-IA64 Processor
RISC processors are used to build supercomputers for high performance
computing. For example, i860 family of processors are used to build PARAM
(PARALLEL Machine), PARALLEL Super Computer of Centre for Development of
Advanced Computing (C-DAC), India.
8.2.2 Reasons for Increased Complexity
The reasons for increased complexity are :
Speed gap between Memory and CPU
In the past, there was a big gap between the speed of a processor and
memory. Thus, a subroutine execution for an instruction, for example floating point
addition, may have to follow a lengthy instruction sequence. The question is, if we
[ 187 ]
Reduced Instruction Set Computer Architecture
make it a machine instruction then only one instruction fetch will be required and
rest will be done with control unit sequence. Thus, a "higher level" instruction can
be added to machines in a attempt to improve performance.
However, today the Main memory is supported with Cache technology. Cache
memories have reduced the difference between the CPU and the memory speed and,
therefore, an instruction execution through a subroutine step may not be that
difficult. Pipelining can further enhance such speed.
Microcode technology versus VLSI Technology
The control unit of a computer can be constructed using two ways: create
micro-program that execute micro-instructions or build circuits (hardwired) for each
instruction execution. Micro-programmed control allows the implementation of
complex architectures more cost effective than hardwired control as the cost to
expand an instruction set is very small, only a few more microinstructions for the
control store. Thus it may be reasoned that moving subroutines like string editing,
integer to floating point number conversion and mathematical evaluations such as
polynomial evaluation to control unit micro-program is more cost effective.
Code Density versus Fast execution of programs
The memory was very large and expensive in the older computer. Thus there
was a need of less memory utilization, that is, it was cost effective to have smaller
compact programs. Thus, it was thought that the instruction set should be more
complex, so that programs are smaller. However, increased complexity of instruction
sets had resulted in instruction sets and addressing modes requiring more bits to
represent them. It is stated that the code compaction is important, but the cost of
10 percent more memory is often far less than the cost of reducing code by 10
percent out of the CPU architecture innovations.
The smaller programs are advantageous because they require smaller RAM
space. However, today memory is very inexpensive, this potential advantage today is
not so compelling. More important, small programs should improve performance
because fewer instructions mean fewer instruction bytes to be fetched.
Support for High-Level Language
With the advent and use of more and more higher level languages,
manufactures had provided more powerful instructions to support them. It was
argued that a stronger instruction set would reduce the software crisis and would
simplify the compilers. Another important reason for such a movement was the
desire to improve performance.
However, even though the instructions that were closer to the high level
languages were implemented in Complex Instruction Set Computers (CISCs), still it
[ 188 ]
Reduced Instruction Set Computer Architecture
was hard to exploit these instructions since the compliers were needed to find those
conditions that exactly fit those constructs. In addition, the task of optimising the
generated code to minimise code size, reduce instruction execution count, and
enhance pipelining is much more difficult with such a complex instruction set.
Another motivation for increasingly complex instructions sets was that the
complex HLL operation would execute more quickly as a single machine instruction
rather than as a series of more primitive instructions. CISC makes the more complex
control unit with larger micro program control store to accommodate a richer
instruction set. This increases the execution time for simpler instructions. Thus, it is
far from clear that the trend to complex instruction sets is appropriate.
[ 190 ]
Reduced Instruction Set Computer Architecture
than micro-instructions, it can use fast logic circuits for control unit, thus increasing
the execution efficiency further.
Register-to-register operands : In RISC machines the operation that
access memories are LOAD and STORE. All other operands are kept in registers. This
design feature simplifies the instruction set and, therefore, simplifies the control
unit. For example, a RISC instruction set may include only one or two ADD
instructions (e.g. integer add and add with carry); on the other hand a CISC
machine can have 25 add instructions involving different addressing modes. Another
benefit is that RISC encourages the optimization of register use, so that frequently
used operands remain in registers.
Simple addressing modes : Another characteristic is the use of simple
addressing modes. The RISC machines use simple register addressing having
displacement and PC relative modes. More complex modes are synthesized in
software from these simple ones. Again, this feature also simplifies the instruction
set and the control unit.
Simple instruction formats : RISC uses simple instruction formats.
Generally, only one or a few instruction formats are used. In such machines the
instruction length is fixed and aligned on word boundaries. In addition, the field
locations can also be fixed. Such an instruction format has a number of benefits.
With fixed fields, opcode decoding and register operand accessing can occur in
parallel. Such a design has many advantages. These are :
It simplifies the control unit
Simple fetching as memory words of equal size are to be fetched
Instructions are not across page boundaries.
Thus, RISC is potentially a very strong architecture. It has high performance
potential and can support VLSI implementation. Let us discuss these points in more
detail.
Performance using optimizing compilers : As the instructions are simple
the compilers can be developed for efficient code organization also maximizing
register utilization etc. Sometimes even the part of the complex instruction can be
executed during the compile time.
High performance of Instruction execution : While mapping of HLL to
machine instruction the compiler favours relatively simple instructions. In addition,
the control unit design is simple and it uses little or no micro-instructions, thus could
execute simple instructions faster than a comparable CISC. Simple instructions
support better possibilities of using instruction pipelining.
[ 191 ]
Reduced Instruction Set Computer Architecture
PROC A
R31 A
HIGHA
137
132
R26 A
R25 A
LOCALA
131
10
R16 C
R15 C
LOWC
19
14
R10 C
Thus the register file, organized in the form as above, is small fast register
buffer that holds most of the variables that are likely to be used heavily. From this
point of view the register file acts almost like a caches memory.
Characteristics of large-register-file and cache organizations
All points above basically show comparative equality. The basic difference is
due to addressing overhead of the two approaches.
The following figure shows the difference. Small register (R) address is added
with current window Pointer W#. This generates the address in register file, which is
decoded by decoder for register access. On the other hand Cache reference will be
generated from a long memory address, which first goes through comparison logic
to ascertain the presence of data, and if the data is present it goes through the
select circuit. Thus, for simple variables access register file is superior to cache
memory.
However, even in RISC computer, performance can be enhanced by the
addition of instruction cache.
Registers
Instruction R
Data
W# Decoder
Instruction Cache
A Tag Data
A >> R
Compare
Select
DATA
[ 194 ]
Reduced Instruction Set Computer Architecture
[ 195 ]
Reduced Instruction Set Computer Architecture
per cent. In addition, the control is simple in RISC than CISC, ths further helping the
simple instructions to execute faster.
Pipeline optimization
In order to make processors even faster, various methods of optimizing
pipelines have been devised.
Super-pipelining refer to dividing the pipeline into more steps. The more pipe
stages there are, the faster the pipeline is because each stage is then shorter.
Ideally, a pipeline with five stages should be five times faster than a non-pipelined
processor (or rather, a pipeline with one stage). The instructions are executed at the
speed at which each stage is completed, and each stage takes one fifth of the
amount of time that the non-pipelined instruction takes. Thus, a processor with an
8-step pipeline (the MIPS R4000) will be even faster than its 5-step counterpart. The
MIPS R4000 chops its pipeline into more pieces by dividing some steps into two.
Instruction fetching, for example, is now done in two stages rather than one. The
states are as shown :
1. Instruction Fetch (First Half)
2. Instruction Fetch (Second Half)
3. Register Fetch
4. Instruction Execute
5. Data Cache Access (First Half)
6. Data Cache Access (Second Half)
7. Tag Check
8. Write Back
Superscalar pipelining involves multiple pipelines in parallel. Internal
components of the processor are replicated so it can launch multiple instructions in
some or all of its pipeline stages. The RISC System/6000 has a forked pipeline with
different paths for floating-point and integer instructions. If there is a mixture of
both types in a program, the processor can keep both forks running simultaneously.
Both types of instructions share two initial stages (Instruction Fetch and Instruction
Dispatch) before they fork. Often, however, superscalar pipelining refers to multiple
copies of all pipeline. Many of today's machines attempt to find two to six
instructions that it can execute in every pipeline stage. If some of the instructions
are dependent, however, only the first instruction or instructions are issued.
[ 197 ]
Reduced Instruction Set Computer Architecture
In-order commit
Commit unit
LOAD R1 M (1) F E D
LOAD R2 M (2) F E D
SUB RS R1 – R2 F E
IF RS < 0 Return F E
ADD RA R1 + R2 F E
STOR M(A) F E D
RETURN F E
Finally, let us summarize the basic differences between CISC and RISC
architecture. The following table lists these differences :
CISC RISC
1 Complex instructions taking multiple Simple instructions taking 1 cycle
cycles
2 Any instruction may reference Only LOADS/STORES reference
memory memory
3 Not pipelined or less pipelined Highly pipelined
4 Instructions interpreted by the Instructions executed by the
microprogram hardware
5 Variable format instructions Fixed format instructions
6 Many instructions and modes Few instructions and modes
7 Complexity in the microprogram Complexity is in the compiler
8 Single register set Multiple register sets
Table 2 : Difference between RISC and CISC
Source :
www.egr.msu.edu/classes/ece482/Teams/97fall/xdesign2/arm/andy.doc
8.7 Summary
In this unit we have given details of RISC. RISC represents new styles of
computers that take less time to build yet provide a higher performance. While
traditional machines support High Level Languages (HLLs) with instruction, this
[ 199 ]
Reduced Instruction Set Computer Architecture
machine supports the use of HLLs with instructions that HLL compilers can use
efficiently. The loss of complexity has not reduced RISC's functionality; the chosen
subset, especially when combined with the register window scheme, emulates more
complex machines. It also appears that we can build such a single chip computer
much sooner and with much less effort than traditional architectures.
Thus, we see that because of all the features discussed above, the RISC
architecture should prove to be far superior to even the most complex CISC
architecture. In this unit we have also covered the details of the pipelined features
of the RISC architecture, which further strengthen our arguments for the support of
this architecture.
8.8 Questions
1. What is RISC ? Describe the importance of RISC processor.
2. What is the for Increased complexity ? Explain.
3. Explain some important considerations of RISC architecture.
4. What is Large Register File ? Describe the characteristics of Large
Register file and cache organisation.
5. Explain RISC Pipelining with an example. What is delayed branching ?
[ 200 ]