Top most organizations in instruction format (Computer Architecture)

 

Instruction Formats

 Definition: An instruction code is a group of bits and the computer usually have the variety of instruction code formats.

 The function of the control unit within the CPU to interpret each instruction code and to provide necessary control functions required for the processing of the instructions.

 The bit forming the instruction code divide into groups called fields.

 

 Most common fields are as follows

  •  Operation code
  •  Address field
  •  Mode field

 

 Operation code: It specifies the operation to be performed such as add, subtract etc.

 Address field: It specifies the memory address or a processor register.

 Mode field: It specifies the way to determine the operand.

 

 Note: Instruction format is the way by which the instructions are processed in the computer system. It gives the step-by-step process for the processing and for arranging the instructions according to its field and its group.

 

 In instruction format, the operation specified by the operation code is performed on the data store either in memory or some processor register.

 The number of addressing field in instruction format is dependent on internal organization of the register in a computer.

 

 Most common fall into one of the following CPU organizations.

  •  Single accumulator organizations
  •  General registers organizations
  •  Stack organizations

 

 

 single accumulator organizations: An instruction for this type of computers are use one address field. In this type of organization, all operations are performed in the accumulator.

 For example: ADD:AC = AC + M[X]

 Where AC is accumulator and M[X] is address of memory location containing operand.

 

 General register organizations: An instruction format for this type of computer use three address fields.

 For example: ADD R1, R2, R3: R1 = R2+R3

 If we want to reduce the address field then we are able to use two fields, if the destination is assumed to be one of the source registers.

 For example: ADD R1, R2: R1=  R1+R2,

 Where R1 act as source and destination register.

 

 Stack organizations: An instruction format for this type of computer use no address fields, it consists of an operation code that is stack instruction format use zero address instruction format, because the operation perform on the top two elements of the stack.

 For example: ADD, PUSH X etc.

 

 Let’s take an example to understand all the organizations

 X = (A+B) *(C+D)

 Three address instruction

 ADD R1, A, B: R1 = M[A]+M[B]

 ADD R2, C, D: R2 = M[C]+M[D]

 multiply X, R1, R2: X =  R1 *R2

 

 Two address instruction

 move R1, A: R1= M[A]

 ADD R1, B: R1 = R1+M[B]

 move R2, C: R2 = M[C]

 ADD R2, D: R2 = R2+M[D]

 multiply R1 *R2: R2 = R1 *R2

 move X, R2: X = R2

 

 One address instruction

 LOAD A: AC =  M[A]

 ADD B: AC = AC + M[B]

 STORE T: M[T] =  AC

 LOAD C: AC = M[C]

 ADD D: AC = M[D] + AC

 multiply T:AC = M[T] *AC

 STORE X: M[X] = AC

 

 Zero address instruction

 PUSH A: TOS = A

 PUSH B: TOS = B

 ADD: TOS = M[A]+M[B]

 PUSH C: TOS = C

 PUSH D: TOS = D

 ADD: TOS = M[C]+M[D]

 multiply: TOS = (A+B) *(C+D)

 POP X: M[X] = TOS

 

 According to this example we solve a normal equation using three, two, one and zero address instruction, whereas three and two address instruction are come in general register organization, one address instruction is come in single accumulator organization and zero address instruction is come in stack organization.

 These are the full explanation of the instruction format, by which the instructions or data  in computer system is processed and distributed according to their organization and processed according to their address instruction.

 

 

Enjoyed this article? Stay informed by joining our newsletter!

Comments

You must be logged in to post a comment.

About Author