Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE) PDF Download

Computer Organization

The basic computer has 16-bit instruction register (IR) which can denote either memory reference or register reference or input-output instruction.
1. Memory Reference: These instructions refer to memory address as an operand. The other operand is always accumulator. Specifies 12-bit address, 3-bit opcode (other than 111) and 1-bit addressing mode for direct and indirect addressing.

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Example: IR register contains = 0001XXXXXXXXXXXX, i.e. ADD after fetching and decoding of instruction we find out that it is a memory reference instruction for ADD operation.
Hence, DR ← M[AR]
AC ← AC + DR, SC ← 0

2. Register Reference: These instructions perform operations on registers rather than memory addresses. The IR(14 – 12) is 111 (differentiates it from memory reference) and IR(15) is 0 (differentiates it from input/output instructions). The rest 12 bits specify register operation.
Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Example: IR register contains = 0111001000000000, i.e. CMA after fetch and decode cycle we find out that it is a register reference instruction for complement accumulator.
Hence, AC ← ~AC

3. Input/Output: These instructions are for communication between computer and outside environment. The IR(14 – 12) is 111 (differentiates it from memory reference) and IR(15) is 1 (differentiates it from register reference instructions). The rest 12 bits specify I/O operation.
Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Example: IR register contains = 1111100000000000, i.e. INP after fetch and decode cycle we find out that it is an input/output instruction for inputing character. Hence, INPUT character from peripheral device.

The set of instructions incorporated in16 bit IR register are:

  • Arithmetic, logical and shift instructions (and, add, complement, circulate left, right, etc)
  • To move information to and from memory (store the accumulator, load the accumulator)
  • Program control instructions with status conditions (branch, skip)
  • Input output instructions (input character, output character)Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Instruction Formats (Zero, One, Two and Three Address Instruction)

Computer perform task on the basis of instruction provided. An instruction in computer comprises of groups called fields. These field contains different information as for computers every thing is in 0 and 1 so each field has different significance on the basis of which a CPU decide what to perform. The most common fields are:

  • Operation field which specifies the operation to be performed like addition.
  • Address field which contain the location of operand, i.e., register or memory location.
  • Mode field which specifies how operand is to be founded.

An instruction is of various length depending upon the number of addresses it contain. Generally CPU organization are of three types on the basis of number of address fields:

  1. Single Accumulator organization
  2. General register organization
  3. Stack organization

In first organization operation is done involving a special register called accumulator. In second on multiple registers are used for the computation purpose. In third organization the work on stack basis operation due to which it does not contain any address field. It is not necessary that only a single organization is applied a blend of various organization is mostly what we see generally.
On the basis of number of address, instruction are classified as:
Note that we will use X = (A+B)*(C+D) expression to showcase the procedure.
1. Zero Address Instructions:

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)A stack based computer do not use address field in instruction. To evaluate a expression first it is converted to revere Polish Notation i.e. Post fix Notation.
Expression: X = (A+B)*(C+D)
Postfixed : X = AB+CD+*
TOP means top of stack
M[X] is any memory location

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

2. One Address Instructions:
This use a implied ACCUMULATOR register for data manipulation. One operand is in accumulator and other is in register or memory location. Implied means that the CPU already know that one operand is in accumulator so there is no need to specify it.
Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Expression: X = (A+B)*(C+D)
AC is accumulator
M[ ] is any memory location
M[T] is temporary location

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

3. Two Address Instructions:

This is common in commercial computers. Here two address can be specified in the instruction. Unlike earlier in one address instruction the result was stored in accumulator here result cab be stored at different location rather than just accumulator, but require more number of bit to represent address.
Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Here destination address can also contain operand.
Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[ ] is any memory location

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

4. Three Address Instructions:

This has three address field to specify a register or a memory location. Program created are much short in size but number of bits per instruction increase. These instructions make creation of program much easier but it does not mean that program will run much faster because now instruction only contain more information but each micro operation (changing content of register, loading address in address bus etc.) will be performed in one cycle only.

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[ ] is any memory location
Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

The document Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Computer Architecture & Organisation (CAO).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
20 videos|86 docs|48 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Basic Computer Instructions - Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

1. What are the different types of instruction formats in computer organization?
Ans. In computer organization, there are four main types of instruction formats: zero address, one address, two address, and three address. Zero address instructions do not specify any operands and operate on operands implicitly. One address instructions have one operand and typically specify the operand implicitly or use a register as an operand. Two address instructions have two operands, and the result is stored in one of the operands. Three address instructions have three operands, where two operands are used for the computation, and the result is stored in the third operand.
2. How do zero address instructions work in computer organization?
Ans. Zero address instructions in computer organization do not explicitly specify any operands. Instead, they operate on operands implicitly, usually by using a stack-based architecture. These instructions include operations like push and pop, where the operands are implicitly accessed from the top of the stack. Zero address instructions are commonly used in stack-based machines to simplify instruction formats and reduce the number of bits required for instruction encoding.
3. What is the advantage of using three address instructions in computer organization?
Ans. Three address instructions offer the advantage of flexibility and expressiveness in computer organization. With three operands, these instructions allow more complex computations and operations to be performed. The result of the computation is stored in the third operand, which provides greater flexibility in handling data dependencies and reduces the need for temporary storage. Three address instructions are commonly used in modern computer architectures to support a wide range of operations efficiently.
4. How are one address instructions executed in computer organization?
Ans. One address instructions in computer organization typically have one operand and operate on it using the specified instruction. The operand can be specified implicitly or explicitly. In the case of implicit addressing, the instruction uses a register or a predefined memory location as the operand. In explicit addressing, the operand is specified directly in the instruction. The execution of one address instructions involves fetching the operand, performing the operation, and storing the result back in the operand or another designated location.
5. What is the role of instruction formats in computer organization?
Ans. Instruction formats play a crucial role in computer organization as they define the structure and encoding of instructions. They determine the number and types of operands, the operation to be performed, and the location of operands and results. Instruction formats are essential for the proper execution of instructions by the processor. They allow the processor to fetch the instructions correctly, decode them, identify the operands, and execute the specified operation. The selection of appropriate instruction formats is vital for efficient instruction execution and overall system performance.
20 videos|86 docs|48 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

video lectures

,

ppt

,

Semester Notes

,

Viva Questions

,

past year papers

,

Extra Questions

,

study material

,

Exam

,

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

Sample Paper

,

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

MCQs

,

mock tests for examination

,

Free

,

shortcuts and tricks

,

Basic Computer Instructions | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

Summary

,

Important questions

,

Objective type Questions

,

pdf

,

Previous Year Questions with Solutions

,

practice quizzes

;