GeeksforGeeks App
Open App
Browser
Continue

# Computer Organization | Basic Computer Instructions

Introduction :

Computer organization refers to the way in which the components of a computer system are organized and interconnected to perform specific tasks. One of the most fundamental aspects of computer organization is the set of basic computer instructions that the system can execute.

Basic computer instructions are the elementary operations that a computer system can perform. These instructions are typically divided into three categories: data movement instructions, arithmetic and logic instructions, and control instructions.

Data movement instructions are used to move data between different parts of the computer system. These instructions include load and store instructions, which move data between memory and the CPU, and input/output (I/O) instructions, which move data between the CPU and external devices.

Arithmetic and logic instructions are used to perform mathematical operations and logical operations on data stored in the system. These instructions include add, subtract, multiply, and divide instructions, as well as logic instructions such as AND, OR, and NOT.

Control instructions are used to control the flow of instructions within the computer system. These instructions include branch instructions, which transfer control to different parts of the program based on specified conditions, and jump instructions, which transfer control to a specified memory location.

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. 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```
1. 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. 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`
1. 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. 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.

Essential PC directions are the principal tasks that a PC can perform. These directions are executed by the focal handling unit (central processor) of a PC, and they structure the reason for additional perplexing tasks. A few instances of essential PC directions include:

1.Load: This guidance moves information from the memory to a computer processor register.

2.Store: This guidance moves information from a computer chip register to the memory.

3.Add: This guidance adds two qualities and stores the outcome in a register.

4.Subtract: This guidance deducts two qualities and stores the outcome in a register.

5.Multiply: This guidance duplicates two qualities and stores the outcome in a register.

6.Divide: This guidance isolates two qualities and stores the outcome in a register.

7.Branch: This guidance changes the program counter to a predefined address, which is utilized to execute restrictive and genuine leaps.

8.Jump: This guidance changes the program counter to a predefined address.

9.Compare: This guidance looks at two qualities and sets a banner demonstrating the consequence of the examination.

10.Increment: This guidance adds 1 to a worth in a register or memory area.

The set of instructions incorporated in16 bit IR register are:

1. Arithmetic, logical and shift instructions (and, add, complement, circulate left, right, etc)
2. To move information to and from memory (store the accumulator, load the accumulator)
3. Program control instructions with status conditions (branch, skip)
4. Input output instructions (input character, output character)

Uses of  Basic Computer Instructions :

Some of the key uses of basic computer instructions include:

1. Data manipulation: Basic computer instructions are used to manipulate data stored in the computer system, including moving data between memory and the CPU, performing mathematical operations, and performing logical operations.
2. Control flow: Basic computer instructions are used to control the flow of instructions within the computer system. This includes branching to different parts of the program based on specified conditions and jumping to a specific memory location.
3. Input/output operations: Basic computer instructions are used to transfer data between the computer system and external devices, such as input devices (e.g. keyboard, mouse) and output devices (e.g. display screen, printer).
4. Program execution: Basic computer instructions are used to execute computer programs and run software applications. These instructions are used to load programs into memory, move data into and out of the program, and control the execution of the program.
5. System maintenance: Basic computer instructions are used to perform system maintenance tasks, such as memory allocation and deallocation, interrupt handling, and error detection and correction.

Issues of  Basic Computer Instructions :

1. Complexity: Basic computer instructions can be complex and difficult to understand, particularly for novice programmers. This can make it challenging to write efficient and effective code.
2. Limited functionality: While basic computer instructions are versatile and can perform a wide range of tasks, they are still limited in their functionality. This can make it challenging to perform more complex operations and can require programmers to write additional code to accomplish their goals.
3. Compatibility: Basic computer instructions can be specific to a particular computer system or architecture, which can make it challenging to write code that is compatible with different systems. This can require programmers to write separate code for each system, which can be time-consuming and inefficient.
4. Security: Basic computer instructions can be vulnerable to security threats, such as buffer overflows and code injection attacks. This can make it challenging to write secure code and can require additional measures to be taken to protect the system.
5. Maintenance: Basic computer instructions can be difficult to maintain, particularly as systems become more complex and code becomes more extensive. This can require significant resources to maintain and update the code, which can be challenging for organizations with limited resources.

My Personal Notes arrow_drop_up