- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are Instruction Codes and Operands in Computer Architecture?
A computer instruction is a binary code that determines the micro-operations in a sequence for a computer. They are saved in the memory along with the information. Each computer has its specific group of instructions.
They can be categorized into two elements as Operation codes (Opcodes) and Address. Opcodes specify the operation for specific instructions. An address determines the registers or the areas that can be used for that operation. Operands are definite elements of computer instruction that show what information is to be operated on.
It consists of 12 bits of memory that are required to define the address as the memory includes 4096 words. The 15th bit of the instruction determines the addressing mode (where direct addressing corresponds to 0, indirect addressing corresponds to 1). Therefore, the instruction format includes 12 bits of address and 1 bit for the addressing mode, 3 bits are left for Opcodes.
The following block diagram shows the instruction format for a basic computer.
There are three parts of the Instruction Format which are as follows −
Instructions that define the address of a definite memory location are known as memory reference instructions. The method in which a target address or effective address is recognized within the instruction is known as addressing mode.
The address field for instruction can be represented in two different ways are as follows −
- Direct Addressing − It uses the address of the operand.
- Indirect Addressing − It facilitates the address as a pointer to the operand.
The address of the operand or the target address is called the effective address.
Effective Address (EA) − It defines the address that can be executed as a target address for a branch type instruction or the address that can be used directly to create an operand for a computation type instruction, without creating any changes.
An opcode is a collection of bits that represents the basic operations including add, subtract, multiply, complement, and shift. The total number of operations provided through the computer determines the number of bits needed for the opcode. The minimum bits accessible to the opcode should be n for 2n operations. These operations are implemented on information that is saved in processor registers or memory.
The address is represented as the location where a specific instruction is constructed in the memory. The address bits of an instruction code is used as an operand and not as an address. In such methods, the instruction has an immediate operand. If the second part has an address, the instruction is referred to have a direct address.
There is another possibility in the second part including the address of the operand. This is referred to as an indirect address. In the instruction code, one bit can signify if the direct or indirect address is executed.
The figure shows a diagram showing direct and indirect addresses.
- What are Instruction Cycles in computer architecture?
- What is Instruction Mapping in Computer Architecture?
- What is Instruction Pipeline in Computer Architecture?
- What is Instruction Cycle in Computer Architecture?
- What is data transfer instruction process in Computer Architecture?
- What are Computer Registers in Computer Architecture?
- What is the layout of Pipelined Instruction in computer architecture?
- Implementation of Global Instruction Scheduling in computer architecture
- What are Logic Micro-Operations in Computer Architecture?
- What are snoopy cache protocols in computer architecture?
- What is computer architecture?
- What are the types of Parallelism in Computer Architecture?
- What are the types of Instructions in Computer Architecture?
- What are the conditions of Parallelism in Computer Architecture?
- What are Vector-Access Memory Schemes in Computer Architecture?