Archive

Posts Tagged ‘cpu’

Classification of Instructions Based on CPU Organisations

September 10, 2011 Leave a comment

Classification of Instructions Based on CPU Organisations

Computers may have instructions of several different lengths containing varying number of  addresses. The number of address fields in the instruction format of a computer depends on the internal organization of its registers. Most computers fall into one of the three types of CPU organizations:

(i) Single Accumulator Organization: In this type of organization all operations are performed on an implied accumulator. The instruction format uses only one address field. For example, the instruction that loads the accumulator with the contents of a memory location.

LoadX

Where X is the address of the source operand. This results in the operation AC ÷— M (X). AC is the accumulator and M(X) symbolizes the memory word located at address X.

(ii) General Register Organisation : In this organization, the instruction format needs 2 or 3 register address fields according to the operation.

For example, an instruction for addition may be written as

ADD R1, R2, R3,

It denotes the operation R1 <—R2 -f- R3

The same ADD instruction needs only two register address fields if the destination register is one of the source registers, i.e. if the operation is

R1 R1 + R2

Then the instruction is ADD R1, R2

The instruction may also contain one memory address field and one register address field. For example, the instruction,

ADD R1, X

Specifies the operation R1 —R1 + M [X]

(iii) Stack Organization : In this organization, the computers will have PUSH and POP instructions which require an address field. For Kathplê, the instruction PUSH X will push the word at address Xonto the top of the stack. The operation — type instructions do not need any address field. For example, the instruction

ADD

Consists of only opcode and no address field. It has the effect of popping the top two numbers from the stack, adding them, and pushing the sum onto the stack. Thus all the operands are implied to be in the stack.

Most of the computers fall into one of the above three types of organizations. Some computers combine features from more than one organizational structure.

INTRODUCTION OF ELEMENTS OF AN INSTRUCTION

September 10, 2011 Leave a comment

INTRODUCTION

Instructions are  the means by which the CPU performs all its functions. These instructions are called as computer instructions or machine instructions. The CPU may perform a variety of functions, and these are reflected in the variety of instructions defined for the CPU. The set ofdifferent instructions that the CPU an execute is called as CPU’s instruction set.

ELEMENTS OF AN INSTRUCTION

In every instruction, it is needed to specify all the information required by the CPU to execute it. Hence regardless of the kind of the machine, or CPU organization, or instruction nature, each instruction must contain the following elements. They might be specified implicitly or explicitly. The elements are

  1. Operation Code
  2. Source operand reference
  3. Result operand reference
  4. Next instruction reference