RISC is an abbreviation of Reduced Instruction Set Computer. RISC processor has ‘instruction sets’ that are simple and have simple ‘addressing modes’. A RISC style instruction engages “one word” in memory. Execution of the RISC instructions are faster and take one clock cycle per instruction.
Although the forerunners of RISC computers were seen in 1960. But, due to the popularity of CISC microprocessors which were implemented by the manufacturers in calculators, video games, stereos, etc; RISC architecture was overshadowed. According to modern concept dates RISC computers were particularly introduced in the 1980s.
In this section, we will discuss the architecture, instruction set, pipelining, advantages and disadvantage of the RISC processors.
Content: RISC Processor
- RISC Architecture
- RISC Instruction Sets
- Pipelining in RISC
- Advantages and Disadvantages
- Key Takeaways
RISC Processor Architecture (Block diagram)
RISC processor is implemented using the hardwired control unit. The hardwired control unit produces control signals which regulate the working of processors hardware. RISC architecture emphasizes on using the registers rather than memory.
This is because the registers are the ‘fastest’ available memory source. The registers are physically small and are placed on the same chip where the ALU and the control unit are placed on the processor. The RISC instructions operate on the operands present in processor’s registers.
Below we have the block diagram for the RISC architecture.
Observe one thing here, we don’t have the “microprogram control store” or the “control memory” like we have seen in the CISC architecture in our previous content.
It is just because all instructions in RISC are simple and execute one instruction per cycle. So, here the instructions are hardwired and there is no need for control store. For each operation, we will have as defined hardwire. Making an instruction hardwired is making a function or operation in instruction permanent using connected circuits.
RISC Instruction Sets
RISC instructions are simple and are of fixed size. Each RISC instruction engages a single memory word. RISC instructions operate on processor registers only. The instructions that have arithmetic and logic operation should have their operand either in the processor register or should be given directly in the instruction.
Like in both the instructions below we have the operands in registers
Add R2, R3
Add R2, R3, R4
The operand can be mentioned directly in the instruction as below:
Add R2, 100
But initially, at the start of execution of the program, all the operands are in memory. So, to access the memory operands, the RISC instruction set has Load and Store instruction.
The Load instruction loads the operand present in memory to the processor register. The load instruction is of the form:
Load destination, Source
Example Load R2, A // memory to register
The load instruction above will load the operand present at memory location A to the processor register R2.
The Store instruction stores the operand back to the memory. Generally, the Store instruction is used to store the intermediate result or the final result in the memory. It is of the form:
Store source, destination
Example Store R2, A // register to memory
The Store instruction above will store the content in register R2 into the A a memory location.
You can observe that in the example of Load and Store instruction operand side of both instructions appears the same as R2, A. But, the source and destination order of Store instruction is reversed in Load instruction.
RISC instruction has simple addressing modes. Below we have a list of RISC instruction type addressing modes. Let us discuss them one by one.
Immediate addressing mode: This addressing mode explicitly specifies the operand in the instruction. Like
Add R4, R2, #200
The above instruction will add 200 to the content of R2 and store the result in R4.
Register addressing mode: This addressing mode describes the registers holding the operands.
Add R3, R3, R4
The above instruction will add the content of register R4 to the content of register R3 and store the result in R3.
Absolute addressing mode: This addressing mode describes a name for a memory location in the instruction. It is used to declare global variables in the program.
Integer A, B, SUM;
This instruction will allocate memory to variable A, B, SUM.
Register Indirect addressing mode: This addressing mode describes the register which has the address of the actual operand in the instruction. It is similar to pointers in HLL.
Load R2, (R3)
This instruction will load the register R2 with the content, whose address is mentioned in register R3.
Index addressing mode: This addressing mode provides a register in the instruction, to which when we add a constant, obtain the address of the actual operand. It is similar to the array of HLL.
Load R2, 4(R3)
Pipelining in RISC
As we know the RISC instructions are simple and engage one word in the memory. Even the ‘location of operands’ within the’ word’ is the same for the different instructions. Among all the instruction the Load and Store are the operations that accesses memory operand.
Most of the RISC instructions are register to register. If we consider the arithmetic and logic instructions, then we have two stages as follow:
Instruction Fetch (IF): Fetching the instruction
Instruction Execute (IE): ALU operation with the register
If we are considering the Load and Store instruction i.e. register to memory or memory to register, then three stages are required as follow.
Instruction Fetch (IF): Fetching the instruction
Instruction Execute (IE): Calculate memory address
Memory Store (M): register to register operation or memory to memory operation
Now consider the following instruction:
A <- B + C
Creating a RISC instruction set for the above instruction will be.
Load R1, B
Load R2, C
Add R3, R2, R1
Store R3, C
Now in the figure below, we can see how the above RISC instructions are pipelined. The pipelined instructions fasten the execution twice when compared to execution in sequence. The instruction execution stage of first instruction & instruction fetch stage of second instruction is performed parallelly.
Observing the figure we can see that the execute/memory stage of second instruction has to stall till the first instruction memory stage completes. This is the case when we use the single port memory i.e. only one memory access can be done at a time.
The above stalling condition reduces the execution speed. To overcome this, we can use NOOP (No Operation) instruction which can be inserted in the instruction stream by the compiler or assembler.
This would speed up the execution as all the stages are of equal duration. But, what if the execution stage is longer, as it ALU operation. In this case, the IE stage is divided in two parts IE1 register reading and IE2 ALU operation.
Advantages and Disadvantages of RISC Processor
Advantages of RISC Processor
- RISC instructions are simpler machine instruction.
- RISC instructions are hardwired to fasten the execution.
- There are very fewer instructions in s RISC instruction set.
- RISC instruction has simple addressing modes.
- RISC instruction executes faster because most of instruction operates on processor register and there is no need to access memory for each instruction.
- It is easy to pipeline RISC instruction as all instruction is of fixed size and opcode and operand are located in the same position in the word.
- RISC instructions execute one instruction per clock cycle.
Disadvantages of RISC Processor
- RISC instruction size is reduced but more instructions are required to perform an operation when compared with CISC. So, we can say that the length of the program is increased.
- The machine instructions are hardwired in RISC so, it would cost if any instruction needs modification.
- It finds is difficulty in processing complex instruction and complex addressing mode.
- RISC instructions do not allow direct memory to memory transfer, it requires Load and Store instructions to do so.
Examples of RISC processors
- RISC instructions are simple and engages one word in memory.
- RISC instructions are of fixed size, the opcode and the operands in the instruction are located in the same position within a word in different instructions.
- One instruction in RISC architecture executes in one clock cycle.
- The instruction size is reduced but, it has increased the program length.
- The pipelining of RISC instruction is easier.
- The machine instructions in RISC architecture are hardwired.
- RISC instruction operates only on register operands.
- RISC instruction executes faster as registers are placed in the processor chip which is faster available memory resource.
- RISC instruction performs memory to memory transfer via Load and Store instruction.
This is all about the RISC processor and its instruction set architecture. RISC architecture is now used worldwide in cellular telephones, computer tables and even supercomputers.