It is not only the whole computer that can have a different architecture. This also touches processors. There are two main internal architectures of processors: CISC and RISC. CISC means Complex Instruction Set Computer while RISC stands for Reduced Instruction Set Computer. The naming difference can be a little confusing because it considers the instruction set to be complex or reduced. We can find CISC and RISC processors with similar number of instructions implemented. The difference is rather in the complexity of instructions not only the instruction set.
Complex instructions mean that the typical single instruction of a CISC processor makes more during its execution than typical RISC instruction. It also uses more sophisticated addressing. It means that if we want to make some algorithm we can use fewer CISC instructions in comparison to more RISC instructions. Of course, it comes with the price of a more sophisticated construction of CISC processor than RISC which influences the average execution time of a single instruction. As a result, the overall execution time can be similar, but in CISC more effort is done by the processor while in RISC more work is done by the compiler (or assembler programmer).
Additionally, there are differences in the general-purpose registers. In CISC the number of registers is smaller than in RISC. Additionally, they are specialised. It means that not all operations can be done with the use of any register. For example in some CISC processors arithmetic calculations can be done only with the use of a special register called accumulator, while addressing of table element or using a pointer can be done with the use of a special index (or base) register. In RISC almost all registers can be used for any purpose like the mentioned calculations or addressing. In CISC processors instructions have usually two arguments having the form of
operation arg1, arg2 ; Example: arg1 = arg1 + arg2
In such a situation arg1 is one of a source and also a destination - place for the result. It destroys the original arg1 value. In many RISC processors three argument instructions are present:
operation arg1, arg2, arg3 ; Example: arg3 = arg1 + arg2
In such an approach two arguments are the source and the third one is the destination - original arguments are preserved and can be used for further calculations. The table 1 summarises the difference between CISC and RISC processors.
Feature | CISC | RISC |
---|---|---|
Instructions | Complex | Simple |
Registers | Specialised | Universal |
Number of registers | Smaller | Larger |
Calculations | With accumulator | With any register |
Addressing modes | Complex | Simple |
Non destroying instructions | No | Yes |
Examples of processors | 8086, 8051 | AVR, ARM |