Basic Computer Instructions in Computer Organization


In computer organization, a computer instruction is a set of commands that tells the computer hardware to perform a specific operation. Therefore, computer instructions are the primary building blocks of a computer program and hence a software, because computer instructions are entirely responsible for execution of the program or software. In this article, we will learn the basic computer instructions in computer organization.

The format in which the computer instructions are to be written is defined by the instruction set architecture (ISA) of the computer. The instruction set architecture defines the set of instructions that are supported by the processor of the computer. It also provides the information about the instruction’s syntax, semantics, and encoding.

In a computer, computer instructions are able to perform a variety of operations like data transfer, arithmetic operations, logical operations, control flow, I/O operations, etc. Each computer instruction is specified by an opcode (binary code) that the hardware of the computer can understand.

When a computer program executes, the CPU of the computer fetches the computer instructions from the memory, and processes and decode it to identify the function to be performed.

Overall, computer instruction in computer organization are very important components, as they are responsible for allowing the computer to perform operations. Hence, in computers, instructions are entirely responsible for executing functions like data processing, data manipulation, control flow, hardware-software communication, etc.

Types of Basic Computer Instructions

Based on the functionality, the basic computer instructions can be classified into the following three major types:

  • Memory Reference Instructions

  • Register Reference Instructions

  • Input/Output Instructions

Let us now discuss each type of these basic computer instructions in detail.

Memory Reference Instructions

In computer organization, the memory reference instructions are used for manipulation of data stored in the computer memory. Memory reference instructions enable the computer’s CPU to access and process the data stored in a specific memory address.

Therefore, memory reference instructions provide a mean for writing data to memory or reading data from memory. These instructions allow the processor to communicate with the computer’s memory system.

The format of memory reference instruction consists of three parts namely, opcode (operation code), operands, and addressing mode. Where, opcode represents the operation to be performed, while the operand represents the memory address where the data is stored.

A memory reference instruction typically uses 12 bits to specify a memory address, 3 bits to specify the opcode, and 1 bit to identify the addressing mode.

The memory reference instructions are further classified into the following two types −

  • Store Instruction − The store instruction is used to write data into the memory.

  • Load Instruction − This instruction is used to retrieve data stored in the memory.

The execution process of memory reference instruction is explained here.

Firstly, the computer’s CPU uses the program counter to fetch the instruction from the memory. Then, this instruction is decoded to determine the opcode and operands. If the opcode is for load instruction, the CPU accesses the memory location of the provided memory address to retrieve the stored data. If the opcode is for store instruction, the CPU writes the data into the provided memory address.

Once the execution of the current memory reference instruction is completed, the CPU updates the program counter to execute the next memory reference instruction.

Hence, memory reference instructions are very important for many computing tasks like data processing, file handling, database operations, etc., as these computer instructions allow for accessing and manipulation data stored in the computer memory.

Register Reference Instructions

Register reference instruction is a computer instruction that operates on the data stored in the registers instead of memory addresses. Hence, the register reference instructions are primarily used for manipulation of data stored in the registers of the processors of a computer.

Similar to memory reference instructions, register reference instructions can also perform operation like data manipulation, arithmetic operations, logical operations, etc. on the data stored in registers. In comparison to memory reference instructions, the register reference instructions are faster in execution.

Register reference instruction consists of two parts namely, opcode, and register operation. The opcode (operational code) represents the operation to be performed.

In computer organization, the register reference instructions are determined by their opcode 111 with a 0 at the left most of the instruction. In the case of register reference instructions, there is no need of an operand from memory because it uses additional 12 bits to identify the operation to be implemented.

Input-Output Instructions

Those computer instructions that provide a mean for communication between a computer system and its I/O peripherals are called input-output instructions.

Therefore, the input-output instructions enable the data transfer from and to input and output devices like keyboard, memory disks, monitor, etc. With the help of input-output instructions, the computer system receives data input from users and sends output to users. Hence, input-output instructions act as the communication interface between CPU and peripheral devices of the computer system.

Similar to register reference instructions, the input-output instructions also do not require a memory reference. It is identified by the opcode 111 with a 1 at the leftmost of the instruction. The rest 12-bits are used to represent the type of input/output operation to be performed.

Issues Associated with Basic Computer Instructions

From the above discussion, it is clear that the basic computer instructions are very important in computer programming. However, there are several issues associated with the basic computer instructions, some of them are described below:

Limited Instruction Set and Functionality

Basic computer instructions have a limitation in terms of instruction set and functionality. When the number of instructions available in the instruction set are limited, then they impose constraints on the programmer and impact their efficiency. Sometimes, the basic computer instructions are not able to perform complex operations, hence the programmers have to add addition code to done the job.

Complexity

Basic computer instructions are typically specified in low level programming languages. Therefore, they require a deep understanding of the computer hardware and its architecture that becomes a challenge for novice programmers. Hence, it requires more efforts to writer efficient codes.

Compatibility and Legacy Support

The evolution of computer architecture, new instruction sets are developed and introduced. This leads the compatibility issues with the older instruction sets. The backward compatibility issues and legacy support for older versions of instructions impose constraints on software development, system design, system performance optimization, etc. Hence, the compatibility issues force programmers to write separate code for each computer system which can be an inefficient process in terms of cost and time.

Security Issues

Basic computer instructions are less secure to malicious programs and security attacks. Malicious programs can break security layers of basic computer instructions to gain unauthorized access. Therefore, programmers have to write more secure codes to protect the computer system.

Portability Issues

Basic computer instructions are typically specific to a particular computer’s instruction set architecture. Therefore, an instruction written for a system cannot be directly transferred to another computer system with a different architecture. This becomes a challenge when a software is to be developed for multiple platforms. To overcome this issue, programmers require addition efforts to rewrite the code for different ISAs.

Applications of Basic Computer Instructions

The major applications of basic computer instructions are listed below:

  • Basic computer instructions are essentially used in execution of computer programs and software applications.

  • Basic computer instructions are essentially used in execution of computer programs and software applications.

  • Basic computer instructions are used for creating a communication interface between the computer system and its external devices.

  • Basic computer instructions are also used for carrying out system maintenance tasks like error detection and correction, memory allocation and deallocation, etc.

  • Basic computer instructions are also used in controlling the flow of instructions within the system.

Conclusion

Basic computer instructions are a collection of commands required for performing different types of operations in the system. Basic computer instructions are the primary building blocks of a computer program as they are responsible for execution of software applications and to perform various operations in the computer system.

Updated on: 24-Jul-2023

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements