instruction code

14
Instruction Codes Type of Instruction Codes Overview Unit 3 - Instruction Codes Abhineet Anand Computer Science and Engg. Department University of Petroleum and Energy Studies, Dehradun November 26, 2012 Abhineet Anand Unit 3 - Instruction Codes

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Instruction code

Instruction CodesType of Instruction Codes

Overview

Unit 3 - Instruction Codes

Abhineet Anand

Computer Science and Engg. DepartmentUniversity of Petroleum and Energy Studies, Dehradun

November 26, 2012

Abhineet Anand Unit 3 - Instruction Codes

Page 2: Instruction code

Instruction CodesType of Instruction Codes

Overview

IntroductionOperation CodeOperands

Instruction Codes

A Computer instruction is binary code that specifies asequence of micro operation for the Computer.The Computer reads each instruction from memory andplaces it in a control register.The control then interprets the binary code of theinstruction and proceeds to execute it by issuing asequence of micro operations.

Abhineet Anand Unit 3 - Instruction Codes

Page 3: Instruction code

Instruction CodesType of Instruction Codes

Overview

IntroductionOperation CodeOperands

Instruction Codes

An instruction code is a group of bits that instruct thecomputer to perform a specific task.It is usually divided into parts, each having its ownparticular interpretation.They are:

Operation Code, andOperands.

The most basic part of an instruction code is its operationpart.

Abhineet Anand Unit 3 - Instruction Codes

Page 4: Instruction code

Instruction CodesType of Instruction Codes

Overview

IntroductionOperation CodeOperands

Operation Code

The Operation Code (OpCode) of an instruction is a groupof bits that define each operation such add, subtract,multiply, shift, and complement.It must consist of at least n bits for a given 2n distinctoperations.Suppose we are having 64 (26) operation then the lengthof OpCode will be 6.The control unit decode the OpCode and do the requiredoperation.

Abhineet Anand Unit 3 - Instruction Codes

Page 5: Instruction code

Instruction CodesType of Instruction Codes

Overview

IntroductionOperation CodeOperands

Operands

The Operation must be performed on some data stored inprocessor register or in memory.Every Computer has its own particular instruction codeformat.The Simplest way to organize a computer is to have aninstruction code format with two parts.The first part specifies the operation to be performed andthe second specifies an address.

Abhineet Anand Unit 3 - Instruction Codes

Page 6: Instruction code

Instruction CodesType of Instruction Codes

Overview

Type of Instruction CodesMemory - Reference InstructionRegister - Reference InstructionInput - Output Instruction

Instruction Codes

The Basic Computer has three instruction code formats.The OpCode part of the instruction contains three bits andthe meaning of the remaining 13 bits depends on theoperation code encountered.The three instruction code formats are:

Memory - Reference InstructionRegister - reference InstructionInput - Output Operation

Abhineet Anand Unit 3 - Instruction Codes

Page 7: Instruction code

Instruction CodesType of Instruction Codes

Overview

Type of Instruction CodesMemory - Reference InstructionRegister - Reference InstructionInput - Output Instruction

Memory - Reference Instruction

A Memory-Reference instruction uses 12 bits to specify anaddress and one bit to specify the addressing mode I.I is equal to 0 for direct address and to 1 for indirectaddress.

Abhineet Anand Unit 3 - Instruction Codes

Page 8: Instruction code

Instruction CodesType of Instruction Codes

Overview

Type of Instruction CodesMemory - Reference InstructionRegister - Reference InstructionInput - Output Instruction

Register - Reference Instruction

The Register - Reference instruction are recognized by theoperation code 111 with 0 in the leftmost bit (bit 15) of theinstruction.It specifies an operation on or a test of the AC register.An operand from memory is not needed, so the other 12bits are used to specify the operation or test to beexecuted.

Abhineet Anand Unit 3 - Instruction Codes

Page 9: Instruction code

Instruction CodesType of Instruction Codes

Overview

Type of Instruction CodesMemory - Reference InstructionRegister - Reference InstructionInput - Output Instruction

Input - Output Instruction

An Input- Output Instruction does not need a reference tomemory and recognized by the operation code 111 with a1 in the left most bit of the instruction.The remaining 12 bits are used to specify the type ofinput-output operation or test performed.

Abhineet Anand Unit 3 - Instruction Codes

Page 10: Instruction code

Instruction CodesType of Instruction Codes

Overview

How to know type of instruction.Table of Instruction.

OverView

The type of instruction is recognized from four bits inposition 12 through 15 of the instruction.If the three opcode in position 12 to 14 are not equal to111, the instruction is a memory-reference type.If these bit position is equal to 111 and 15th position is 0,the instruction is a register-reference type otherwise it isInput- output type.

Abhineet Anand Unit 3 - Instruction Codes

Page 11: Instruction code

Instruction CodesType of Instruction Codes

Overview

How to know type of instruction.Table of Instruction.

Becuase of three bits use in the operation code, its seemsthat the computer is restricted to a maximum of eightdistinct operations.However, by using other 12 bits, the total number ofinstruction can exceed eight.In fact, the total number of instruction chosen for the basiccomputer is equal to 25.

Abhineet Anand Unit 3 - Instruction Codes

Page 12: Instruction code

Instruction CodesType of Instruction Codes

Overview

How to know type of instruction.Table of Instruction.

Table of Instruction.

The symbol designation is a three-letter word and representsan abbreviation intended for programmers and users.Memory Reference Instructions

Abhineet Anand Unit 3 - Instruction Codes

Page 13: Instruction code

Instruction CodesType of Instruction Codes

Overview

How to know type of instruction.Table of Instruction.

Table of Instruction

Register Reference Instructions

Abhineet Anand Unit 3 - Instruction Codes

Page 14: Instruction code

Instruction CodesType of Instruction Codes

Overview

How to know type of instruction.Table of Instruction.

THANK YOU

Abhineet Anand Unit 3 - Instruction Codes