SlideShare a Scribd company logo
1 of 23
Download to read offline
Unit 5 -INSTRUCTION, INTERRUPTS and IO
PROCESSING
Abhineet Anand
Computer Science and Engg. Department
University of Petroleum and Energy Studies, Dehradun

December 9, 2012

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

1 / 23
Outline
1

Instruction Codes
Introduction
Operation Code
Operands

2

Instruction Formats
Single accumulator organization
General register organization
Stack organization
Evaluation of Arithmetic Statement

3

Addressing Modes
Type of Addressing Modes

4

Program Interrupt
Types of Interrupts

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

2 / 23
Instruction Codes

A Computer instruction is binary code that speciļ¬es a sequence of
micro operation for the Computer.
The Computer reads each instruction from memory and places it in a
control register.
The control then interprets the binary code of the instruction and
proceeds to execute it by issuing a sequence of micro operations.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

3 / 23
Instruction Codes

An instruction code is a group of bits that instruct the computer to
perform a speciļ¬c task.
It is usually divided into parts, each having its own particular
interpretation.
They are:
Operation Code, and
Operands.

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

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

4 / 23
Operation Code

The Operation Code (OpCode) of an instruction is a group of bits that
deļ¬ne each operation such add, subtract, multiply, shift, and
complement.
It must consist of at least n bits for a given 2n distinct operations.
Suppose we are having 64 (26 ) operation then the length of OpCode
will be 6.
The control unit decode the OpCode and do the required operation.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

5 / 23
Operands
The Operation must be performed on some data stored in processor
register or in memory.
Every Computer has its own particular instruction code format.
The Simplest way to organize a computer is to have an instruction
code format with two parts.
The ļ¬rst part speciļ¬es the operation to be performed and the second
speciļ¬es an address.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

6 / 23
Instruction Formats

The bits of the instruction are divided into groups called ļ¬elds. The
most common ļ¬elds found in instruction formats are:
An Operation Code ļ¬eld that speciļ¬es the operation to be performed.
An Address ļ¬eld that designates a memory address or a processor
register.
A mode ļ¬eld that speciļ¬es the way the operand or the effective
address is determined.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

7 / 23
Instruction Formats

Computer may have instruction of several different lengths containing
varying numbers of addresses.
The number of address ļ¬elds 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 organization:
1
2
3

Single accumulator organization.
General register organization.
Stack organization.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

8 / 23
Single accumulator organization

All Operation are performed with an implied accumulator register. The
instruction format in this type of computers uses one address ļ¬eld.
Example:

ADD X
where, X is the address of the operand.
The ADD instruction in this case results in the operation
AC < āˆ’ AC + M[X].

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

9 / 23
General register organization
The instruction format in this type of computer needs three register
address ļ¬elds.
Thus the instruction for an arithmetic addition may be written in an
assembly language as

ADD R1, R2, R3
to denote the operation R1 < āˆ’ R2 + R3.
The number of address ļ¬elds in the instruction can be reduced from
three to two if the destination register is the same as one of the
source registers.

ADD R1, R2
would denote the operation R1 < āˆ’ R1 + R2.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

10 / 23
Stack organization

The stack-organized CPU would have PUSH and POP instruction
which requires an address ļ¬led.
Example:

PUSH X
will push the word at address X to the top of the stack. The stack
pointer is updated automatically.
The operation is performed on the two items that are on top of the
stack.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

11 / 23
Evaluation of Arithmetic Statement

X=(A+B)āˆ—(C+D)
Three - Address Instruction
ADD R1, A, B
R1 < āˆ’ M[A] + M[B]
ADD R2, C, D
R2 < āˆ’ M[C] + M[D]
MUL X, R1, R2
M[X] < āˆ’ R1 āˆ— R2.
Two - Address Instruction
MOV R1, A
R1 < āˆ’ M[A]
ADD R1, B
R1 < āˆ’ R1 + M[B]
MOV R2, C
R2 < āˆ’ M[C]
ADD R2, D
R2 < āˆ’ R2 + M[D]
MUL R1, R2
R1 < āˆ’ R1 āˆ— R2
MOV X, R1
M[X] < āˆ’ R1

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

12 / 23
Evaluation of Arithmetic Statement
One - Address Instruction
LOAD A
AC< āˆ’ M[A]
ADD B
AC < āˆ’ AC + M[B]
STORE T
M[T] < āˆ’ AC
LOAD C
AC < āˆ’ M[C]
ADD D
AC< āˆ’ AC + M[D]
MUL T
AC < āˆ’ AC āˆ— M[T]
STORE X
M[X] < āˆ’ AC
Zero - Address Instruction
PUSH A
TOS < āˆ’ A
PUSH B
TOS < āˆ’ B
ADD
TOS < āˆ’ (A + B)
PUSH C
TOS < āˆ’ C
PUSH D
TOS < āˆ’ D
ADD
TOS < āˆ’(C + D)
MUL
TOS < āˆ’ (C + D) * (A+ B)
POP X
M[X] < āˆ’ TOS
Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

13 / 23
Addressing Modes

The way the operands are chosen during program execution is
dependent on the addressing mode of the instruction.
The addressing mode speciļ¬es a rule for interpreting or modifying the
address ļ¬eld of the instruction before the operand is actually
referenced.
An Operation Code ļ¬eld that speciļ¬es the operation to be performed.
An Address ļ¬eld that designates a memory address or a processor
register.
A mode ļ¬eld that speciļ¬es the way the operand or the effective
address is determined.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

14 / 23
Addressing Modes

Computer use addressing mode techniques for the purpose of
accommodating one or both of the following provisions:
To give programming versatility to the user by providing such facilities
as pointers to memory, counters for loop control, indexing of data, and
program relocation.
To reduce the number of bits in the addressing ļ¬eld of the instruction.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

15 / 23
Type of Addressing Modes

Although most addressing mode modify the address ļ¬eld of the
instruction, there are two modes that need no address ļ¬eld at all.
These are:
Implied Mode: Operands are speciļ¬ed implicitly in the deļ¬nition of the
instruction. Like ā€Complement Accumulatorā€.
Zero-Address instruction in a stack-organized computer are
implied-mode instruction since the operands are implied to be on top of
the stack.
Immediate Mode: In this mode the operand is speciļ¬ed in the
instruction itself.
Immediate-mode instruction are useful for initializing registers to a
constant value.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

16 / 23
Type of Addressing Modes

Register Mode: In this mode the operands are in register that reside
within the CPU.
The particular register is selected from a register ļ¬led in the
instruction.
Register Indirect Mode: In this mode the instruction speciļ¬es a
register in the CPU whose content give the address of the operand in
memory.
The advantage is that the address ļ¬eld of the instruction uses a fewer
bits to select a register than would have been required to specify a
memory address directly.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

17 / 23
Type of Addressing Modes

Auto-increment Mode or Auto-decrement Mode
Direct Address Mode
Indirect Address Mode
Relative Address Mode
Indexed Addressing Mode
Base Register Addressing Mode

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

18 / 23
Program Interrupt

The concept of program interrupt is used to handle a variety of
problems that arise out of normal program sequence.
Program interrupt refers to the transfer of program control from a
currently running program to another service program as a result of
an external or internal generated request.
Control returns to the original program after the service program is
executed.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

19 / 23
Program Interrupt

The interrupt procedure is, in principal, quite similar, to subroutine call
except for three variation:
1

2

3

The interrupt is usually initiated by an internal or external signal rather
than from the execution of an instruction;
The address of the interrupt service program is determined by the
hardware rather than from the address ļ¬eld of instruction; and
an interrupt procedure usually stores all the information necessary to
deļ¬ne the state of the CPU rather than storing only the program
counter.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

20 / 23
Program Interrupt

These three procedure concept are clariļ¬ed further as:
1
2
3

The content of the program counter
The content of all processor register
The content of certain status conditions

The collection of all status bit conditions in the CPU is sometimes
called a Program Status Word or PSW.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

21 / 23
Types of Interrupts
There are three major types of interrupts that cause a break in the
normal execution of a program. They are:
1

2

3

External Interrupts - come from input-output (I/O) devices, from a
timing devices, from a circuit monitoring the power supply, or from any
other external source.
Example: I/O devices requesting for transfer of data, I/O devices
ļ¬nished transfer of data, elapsed time of an event, or power failure.
Internal Interrupts - arise from illegal or erroneous use of an instruction
or date, also known as trap.
Example: register overļ¬‚ow, divide by zero, invalid operation code, stack
overļ¬‚ow, protection violation.
Software Interrupts - initiated by executing an instruction. It is a special
call instruction that behaves like an interrupt rather than a subroutine
call.

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

22 / 23
THANK YOU

Abhineet Anand (UPES, Dehradun)

INST n , INTERRUPTS, IO PROCESSING

December 9, 2012

23 / 23

More Related Content

What's hot

Micro program example
Micro program exampleMicro program example
Micro program examplerajshreemuthiah
Ā 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference InstructionsRabin BK
Ā 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationrajshreemuthiah
Ā 
Iaetsd fpga implementation of fault tolerant embedded
Iaetsd fpga implementation of fault tolerant embeddedIaetsd fpga implementation of fault tolerant embedded
Iaetsd fpga implementation of fault tolerant embeddedIaetsd Iaetsd
Ā 
Digital signal processing
Digital signal processingDigital signal processing
Digital signal processingPrabhu R
Ā 
JCL MAINFRAMES
JCL MAINFRAMESJCL MAINFRAMES
JCL MAINFRAMESkamaljune
Ā 
Computer Organisation - Addressing Modes
Computer Organisation - Addressing ModesComputer Organisation - Addressing Modes
Computer Organisation - Addressing ModesArunaDevi63
Ā 
Central processing unit
Central processing unitCentral processing unit
Central processing unitjyoti_lakhani
Ā 
Computer architecture instruction formats
Computer architecture instruction formatsComputer architecture instruction formats
Computer architecture instruction formatsMazin Alwaaly
Ā 
addressing modes
addressing modesaddressing modes
addressing modesSadaf Rasheed
Ā 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
Ā 
Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3janaki ram
Ā 
Mainframe JCL Part - 1
Mainframe JCL Part - 1Mainframe JCL Part - 1
Mainframe JCL Part - 1janaki ram
Ā 
Addressing Modes
Addressing ModesAddressing Modes
Addressing ModesMayank Garg
Ā 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1vishwas17
Ā 

What's hot (18)

Micro program example
Micro program exampleMicro program example
Micro program example
Ā 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
Ā 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
Ā 
Iaetsd fpga implementation of fault tolerant embedded
Iaetsd fpga implementation of fault tolerant embeddedIaetsd fpga implementation of fault tolerant embedded
Iaetsd fpga implementation of fault tolerant embedded
Ā 
Digital signal processing
Digital signal processingDigital signal processing
Digital signal processing
Ā 
JCL MAINFRAMES
JCL MAINFRAMESJCL MAINFRAMES
JCL MAINFRAMES
Ā 
Computer Organisation - Addressing Modes
Computer Organisation - Addressing ModesComputer Organisation - Addressing Modes
Computer Organisation - Addressing Modes
Ā 
Lecture 26
Lecture 26Lecture 26
Lecture 26
Ā 
Instruction codes
Instruction codesInstruction codes
Instruction codes
Ā 
Central processing unit
Central processing unitCentral processing unit
Central processing unit
Ā 
Addressing modes
Addressing modesAddressing modes
Addressing modes
Ā 
Computer architecture instruction formats
Computer architecture instruction formatsComputer architecture instruction formats
Computer architecture instruction formats
Ā 
addressing modes
addressing modesaddressing modes
addressing modes
Ā 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
Ā 
Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3
Ā 
Mainframe JCL Part - 1
Mainframe JCL Part - 1Mainframe JCL Part - 1
Mainframe JCL Part - 1
Ā 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
Ā 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1
Ā 

Similar to Instruction, interrupts & io processing

Central processor organization
Central processor organizationCentral processor organization
Central processor organizationProf. Dr. K. Adisesha
Ā 
Central processor organization
Central processor organizationCentral processor organization
Central processor organizationProf. Dr. K. Adisesha
Ā 
ITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxSabaNaeem26
Ā 
instruction codes
instruction codesinstruction codes
instruction codesSangeethaSasi1
Ā 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.CS_GDRCST
Ā 
cse211 power point presentation for engineering
cse211 power point presentation for engineeringcse211 power point presentation for engineering
cse211 power point presentation for engineeringVishnuVinay6
Ā 
Computer Organization
Computer OrganizationComputer Organization
Computer Organizationanishgoel
Ā 
Computer Organization
Computer OrganizationComputer Organization
Computer OrganizationAnish Goel
Ā 
embedded system and computer architecure
embedded system and computer architecureembedded system and computer architecure
embedded system and computer architecuremadhulbtech23
Ā 
Basic computer organization
Basic computer organizationBasic computer organization
Basic computer organizationNitesh Singh
Ā 
Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013Buvana Buvana
Ā 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptSaurabhPorwal14
Ā 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
Ā 
CS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdfCS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdf187SayanBhattacharje
Ā 

Similar to Instruction, interrupts & io processing (20)

Lect5 organization
Lect5 organizationLect5 organization
Lect5 organization
Ā 
Central processor organization
Central processor organizationCentral processor organization
Central processor organization
Ā 
Central processor organization
Central processor organizationCentral processor organization
Central processor organization
Ā 
ITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptx
Ā 
instruction codes
instruction codesinstruction codes
instruction codes
Ā 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
Ā 
cse211 power point presentation for engineering
cse211 power point presentation for engineeringcse211 power point presentation for engineering
cse211 power point presentation for engineering
Ā 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
Ā 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
Ā 
Co unit 1
Co unit 1Co unit 1
Co unit 1
Ā 
CSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptxCSA PPT UNIT 1.pptx
CSA PPT UNIT 1.pptx
Ā 
Processor Basics
Processor BasicsProcessor Basics
Processor Basics
Ā 
embedded system and computer architecure
embedded system and computer architecureembedded system and computer architecure
embedded system and computer architecure
Ā 
Cpu execution
Cpu executionCpu execution
Cpu execution
Ā 
Basic computer organization
Basic computer organizationBasic computer organization
Basic computer organization
Ā 
Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013Cs2253 coa-2marks-2013
Cs2253 coa-2marks-2013
Ā 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.ppt
Ā 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
Ā 
CS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdfCS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdf
Ā 
Ch 8
Ch 8Ch 8
Ch 8
Ā 

More from Kumar

Graphics devices
Graphics devicesGraphics devices
Graphics devicesKumar
Ā 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithmsKumar
Ā 
region-filling
region-fillingregion-filling
region-fillingKumar
Ā 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivationKumar
Ā 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons dericationKumar
Ā 
Introductionto xslt
Introductionto xsltIntroductionto xslt
Introductionto xsltKumar
Ā 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xmlKumar
Ā 
Xml basics
Xml basicsXml basics
Xml basicsKumar
Ā 
XML Schema
XML SchemaXML Schema
XML SchemaKumar
Ā 
Publishing xml
Publishing xmlPublishing xml
Publishing xmlKumar
Ā 
DTD
DTDDTD
DTDKumar
Ā 
Applying xml
Applying xmlApplying xml
Applying xmlKumar
Ā 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLKumar
Ā 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee applicationKumar
Ā 
JNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLJNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLKumar
Ā 
EJB Fundmentals
EJB FundmentalsEJB Fundmentals
EJB FundmentalsKumar
Ā 
JSP and struts programming
JSP and struts programmingJSP and struts programming
JSP and struts programmingKumar
Ā 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programmingKumar
Ā 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversKumar
Ā 
Introduction to J2EE
Introduction to J2EEIntroduction to J2EE
Introduction to J2EEKumar
Ā 

More from Kumar (20)

Graphics devices
Graphics devicesGraphics devices
Graphics devices
Ā 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithms
Ā 
region-filling
region-fillingregion-filling
region-filling
Ā 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivation
Ā 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons derication
Ā 
Introductionto xslt
Introductionto xsltIntroductionto xslt
Introductionto xslt
Ā 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xml
Ā 
Xml basics
Xml basicsXml basics
Xml basics
Ā 
XML Schema
XML SchemaXML Schema
XML Schema
Ā 
Publishing xml
Publishing xmlPublishing xml
Publishing xml
Ā 
DTD
DTDDTD
DTD
Ā 
Applying xml
Applying xmlApplying xml
Applying xml
Ā 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Ā 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee application
Ā 
JNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLJNDI, JMS, JPA, XML
JNDI, JMS, JPA, XML
Ā 
EJB Fundmentals
EJB FundmentalsEJB Fundmentals
EJB Fundmentals
Ā 
JSP and struts programming
JSP and struts programmingJSP and struts programming
JSP and struts programming
Ā 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programming
Ā 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC Drivers
Ā 
Introduction to J2EE
Introduction to J2EEIntroduction to J2EE
Introduction to J2EE
Ā 

Recently uploaded

Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelDeepika Singh
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
Ā 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
Ā 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
Ā 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
Ā 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
Ā 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
Ā 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
Ā 

Recently uploaded (20)

Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
Ā 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Ā 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Ā 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Ā 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Ā 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Ā 

Instruction, interrupts & io processing

  • 1. Unit 5 -INSTRUCTION, INTERRUPTS and IO PROCESSING Abhineet Anand Computer Science and Engg. Department University of Petroleum and Energy Studies, Dehradun December 9, 2012 Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 1 / 23
  • 2. Outline 1 Instruction Codes Introduction Operation Code Operands 2 Instruction Formats Single accumulator organization General register organization Stack organization Evaluation of Arithmetic Statement 3 Addressing Modes Type of Addressing Modes 4 Program Interrupt Types of Interrupts Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 2 / 23
  • 3. Instruction Codes A Computer instruction is binary code that speciļ¬es a sequence of micro operation for the Computer. The Computer reads each instruction from memory and places it in a control register. The control then interprets the binary code of the instruction and proceeds to execute it by issuing a sequence of micro operations. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 3 / 23
  • 4. Instruction Codes An instruction code is a group of bits that instruct the computer to perform a speciļ¬c task. It is usually divided into parts, each having its own particular interpretation. They are: Operation Code, and Operands. The most basic part of an instruction code is its operation part. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 4 / 23
  • 5. Operation Code The Operation Code (OpCode) of an instruction is a group of bits that deļ¬ne each operation such add, subtract, multiply, shift, and complement. It must consist of at least n bits for a given 2n distinct operations. Suppose we are having 64 (26 ) operation then the length of OpCode will be 6. The control unit decode the OpCode and do the required operation. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 5 / 23
  • 6. Operands The Operation must be performed on some data stored in processor register or in memory. Every Computer has its own particular instruction code format. The Simplest way to organize a computer is to have an instruction code format with two parts. The ļ¬rst part speciļ¬es the operation to be performed and the second speciļ¬es an address. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 6 / 23
  • 7. Instruction Formats The bits of the instruction are divided into groups called ļ¬elds. The most common ļ¬elds found in instruction formats are: An Operation Code ļ¬eld that speciļ¬es the operation to be performed. An Address ļ¬eld that designates a memory address or a processor register. A mode ļ¬eld that speciļ¬es the way the operand or the effective address is determined. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 7 / 23
  • 8. Instruction Formats Computer may have instruction of several different lengths containing varying numbers of addresses. The number of address ļ¬elds 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 organization: 1 2 3 Single accumulator organization. General register organization. Stack organization. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 8 / 23
  • 9. Single accumulator organization All Operation are performed with an implied accumulator register. The instruction format in this type of computers uses one address ļ¬eld. Example: ADD X where, X is the address of the operand. The ADD instruction in this case results in the operation AC < āˆ’ AC + M[X]. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 9 / 23
  • 10. General register organization The instruction format in this type of computer needs three register address ļ¬elds. Thus the instruction for an arithmetic addition may be written in an assembly language as ADD R1, R2, R3 to denote the operation R1 < āˆ’ R2 + R3. The number of address ļ¬elds in the instruction can be reduced from three to two if the destination register is the same as one of the source registers. ADD R1, R2 would denote the operation R1 < āˆ’ R1 + R2. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 10 / 23
  • 11. Stack organization The stack-organized CPU would have PUSH and POP instruction which requires an address ļ¬led. Example: PUSH X will push the word at address X to the top of the stack. The stack pointer is updated automatically. The operation is performed on the two items that are on top of the stack. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 11 / 23
  • 12. Evaluation of Arithmetic Statement X=(A+B)āˆ—(C+D) Three - Address Instruction ADD R1, A, B R1 < āˆ’ M[A] + M[B] ADD R2, C, D R2 < āˆ’ M[C] + M[D] MUL X, R1, R2 M[X] < āˆ’ R1 āˆ— R2. Two - Address Instruction MOV R1, A R1 < āˆ’ M[A] ADD R1, B R1 < āˆ’ R1 + M[B] MOV R2, C R2 < āˆ’ M[C] ADD R2, D R2 < āˆ’ R2 + M[D] MUL R1, R2 R1 < āˆ’ R1 āˆ— R2 MOV X, R1 M[X] < āˆ’ R1 Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 12 / 23
  • 13. Evaluation of Arithmetic Statement One - Address Instruction LOAD A AC< āˆ’ M[A] ADD B AC < āˆ’ AC + M[B] STORE T M[T] < āˆ’ AC LOAD C AC < āˆ’ M[C] ADD D AC< āˆ’ AC + M[D] MUL T AC < āˆ’ AC āˆ— M[T] STORE X M[X] < āˆ’ AC Zero - Address Instruction PUSH A TOS < āˆ’ A PUSH B TOS < āˆ’ B ADD TOS < āˆ’ (A + B) PUSH C TOS < āˆ’ C PUSH D TOS < āˆ’ D ADD TOS < āˆ’(C + D) MUL TOS < āˆ’ (C + D) * (A+ B) POP X M[X] < āˆ’ TOS Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 13 / 23
  • 14. Addressing Modes The way the operands are chosen during program execution is dependent on the addressing mode of the instruction. The addressing mode speciļ¬es a rule for interpreting or modifying the address ļ¬eld of the instruction before the operand is actually referenced. An Operation Code ļ¬eld that speciļ¬es the operation to be performed. An Address ļ¬eld that designates a memory address or a processor register. A mode ļ¬eld that speciļ¬es the way the operand or the effective address is determined. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 14 / 23
  • 15. Addressing Modes Computer use addressing mode techniques for the purpose of accommodating one or both of the following provisions: To give programming versatility to the user by providing such facilities as pointers to memory, counters for loop control, indexing of data, and program relocation. To reduce the number of bits in the addressing ļ¬eld of the instruction. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 15 / 23
  • 16. Type of Addressing Modes Although most addressing mode modify the address ļ¬eld of the instruction, there are two modes that need no address ļ¬eld at all. These are: Implied Mode: Operands are speciļ¬ed implicitly in the deļ¬nition of the instruction. Like ā€Complement Accumulatorā€. Zero-Address instruction in a stack-organized computer are implied-mode instruction since the operands are implied to be on top of the stack. Immediate Mode: In this mode the operand is speciļ¬ed in the instruction itself. Immediate-mode instruction are useful for initializing registers to a constant value. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 16 / 23
  • 17. Type of Addressing Modes Register Mode: In this mode the operands are in register that reside within the CPU. The particular register is selected from a register ļ¬led in the instruction. Register Indirect Mode: In this mode the instruction speciļ¬es a register in the CPU whose content give the address of the operand in memory. The advantage is that the address ļ¬eld of the instruction uses a fewer bits to select a register than would have been required to specify a memory address directly. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 17 / 23
  • 18. Type of Addressing Modes Auto-increment Mode or Auto-decrement Mode Direct Address Mode Indirect Address Mode Relative Address Mode Indexed Addressing Mode Base Register Addressing Mode Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 18 / 23
  • 19. Program Interrupt The concept of program interrupt is used to handle a variety of problems that arise out of normal program sequence. Program interrupt refers to the transfer of program control from a currently running program to another service program as a result of an external or internal generated request. Control returns to the original program after the service program is executed. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 19 / 23
  • 20. Program Interrupt The interrupt procedure is, in principal, quite similar, to subroutine call except for three variation: 1 2 3 The interrupt is usually initiated by an internal or external signal rather than from the execution of an instruction; The address of the interrupt service program is determined by the hardware rather than from the address ļ¬eld of instruction; and an interrupt procedure usually stores all the information necessary to deļ¬ne the state of the CPU rather than storing only the program counter. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 20 / 23
  • 21. Program Interrupt These three procedure concept are clariļ¬ed further as: 1 2 3 The content of the program counter The content of all processor register The content of certain status conditions The collection of all status bit conditions in the CPU is sometimes called a Program Status Word or PSW. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 21 / 23
  • 22. Types of Interrupts There are three major types of interrupts that cause a break in the normal execution of a program. They are: 1 2 3 External Interrupts - come from input-output (I/O) devices, from a timing devices, from a circuit monitoring the power supply, or from any other external source. Example: I/O devices requesting for transfer of data, I/O devices ļ¬nished transfer of data, elapsed time of an event, or power failure. Internal Interrupts - arise from illegal or erroneous use of an instruction or date, also known as trap. Example: register overļ¬‚ow, divide by zero, invalid operation code, stack overļ¬‚ow, protection violation. Software Interrupts - initiated by executing an instruction. It is a special call instruction that behaves like an interrupt rather than a subroutine call. Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 22 / 23
  • 23. THANK YOU Abhineet Anand (UPES, Dehradun) INST n , INTERRUPTS, IO PROCESSING December 9, 2012 23 / 23