What do you understand by the instruction set?
What is the step taken by the CPU to execute
Answer: Instruction Set | Steps of CPU to execute the Instructions
The computer system cannot do anything on its own. The user programs or instructs them. It defines the instruction as a machine language command to perform a specific task. It should be understandable by the computer system, hence it is a string of binary digits (0 and 1).
Example: It may be issued to read data from the memory write data into the memory, etc. Generally, instruction is used to perform a single task.
The set of instructions used to perform specific operations is called the instruction set.
Each instruction has two parts: opcode and operand.
1. Opcode: It specifies the operation to be performed by the instruction issued to the computer system such as ADD to perform addition, MOV to move data from one location to another.
2. Operand: It specifies the memory locations where the input and output data are kept.
They classify the instructions into three categories according to the number of bytes required for their execution.
1. one-byte instructions: The instructions that require only one byte for their execution.
2. Two‐byte instructions: The instructions that require one byte for their execution and one byte for their operand.
3. Three‐byte instructions: The instructions that require one byte for their execution and two bytes for their operands. These instructions are used to specify the 16-bit operand with the instruction.
According to the number of instructions required and their complexity, based on these instruction sets, the computer architecture is also categorized into two categories: CISC and RISC.
1. CISC: It stands for complex instruction set computer. It provides numerous instructions. These instructions include some complex instructions to perform complex tasks. It developed these to complete the complicated task in a flexible manner so that the compiler or other translator has to do very little work in translating the code written in some programming language into machine language. These instructions are memory‐based, and the computer requires a separate circuitry for these instructions. Therefore, more time is required for their execution and their design is complex.
Example: MULT, JA, JPO.
2. RISC: It stands for reduced instruction set computer. They base it on the concept that we can also perform a complex operations using simple instruction. For example, the multiplication can be performed by loading the contents in memory; multiplying and then storing them back into the memory. These are the three simpler steps to perform the multiplication, instead of performing it in a single step. Therefore, the RISC computer uses sets of simple instructions that may be completed into a single cycle. Also, it is faster and less expensive than CISC.
Example: ADD, COMPARE.
The processing of an instruction by the CPU comprises the following steps:
1. Fetching: The CPU fetches the instruction from the memory, and the next instruction replaced the program counter.
2. Decoding: The instruction is decoded by the CPU (CU and ALU) to determine the action to be performed.
3. Execute: it executes the instruction to perform a specific task.
4. Store: The result generated by the execution of an instruction is stored back into the memory.
The completion of all the steps for instruction is called an instruction cycle of the machine cycle.