SlideShare a Scribd company logo
1 of 33
Instruction Code format, Instruction
Cycle and Instruction Format
Instruction code
ā€¢ 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.
Instruction code
ā€¢ 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.
Instruction code
ā€¢ 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.
Instruction code format
Addressing Modes
ā€¢ 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.
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.
Opcodes
ā€¢ 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.
Address
ā€¢ 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
Computer Instructions
ā€¢ Computer instructions are a set of machine
language instructions that a particular processor
understands and executes. A computer performs
tasks on the basis of the instruction provided.
ā€¢ An instruction comprises of groups called fields.
These fields include:
ā€¢ The Operation code (Opcode) field which specifies
the operation to be performed.
ā€¢ The Address field which contains the location of
the operand, i.e., register or memory location.
ā€¢ The Mode field which specifies how the operand
will be located.
ā€¢ A basic computer has three instruction code
formats which are:
ā€¢ Memory - reference instruction
ā€¢ Register - reference instruction
ā€¢ Input-Output instruction
Memory - reference instruction
ā€¢ In Memory-reference instruction, 12 bits of
memory is used to specify an address and one
bit to specify the addressing mode 'I'.
Register Reference Instruction
ā€¢ The Register-reference instructions are
represented by the Opcode 111 with a 0 in the
leftmost bit (bit 15) of the instruction.
ā€¢ A Register-reference instruction specifies an
operation on or a test of the AC (Accumulator)
register.
Input-Output instruction
ā€¢ Just like the Register-reference instruction, an Input-
Output instruction does not need a reference to
memory and is recognized by the operation code 111
with a 1 in the leftmost bit of the instruction. The
remaining 12 bits are used to specify the type of the
input-output operation or test performed.
Basic Computer Instructions
Instruction Cycle
ā€¢ A program residing in the memory unit of a computer
consists of a sequence of instructions. These instructions
are executed by the processor by going through a cycle for
each instruction.
ā€¢ In a basic computer, each instruction cycle consists of the
following phases:
ā€¢ Fetch instruction from memory.
ā€¢ Decode the instruction.
ā€¢ Read the effective address from memory.
ā€¢ Execute the instruction.
Instruction Cycle
Instruction Cycle
ā€¢ Fetch and Decode:- Initially, the program counter
PC is loaded with the address of the first
instruction in the program.
ā€¢ The sequence counter SC is cleared to 0,
providing a decoded timing signal T0.
ā€¢ After each clock pulse, SC is incremented by one,
so that the timing signals go through a sequence
T0, T1, T2, and so on.
ā€¢ The microoperations for the fetch and decode
phases can be specified by the following register
transfer statements.
Instruction Cycle
ā€¢ Since only AR is connected to the address inputs of memory, it
is necessary to transfer the address from PC to AR during the
clock transition associated with timing signal T0
ā€¢ The instruction read from memory is then placed in the
instruction register IR with the clock transition associated with
timing signal T1
ā€¢ At the same time, PC is incremented by one to prepare it for
the address of the next instruction in the program. At time T2,
the operation code in IR is decoded, the indirect bit is
transferred to flip-flop I, and the address part of the instruction
is transferred to AR .
ā€¢ Note that SC is incremented after each clock pulse to produce
the sequence To, T1, and T2
Instruction cycle flowchart
flowchart
ā€¢ Determine the Type of Instruction:-The timing signal that is active after
the decoding is T3
ā€¢ During time T3 the control unit determines the type of instruction that
was just read from memory.
ā€¢ Decoder output D7 is equal to 1 if the operation code is equal to binary
111.
ā€¢ If D7 = 1 and I = 1, then execute the input output instruction .
ā€¢ If D7 = 1 and I = 0, then execute the register reference instruction .
ā€¢ If D7= 0, the operation code must be one of the other seven values 000
through 110, specifying a memory-reference
ā€¢ instruction.
ā€¢ If D7 = 0 and I = 1, we have a memory reference instruction with an
indirect address access .
ā€¢ If D7 = 0 and I = 0, we have a memory reference instruction with an direct
address access.
Instruction Formats
ā€¢ Operations specified by computer instructions are
executed on some data stored in memory or processor
registers.
ā€¢ Operands residing in memory are specified by their
memory address.
ā€¢ Operands residing in processor registers are specified
with a register address.
ā€¢ Thus a CPU with 16 processor registers R0 through R15
will have a register address field of four bits.
ā€¢ The binary number 0101, for example, will designate
register RS.
Instruction Format
ā€¢ Computers may have instructions of several different
lengths containing varying number of addresses.
ā€¢ The number of address fields in the instruction format
of a computer depends on the internal organization of
its registers.
ā€¢ Most computers fall into one of three types of CPU
organizations:
ā€¢ 1. Single accumulator organization.
ā€¢ 2. General register organization.
ā€¢ 3. Stack organization.
Instruction Format
ā€¢ An example of an accumulator-type organization instruction.
A D D X where X is the address of the operand.
ā€¢ The ADD instruction in this case results in the operation AC <--
AC + M [X]. AC is the accumulator register and M [X]
symbolizes the memory word located at address X.
ā€¢ An example of a general register type of organization was
presented in An example of register organization instruction.
ā€¢ Thus the instruction for an arithmetic addition may be written
in an assembly language as ADD R 1 , R 2 , R 3 t o denote the
operation R 1 <--- R2 + R 3 .
ā€¢ The number o f address fields in the instruction can be
reduced from three to two if the destination register is the
same as one of the source registers.
Instruction Format
ā€¢ Thus the instruction A D D R 1 , R 2 would denote the
operation R 1 <--- R 1 + R2.
ā€¢ Only register addresses for R 1 and R2 need be specified in
this instruction. . The stack-organized instruction .
ā€¢ Computers with stack organization would have PUSH and
POP instructions which require an address field.
ā€¢ PUSH X will push the word at address X to the top of the
stack. The stack pointer is updated automatically.
ā€¢ Operation type instructions do not need an address field in
stack-organized computers. This is because the operation is
performed on the two items that are on top of the stack.
The instruction ADD .
Three-Address Instructions
ā€¢ Computers with three-address instruction formats can use each
address field to specify either a processor register or a memory
operand.
ā€¢ The program in assembly language that evaluates X = (A + B) *
(C + D) is shown below, together with comments that explain
the register transfer operation of each instruction.
ā€¢ It is assumed that the computer has two processor registers, R 1
and R2.
ā€¢ The symbol M [A ] denotes the operand at memory address
symbolized by A .
Three-Address Instructions
ā€¢ The advantage o f the three-address format i s
that i t results i n short programs when
evaluating arithmetic expressions.
ā€¢ The disadvantage is that the binary-coded
instructions require too many bits to specify
three addresses.
Two-Address Instructions
ā€¢ Two-address instructions are the most
common in commercial computers. Here again
each address field can specify either a
processor register or a memory word. The
program to evaluate X = (A + B) * (C + D) is as
follows
RISC Instructions
ā€¢ A reduced instruction set computer (RISC). The instruction
set of a typical RISC processor is restricted to the use of
load and store instructions when communicating between
memory and CPU.
ā€¢ All other instructions are executed within the registers of
the CPU without referring to memory.
ā€¢ A program for a RISC-type CPU consists of LOAD and STORE
instructions that have one memory and one register
address, and computational-type instructions that have
three addresses with all three specifying processor
registers.
ā€¢ The following is a program to evaluate X = (A + B) ā€¢ (C + D).
instruction format.pptx

More Related Content

Similar to instruction format.pptx

BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNBASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNAnonymous Red
Ā 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)DevaKumari Vijay
Ā 
Chapter 3 computer organization and artpdf
Chapter 3 computer organization and artpdfChapter 3 computer organization and artpdf
Chapter 3 computer organization and artpdfMohammed472103
Ā 
Basic computer organization and design
Basic computer organization and designBasic computer organization and design
Basic computer organization and designmahesh kumar prajapat
Ā 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5Umang Gupta
Ā 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNDr. Ajay Kumar Singh
Ā 
COA CHAPTER 5
COA CHAPTER 5COA CHAPTER 5
COA CHAPTER 5Mori77
Ā 
BasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss MenoBasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss MenoRNShukla7
Ā 
CO_Chapter2.ppt
CO_Chapter2.pptCO_Chapter2.ppt
CO_Chapter2.pptPranav726214
Ā 
material for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptxmaterial for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptxjainyshah20
Ā 
Ca basic computer organization
Ca basic computer organizationCa basic computer organization
Ca basic computer organizationProf. Dr. K. Adisesha
Ā 
Unit. 3 coa.ppt
Unit. 3 coa.pptUnit. 3 coa.ppt
Unit. 3 coa.pptAESHAMEHTA13
Ā 
Arithmetic & Logic Unit
Arithmetic & Logic UnitArithmetic & Logic Unit
Arithmetic & Logic Unitramya marichamy
Ā 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2parthivrathodlits
Ā 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registersmahesh kumar prajapat
Ā 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.CS_GDRCST
Ā 

Similar to instruction format.pptx (20)

BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNBASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
Ā 
Unit 1 computer architecture (1)
Unit 1   computer architecture (1)Unit 1   computer architecture (1)
Unit 1 computer architecture (1)
Ā 
Chapter 3 computer organization and artpdf
Chapter 3 computer organization and artpdfChapter 3 computer organization and artpdf
Chapter 3 computer organization and artpdf
Ā 
Basic computer organization and design
Basic computer organization and designBasic computer organization and design
Basic computer organization and design
Ā 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5
Ā 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC  COMPUTER  ORGANIZATION  AND  DESIGNBASIC  COMPUTER  ORGANIZATION  AND  DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
Ā 
COA CHAPTER 5
COA CHAPTER 5COA CHAPTER 5
COA CHAPTER 5
Ā 
BasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss MenoBasicComputerOrganization and Architecture by Moriss Meno
BasicComputerOrganization and Architecture by Moriss Meno
Ā 
CO_Chapter2.ppt
CO_Chapter2.pptCO_Chapter2.ppt
CO_Chapter2.ppt
Ā 
material for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptxmaterial for studentbasic computer organization and design .pptx
material for studentbasic computer organization and design .pptx
Ā 
Ca basic computer organization
Ca basic computer organizationCa basic computer organization
Ca basic computer organization
Ā 
Ch5 official.ppt
Ch5 official.pptCh5 official.ppt
Ch5 official.ppt
Ā 
Unit. 3 coa.ppt
Unit. 3 coa.pptUnit. 3 coa.ppt
Unit. 3 coa.ppt
Ā 
CSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptxCSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptx
Ā 
Arithmetic & Logic Unit
Arithmetic & Logic UnitArithmetic & Logic Unit
Arithmetic & Logic Unit
Ā 
Chp 2 and 3.pptx
Chp 2 and 3.pptxChp 2 and 3.pptx
Chp 2 and 3.pptx
Ā 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2
Ā 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
Ā 
Instruction codes
Instruction codesInstruction codes
Instruction codes
Ā 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
Ā 

More from AshokRachapalli1

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptxAshokRachapalli1
Ā 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...AshokRachapalli1
Ā 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptxAshokRachapalli1
Ā 
Addressing Modes.pptx
Addressing Modes.pptxAddressing Modes.pptx
Addressing Modes.pptxAshokRachapalli1
Ā 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxAshokRachapalli1
Ā 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.pptAshokRachapalli1
Ā 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxAshokRachapalli1
Ā 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptxAshokRachapalli1
Ā 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptxAshokRachapalli1
Ā 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxAshokRachapalli1
Ā 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptxAshokRachapalli1
Ā 

More from AshokRachapalli1 (20)

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
Ā 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...
Ā 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx
Ā 
Chapter5 (1).ppt
Chapter5 (1).pptChapter5 (1).ppt
Chapter5 (1).ppt
Ā 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
Ā 
Addressing Modes.pptx
Addressing Modes.pptxAddressing Modes.pptx
Addressing Modes.pptx
Ā 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptx
Ā 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
Ā 
lec16-memory.ppt
lec16-memory.pptlec16-memory.ppt
lec16-memory.ppt
Ā 
lecture-17.ppt
lecture-17.pptlecture-17.ppt
lecture-17.ppt
Ā 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptx
Ā 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptx
Ā 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptx
Ā 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptx
Ā 
Flow Control.pptx
Flow Control.pptxFlow Control.pptx
Flow Control.pptx
Ā 
Chapter4.ppt
Chapter4.pptChapter4.ppt
Chapter4.ppt
Ā 
intro22.ppt
intro22.pptintro22.ppt
intro22.ppt
Ā 
osi.ppt
osi.pptosi.ppt
osi.ppt
Ā 
switching.pptx
switching.pptxswitching.pptx
switching.pptx
Ā 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
Ā 

Recently uploaded

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
Ā 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
Ā 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
Ā 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
Ā 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
Ā 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
Ā 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
Ā 
Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”
Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”
Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”soniya singh
Ā 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
Ā 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
Ā 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
Ā 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
Ā 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
Ā 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
Ā 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
Ā 
Top Rated Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...Call Girls in Nagpur High Profile
Ā 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoĆ£o Esperancinha
Ā 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
Ā 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
Ā 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEslot gacor bisa pakai pulsa
Ā 

Recently uploaded (20)

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Ā 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
Ā 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Ā 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Ā 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
Ā 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Ā 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
Ā 
Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”
Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”
Model Call Girl in Narela Delhi reach out to us at šŸ”8264348440šŸ”
Ā 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
Ā 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
Ā 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
Ā 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
Ā 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
Ā 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Ā 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
Ā 
Top Rated Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth āŸŸ 6297143586 āŸŸ Call Me For Genuine Se...
Ā 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Ā 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
Ā 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
Ā 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
Ā 

instruction format.pptx

  • 1. Instruction Code format, Instruction Cycle and Instruction Format
  • 2. Instruction code ā€¢ 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.
  • 3. Instruction code ā€¢ 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.
  • 4. Instruction code ā€¢ 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.
  • 6. Addressing Modes ā€¢ 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.
  • 7. 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.
  • 8. Opcodes ā€¢ 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.
  • 9. Address ā€¢ 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.
  • 10. The figure shows a diagram showing direct and indirect addresses
  • 11. Computer Instructions ā€¢ Computer instructions are a set of machine language instructions that a particular processor understands and executes. A computer performs tasks on the basis of the instruction provided. ā€¢ An instruction comprises of groups called fields. These fields include: ā€¢ The Operation code (Opcode) field which specifies the operation to be performed. ā€¢ The Address field which contains the location of the operand, i.e., register or memory location. ā€¢ The Mode field which specifies how the operand will be located.
  • 12. ā€¢ A basic computer has three instruction code formats which are: ā€¢ Memory - reference instruction ā€¢ Register - reference instruction ā€¢ Input-Output instruction
  • 13. Memory - reference instruction ā€¢ In Memory-reference instruction, 12 bits of memory is used to specify an address and one bit to specify the addressing mode 'I'.
  • 14. Register Reference Instruction ā€¢ The Register-reference instructions are represented by the Opcode 111 with a 0 in the leftmost bit (bit 15) of the instruction. ā€¢ A Register-reference instruction specifies an operation on or a test of the AC (Accumulator) register.
  • 15. Input-Output instruction ā€¢ Just like the Register-reference instruction, an Input- Output instruction does not need a reference to memory and is recognized by the operation code 111 with a 1 in the leftmost bit of the instruction. The remaining 12 bits are used to specify the type of the input-output operation or test performed.
  • 17. Instruction Cycle ā€¢ A program residing in the memory unit of a computer consists of a sequence of instructions. These instructions are executed by the processor by going through a cycle for each instruction. ā€¢ In a basic computer, each instruction cycle consists of the following phases: ā€¢ Fetch instruction from memory. ā€¢ Decode the instruction. ā€¢ Read the effective address from memory. ā€¢ Execute the instruction.
  • 19. Instruction Cycle ā€¢ Fetch and Decode:- Initially, the program counter PC is loaded with the address of the first instruction in the program. ā€¢ The sequence counter SC is cleared to 0, providing a decoded timing signal T0. ā€¢ After each clock pulse, SC is incremented by one, so that the timing signals go through a sequence T0, T1, T2, and so on. ā€¢ The microoperations for the fetch and decode phases can be specified by the following register transfer statements.
  • 20. Instruction Cycle ā€¢ Since only AR is connected to the address inputs of memory, it is necessary to transfer the address from PC to AR during the clock transition associated with timing signal T0 ā€¢ The instruction read from memory is then placed in the instruction register IR with the clock transition associated with timing signal T1 ā€¢ At the same time, PC is incremented by one to prepare it for the address of the next instruction in the program. At time T2, the operation code in IR is decoded, the indirect bit is transferred to flip-flop I, and the address part of the instruction is transferred to AR . ā€¢ Note that SC is incremented after each clock pulse to produce the sequence To, T1, and T2
  • 22. flowchart ā€¢ Determine the Type of Instruction:-The timing signal that is active after the decoding is T3 ā€¢ During time T3 the control unit determines the type of instruction that was just read from memory. ā€¢ Decoder output D7 is equal to 1 if the operation code is equal to binary 111. ā€¢ If D7 = 1 and I = 1, then execute the input output instruction . ā€¢ If D7 = 1 and I = 0, then execute the register reference instruction . ā€¢ If D7= 0, the operation code must be one of the other seven values 000 through 110, specifying a memory-reference ā€¢ instruction. ā€¢ If D7 = 0 and I = 1, we have a memory reference instruction with an indirect address access . ā€¢ If D7 = 0 and I = 0, we have a memory reference instruction with an direct address access.
  • 23. Instruction Formats ā€¢ Operations specified by computer instructions are executed on some data stored in memory or processor registers. ā€¢ Operands residing in memory are specified by their memory address. ā€¢ Operands residing in processor registers are specified with a register address. ā€¢ Thus a CPU with 16 processor registers R0 through R15 will have a register address field of four bits. ā€¢ The binary number 0101, for example, will designate register RS.
  • 24. Instruction Format ā€¢ Computers may have instructions of several different lengths containing varying number of addresses. ā€¢ The number of address fields in the instruction format of a computer depends on the internal organization of its registers. ā€¢ Most computers fall into one of three types of CPU organizations: ā€¢ 1. Single accumulator organization. ā€¢ 2. General register organization. ā€¢ 3. Stack organization.
  • 25. Instruction Format ā€¢ An example of an accumulator-type organization instruction. A D D X where X is the address of the operand. ā€¢ The ADD instruction in this case results in the operation AC <-- AC + M [X]. AC is the accumulator register and M [X] symbolizes the memory word located at address X. ā€¢ An example of a general register type of organization was presented in An example of register organization instruction. ā€¢ Thus the instruction for an arithmetic addition may be written in an assembly language as ADD R 1 , R 2 , R 3 t o denote the operation R 1 <--- R2 + R 3 . ā€¢ The number o f address fields in the instruction can be reduced from three to two if the destination register is the same as one of the source registers.
  • 26. Instruction Format ā€¢ Thus the instruction A D D R 1 , R 2 would denote the operation R 1 <--- R 1 + R2. ā€¢ Only register addresses for R 1 and R2 need be specified in this instruction. . The stack-organized instruction . ā€¢ Computers with stack organization would have PUSH and POP instructions which require an address field. ā€¢ PUSH X will push the word at address X to the top of the stack. The stack pointer is updated automatically. ā€¢ Operation type instructions do not need an address field in stack-organized computers. This is because the operation is performed on the two items that are on top of the stack. The instruction ADD .
  • 27. Three-Address Instructions ā€¢ Computers with three-address instruction formats can use each address field to specify either a processor register or a memory operand. ā€¢ The program in assembly language that evaluates X = (A + B) * (C + D) is shown below, together with comments that explain the register transfer operation of each instruction. ā€¢ It is assumed that the computer has two processor registers, R 1 and R2. ā€¢ The symbol M [A ] denotes the operand at memory address symbolized by A .
  • 28. Three-Address Instructions ā€¢ The advantage o f the three-address format i s that i t results i n short programs when evaluating arithmetic expressions. ā€¢ The disadvantage is that the binary-coded instructions require too many bits to specify three addresses.
  • 29. Two-Address Instructions ā€¢ Two-address instructions are the most common in commercial computers. Here again each address field can specify either a processor register or a memory word. The program to evaluate X = (A + B) * (C + D) is as follows
  • 30.
  • 31.
  • 32. RISC Instructions ā€¢ A reduced instruction set computer (RISC). The instruction set of a typical RISC processor is restricted to the use of load and store instructions when communicating between memory and CPU. ā€¢ All other instructions are executed within the registers of the CPU without referring to memory. ā€¢ A program for a RISC-type CPU consists of LOAD and STORE instructions that have one memory and one register address, and computational-type instructions that have three addresses with all three specifying processor registers. ā€¢ The following is a program to evaluate X = (A + B) ā€¢ (C + D).