How many instructions should I have?
More instructions
greater functionality.
Greater number of instructions one can perform more complex
manipulations with a single operation.
Large number of instructions supported for specialised operations:
Complex Instruction Set Computer (CISC)
Suppose I wanted to calculate the average of two numbers:
One way to do this would be to load A into a register, add B
to the contents
of this register and then divide by 2. This would be performed by a
sequence of instructions
as follows:
The result of our operation would then be left in the
accumulator AC. An alternative would
be to generate a single instruction to perform this average,
called AVG for instance:
which would automatically perform all of the above steps, and store the
result in the accumulator AC.
CISC: Pentium-MMX. Traditional approach to instruction set design. Complex instruction set was used to reduce the amount of memory needed. More complex operations were available, fewer needed to be stored in memory. Memory slower than CPU, hence time spent retrieving the instruction from memory was reduced.
Reduced Instruction Set Computer (RISC) RISC computers reduce chip complexity by using simpler instructions only. Total number of instructions is reduced. RISC compilers have to generate software routines to perform complex instructions. RISC: fixed instructions size, CISC: variable instruction size. RISC chips are faster than comparable CISC chips. RISC: PowerPC, MIPS.
In making a design decision, the architect must favour the more frequent cases over the less frequent ones. The more frequent case is often simpler and can be done faster than the less frequent case. RISC and CISC are more design philosophies than actual structural differences.
Combining RISC and CISC:
Emulation: Translating CISC instructions to RISC. NexGen Nx586 is an 80x86 architecture, instructions fetched from memory are standard 80x86 instructions. Instructions executed in the processing pipelines are RISC-like translations of the CISC 80x86 instructions. Re-compilation to produce a new executable for the target architecture. Assembly-language translation tool: converting assembly-language software so that it becomes a full native program for the target architecture. Current trends seem to favour RISC. Better compilation techniques: may return to CISC concepts.