An instruction format defines the different component of an instruction. The main components of an instruction are opcode (which instruction to be executed) and operands (data on which instruction to be executed). Here are the different terms related to instruction format:
In this article, we will discuss different types of problems based on instruction format which are asked in GATE. For details about different types of instruction formats, you can refer: Instruction Formats
Type 1: Given instruction set size and operands size and their count, find the size of the instruction.
In this type of questions, you will be given the size of instruction set, number of operands and their size, you have to find out the size of the instruction.
Ques.1. Consider a processor with 64 registers and an instruction set of size twelve. Each instruction has five distinct fields, namely, opcode, two source register identifiers, one destination register identifier, and a twelve-bit immediate value. Each instruction must be stored in memory in a byte-aligned fashion. If a program has 100 instructions, the amount of memory (in bytes) consumed by the program text is ____________. (GATE 2016)
(a) 100
(b) 200
(c) 400
(d) 500
Solution: It can be approached as:
Type 2: Given instruction size, opcode size and size of some operands, find the size and maximum value of remaining operands.
In this type of questions, you will be given the size of instruction, size of opcode, number of operands and size of some operands, you have to find out the size or maximum value of remaining operands.
Ques.2. A processor has 40 distinct instructions and 24 general purpose registers. A 32-bit instruction word has an opcode, two registers operands and an immediate operand. The number of bits available for the immediate operand field is_______. (GATE CS 2016)
Solution: It can be approached as:
Ques.3. A machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which have an immediate operand in addition to two register operands. Assuming that the immediate operand is an unsigned integer, the maximum value of the immediate operand is ___________. (GATE CS 2014)
Solution: It can be approached as:
Type 3: Instruction format with different categories of instruction
In this type of questions, you will be given different categories of instructions. You have to find maximum possible instructions of a given type.
Ques.4. A processor has 16 integer registers (R0, R1, … , R15) and 64 floating point registers (F0, F1, … , F63). It uses a 2 byte instruction format. There are four categories of instructions: Type-1, Type-2, Type-3, and Type 4. Type-1 category consists of four instructions, each with 3 integer register operands (3Rs). Type-2 category consists of eight instructions, each with 2 floating point register operands (2Fs). Type-3 category consists of fourteen instructions, each with one integer register operand and one floating point register operand (1R+1F). Type-4 category consists of N instructions, each with a floating point register operand (1F).
The maximum value of N is ________. (GATE-CS-2018)
Solution: It can be approached as:
20 videos|86 docs|48 tests
|
1. What is an instruction format in computer science engineering? |
2. What are the different types of instruction formats? |
3. How does the instruction format affect the performance of a computer processor? |
4. Can the instruction format be modified or customized for specific applications? |
5. How does the instruction format relate to the architecture of a computer processor? |
20 videos|86 docs|48 tests
|
|
Explore Courses for Computer Science Engineering (CSE) exam
|