Computer Architecture : Machine Instructions

In Computer science, A or Machine instruction or Computer instruction is a segment of code that contains steps that need to be executed by the computer processor. An instruction is a single operation of a processor defined by the processor instruction set. At lowest level, each instruction is a sequence of binary bits, 0s and 1s that describes a physical operation the computer is to perform, and depending on the particular instruction type, the specification of special storage areas called registers that may contain data to be used in carrying out the instruction, or the location in computer memory of data. Machine instructions are the basic components of a machine language program. Each instruction must contain the information required by the CPU for execution. The elements of an instruction are as follows:

  • Operation Code
  • Source operand 
  • Result operand 
  • Next instruction 

1. Operation Code :

In computing, an operation code or opcode is the portion of a Machine instruction that specifies the operation to be performed such as add, subtract, multiply, shift and compliment. The operation code is specified by a group of binary bits that defines various operations. The number of bits required for the operation code depends upon the total number of operations available on the computer. The operation code must consist of at least n bits for a given 2n operations. For example suppose we are having 64 (26) operation then the length of Opcode will be 6. The operation must be performed on the data stored in registers. An instruction code therefore specifies not only operations to be performed but also the registers where the operands(data) will be found as well as the registers where the result has to be stored. 

2. Source operand :

The operands that are inputs for the operation, is known as Source operand. The source operands contains the data or address of the data. Generally, the source operands data remains unaltered after the operation.

3. Result operand :

The operation that may produce a result, is known as Result operand. The source operand is generally the destination, which contains data in a register or memory location.

4. Next Instruction :

It tells the CPU where to fetch the next instruction when the execution of current instruction is complete. The next instruction to be fetched is searched in main memory. Generally, the next instruction to be fetched is present immediately after the current instruction. In such cases, there is no explicit reference to the next instruction. When an explicit reference is required, then the main memory address must be supplied.

Next Topic :

No comments:

Post a Comment