SlideShare a Scribd company logo
1 of 50
William Stallings
Computer Organization
and Architecture
8th Edition
Chapter 3
Top Level View of Computer
Function and Interconnection
What is a program?
• A sequence of steps
• For each step, an arithmetic or logical
operation is done
• For each operation, a different set of
control signals is needed
Function of Control Unit
• For each operation a unique code is
provided
—e.g. ADD, MOVE
• A hardware segment accepts the code and
issues the control signals
Components
• The Control Unit and the Arithmetic and
Logic Unit constitute the Central
Processing Unit
• instructions need to get into the system
and results out
—Input/output
• Temporary storage of code and results is
needed
—Main memory
Computer Components:
Top Level View
Instruction Cycle
• Two steps:
—Fetch
—Execute
Fetch Cycle
• Program Counter (PC) holds address of
next instruction to fetch
• Processor fetches instruction from
memory location pointed to by PC
• Increment PC
• Instruction loaded into Instruction
Register (IR)
• Processor interprets instruction and
performs required actions
Execute Cycle
• Processor-memory
—data transfer between CPU and main memory
• Processor I/O
—Data transfer between CPU and I/O module
• Data processing
—Some arithmetic or logical operation on data
• Control
—Alteration of sequence of operations
Example of Program Execution
Instruction Cycle State Diagram
Interrupts
• In early years of computing, processor has to wait for
the signal for processing, so processor has to check each
and every hardware and software program in the system
if it has any signal to process.
• This method of checking the signal in the system for
processing is called polling method.
• In this method the processor has to waste number of
clock cycles just for checking the signal in the system, by
this processor will become busy unnecessarily. If any
signal came for the process, processor will take some
time to process the signal due to the polling process in
action. So system performance also will be degraded and
response time of the system will also decrease.
Interrupts
• So to over this problem engineers
introduced a new mechanism, in this
mechanism processor will not check for
any signal from hardware or software but
instead hardware/software will only send
the signal to the processor for processing.
• The signal from hardware or software
should have highest priority because
processor should leave the current
process and process the signal of
hardware or software. This mechanism of
processing the signal is called interrupt of
the system.
Interrupt
• “Interrupt is a signal which has highest
priority from hardware or software which
processor should process its signal
immediately”
Types of Interrupts:
• Although interrupts have highest priority
than other signals, there are many type of
interrupts but basic type of interrupts are
1. Hardware Interrupts:
If the
signal for the processor is from external
device or hardware is called hardware
interrupts.
Example: from keyboard we will press the
key to do some action this pressing of key
in keyboard will generate a signal which is
given to the processor to do action, such
interrupts are called hardware interrupts.
Hardware interrupts can be classified into
two types.
• Maskable Interrupt: The hardware
interrupts which can be delayed when a
much highest priority interrupt has
occurred to the processor.
• Non Maskable Interrupt: The hardware
which cannot be delayed and should
process by the processor immediately.
2. Software Interrupts
Software interrupt can also divided in to two
types. They are
• Normal Interrupts: the interrupts which
are caused by the software instructions
are called normal interrupt
• Exception: unplanned interrupts while
executing a program is called Exception.
For example: while executing a program if
we got a value which should be divided by
zero is called a exception.
Program Generated Interrupts
• Most computers have an instruction that
generates an internal interrupt.
• Program generated interrupts are a
means for user programs to call a function
of the operating system
Transfer of Control via Interrupts
Interrupt Handling
• We know that instruction cycle consists of
fetch, decode, execute and read/write
functions.
• After every instruction cycle the processor
will check for interrupts to be processed
• if there is no interrupt is present in the
system it will go for the next instruction
cycle which is given by the instruction
register.
Interrupt Handling
• If there is an interrupt present then it will
trigger the interrupt handler
• the handler will stop the present
instruction which is processing and save
its configuration in a register and load the
program counter of the interrupt from a
location which is given by the interrupt
vector table.
Instruction Cycle with Interrupts
Interrupt Handling
• After processing the interrupt by the
processor interrupt handler will load the
instruction and its configuration from the
saved register, process will start its
processing where it’s left.
• This saving the old instruction processing
configuration and loading the new
interrupt configuration is also called as
context switching.
• The interrupt handler is also called as
Interrupt service routine (ISR).
Instruction Cycle (with Interrupts) -
State Diagram
Program Flow Control
Interrupt Cycle
• Added to instruction cycle
• Processor checks for interrupt
—Indicated by an interrupt signal
• If no interrupt, fetch next instruction
• If interrupt pending:
—Suspend execution of current program
—Save context
—Set PC to start address of interrupt handler
routine
—Process interrupt
—Restore context and continue interrupted
program
• the processor and the operating system
are responsible for suspending the user
program and then resuming it at
the same point
Program Timing
Short I/O Wait
Program Timing
Long I/O Wait
Multiple Interrupts
• Disable interrupts
—Processor will ignore further interrupts while
processing one interrupt
—Interrupts remain pending and are checked
after first interrupt has been processed
—Interrupts handled in sequence as they occur
• Define priorities
—Low priority interrupts can be interrupted by
higher priority interrupts
—When higher priority interrupt has been
processed, processor returns to previous
interrupt
Multiple Interrupts - Sequential
Multiple Interrupts – Nested
Time Sequence of Multiple Interrupts
INTERCONNECTION STRUCTURES
• A computer consists of a set of
components or modules of three basic
types (processor, memory, I/O) that
communicate with each other. a
computer is a network of basic modules.
• There must be paths for connecting the
modules.
• The collection of paths connecting the
various modules is called the
interconnection structure.
Computer Modules
Memory Connection
• Receives and sends data
• Receives addresses (of locations)
• Receives control signals
—Read
—Write
Input/Output Connection(1)
• I/O is functionally similar to memory.
• There are two operations, read and write.
• An I/O module may control more than one
external device. We can refer to each
external device as a port and give each a
unique address (e.g., 0, 1,...,M– 1).
• an I/O module may be able to send
interrupt signals to the processor
CPU Connection
• Reads instruction and data
• Writes out data (after processing)
• Sends control signals to other units
• Receives (& acts on) interrupts
The interconnection structure must
support the following types of transfers:
• Memory to processor: The processor
reads an instruction or a unit of data from
memory.
• Processor to memory:The processor
writes a unit of data to memory.
• I/O to processor:The processor reads data
from an I/O device.
• Processor to I/O: The processor sends
data to the I/O device.
• I/O to or from memory: For these two
cases, an I/O module is allowed to
exchange data directly with memory,
without going through the processor,
using direct memory access (DMA).
Buses
• A bus is a communication pathway
connecting two or more devices.
• it is a shared transmission medium.
• A signal transmitted by any one device is
available for reception by all other devices
attached to the bus
• There are a number of possible
interconnection systems
• Single and multiple BUS structures are
most common
• e.g. Control/Address/Data bus
• e.g. Unibus (DEC-PDP)
Buses
• A bus consists of multiple
communication pathways, or lines.
• Each line is capable of transmitting
signals representing binary 1 and binary
0.
• 8-bit unit of data can be transmitted
over eight bus lines.
• A bus that connects major computer
components (processor, memory, I/O)
is called a system bus.
Bus Structure
• A system bus consists about 50 to
hundreds of separate lines.
• Each line is assigned a particular meaning
or function.
• The lines can be classified into three
groups (data, address, and control lines).
• In addition, there may be power
distribution lines that supply power to the
attached modules.
Data Bus
• Data lines provide a path for moving data
among system modules.
• These lines, collectively, are called the
data bus
—Remember that there is no difference between “data”
and “instruction” at this level
• The data bus may consist of 32, 64, 128,
or even more separate lines, the number
of lines being referred to as the width of
the data bus.
• Because each line can carry only 1 bit at a
time, the number of lines determines how
many bits can be transferred at a time.
Address bus
• Identify the source or destination of data
• For example, if the processor wishes to
read a word (8, 16, or 32 bits) of data
from memory, it puts the address of the
desired word on the address lines.
• Width of the address bus determines the
maximum possible memory capacity of
the system.
• Address lines are also used to address I/O
ports.
Address Bus
• Higher-order bits are used to select a
particular module on the bus, and the
lower-order bits select a memory location
or I/O Port.
• For example, on an 8-bit address bus,
address (01111111) below might
reference location 128 in a memory
module (module 0),
• and address 10000000 refer to devices
attached to an I/O module (module 1).
Control Bus
• Data and address lines are shared by all
components, there must be a means of
controlling their use.
• Control signals transmit both command
and timing information among system
modules.
• Timing signals indicate the validity of data
and address information.
• Command signals specify operations to be
performed.
Control Lines Include
• Memory write: Causes data on the bus to
be written into the addressed location
• Memory read: Causes data from the
addressed location to be placed on the
bus
• I/O write: Causes data on the bus to be
output to the addressed I/O port
• I/O read: Causes data from the addressed
I/O port to be placed on the bus
• Transfer ACK: Indicates that data have
been accepted from or placed on the bus
• Bus request: Indicates that a module
needs to gain control of the bus
• Interrupt request: Indicates that an
interrupt is pending
• Interrupt ACK: Acknowledges that the
pending interrupt has been recognized
• Clock: Is used to synchronize operations
• Reset: Initializes all module
Bus Interconnection Scheme
03_Top Level View of Computer Function and Interconnection.ppt

More Related Content

Similar to 03_Top Level View of Computer Function and Interconnection.ppt

Computer system architecture
Computer system architectureComputer system architecture
Computer system architecturejeetesh036
 
I/O systems chapter 12 OS
I/O systems chapter 12 OS I/O systems chapter 12 OS
I/O systems chapter 12 OS ssuser45ae56
 
03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.ppt03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.pptAmirZaman21
 
Computer architecture presentation
Computer architecture presentationComputer architecture presentation
Computer architecture presentationMuhammad Hamza
 
operatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdfoperatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdfChetanRaut43
 
operatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptxoperatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptxChetanRaut43
 
Operating system 03 handling of interrupts
Operating system 03 handling of interruptsOperating system 03 handling of interrupts
Operating system 03 handling of interruptsVaibhav Khanna
 
computer system structure
computer system structurecomputer system structure
computer system structureHAMZA AHMED
 
A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...rsaravanakumar13
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfFahanaAbdulVahab
 
Computer System Overview,
Computer System Overview, Computer System Overview,
Computer System Overview, Sajid Marwat
 
1353142173system unit
1353142173system unit1353142173system unit
1353142173system unitNajmul Hassan
 

Similar to 03_Top Level View of Computer Function and Interconnection.ppt (20)

Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
I/O systems chapter 12 OS
I/O systems chapter 12 OS I/O systems chapter 12 OS
I/O systems chapter 12 OS
 
03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.ppt03_top-level-view-of-computer-function-and-interconnection.ppt
03_top-level-view-of-computer-function-and-interconnection.ppt
 
1_to_10.pdf
1_to_10.pdf1_to_10.pdf
1_to_10.pdf
 
Chapter01 (1).ppt
Chapter01 (1).pptChapter01 (1).ppt
Chapter01 (1).ppt
 
Cs intro-ca
Cs intro-caCs intro-ca
Cs intro-ca
 
Computer architecture presentation
Computer architecture presentationComputer architecture presentation
Computer architecture presentation
 
operatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdfoperatingsystem03handlingofinterrupts-210603182850.pdf
operatingsystem03handlingofinterrupts-210603182850.pdf
 
operatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptxoperatingsystem03handlingofinterrupts-210603182850.pptx
operatingsystem03handlingofinterrupts-210603182850.pptx
 
Operating system 03 handling of interrupts
Operating system 03 handling of interruptsOperating system 03 handling of interrupts
Operating system 03 handling of interrupts
 
computer system structure
computer system structurecomputer system structure
computer system structure
 
ch4.ppt
ch4.pptch4.ppt
ch4.ppt
 
Cao u1
Cao u1Cao u1
Cao u1
 
A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...A transfer from I/O device to memory requires the execution of several instru...
A transfer from I/O device to memory requires the execution of several instru...
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
Computer System Overview,
Computer System Overview, Computer System Overview,
Computer System Overview,
 
1353142173system unit
1353142173system unit1353142173system unit
1353142173system unit
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

03_Top Level View of Computer Function and Interconnection.ppt

  • 1. William Stallings Computer Organization and Architecture 8th Edition Chapter 3 Top Level View of Computer Function and Interconnection
  • 2. What is a program? • A sequence of steps • For each step, an arithmetic or logical operation is done • For each operation, a different set of control signals is needed
  • 3. Function of Control Unit • For each operation a unique code is provided —e.g. ADD, MOVE • A hardware segment accepts the code and issues the control signals
  • 4. Components • The Control Unit and the Arithmetic and Logic Unit constitute the Central Processing Unit • instructions need to get into the system and results out —Input/output • Temporary storage of code and results is needed —Main memory
  • 6. Instruction Cycle • Two steps: —Fetch —Execute
  • 7. Fetch Cycle • Program Counter (PC) holds address of next instruction to fetch • Processor fetches instruction from memory location pointed to by PC • Increment PC • Instruction loaded into Instruction Register (IR) • Processor interprets instruction and performs required actions
  • 8. Execute Cycle • Processor-memory —data transfer between CPU and main memory • Processor I/O —Data transfer between CPU and I/O module • Data processing —Some arithmetic or logical operation on data • Control —Alteration of sequence of operations
  • 9. Example of Program Execution
  • 11. Interrupts • In early years of computing, processor has to wait for the signal for processing, so processor has to check each and every hardware and software program in the system if it has any signal to process. • This method of checking the signal in the system for processing is called polling method. • In this method the processor has to waste number of clock cycles just for checking the signal in the system, by this processor will become busy unnecessarily. If any signal came for the process, processor will take some time to process the signal due to the polling process in action. So system performance also will be degraded and response time of the system will also decrease.
  • 12. Interrupts • So to over this problem engineers introduced a new mechanism, in this mechanism processor will not check for any signal from hardware or software but instead hardware/software will only send the signal to the processor for processing. • The signal from hardware or software should have highest priority because processor should leave the current process and process the signal of hardware or software. This mechanism of processing the signal is called interrupt of the system.
  • 13. Interrupt • “Interrupt is a signal which has highest priority from hardware or software which processor should process its signal immediately”
  • 14. Types of Interrupts: • Although interrupts have highest priority than other signals, there are many type of interrupts but basic type of interrupts are 1. Hardware Interrupts: If the signal for the processor is from external device or hardware is called hardware interrupts. Example: from keyboard we will press the key to do some action this pressing of key in keyboard will generate a signal which is given to the processor to do action, such interrupts are called hardware interrupts.
  • 15. Hardware interrupts can be classified into two types. • Maskable Interrupt: The hardware interrupts which can be delayed when a much highest priority interrupt has occurred to the processor. • Non Maskable Interrupt: The hardware which cannot be delayed and should process by the processor immediately.
  • 16. 2. Software Interrupts Software interrupt can also divided in to two types. They are • Normal Interrupts: the interrupts which are caused by the software instructions are called normal interrupt • Exception: unplanned interrupts while executing a program is called Exception. For example: while executing a program if we got a value which should be divided by zero is called a exception.
  • 17. Program Generated Interrupts • Most computers have an instruction that generates an internal interrupt. • Program generated interrupts are a means for user programs to call a function of the operating system
  • 18. Transfer of Control via Interrupts
  • 19. Interrupt Handling • We know that instruction cycle consists of fetch, decode, execute and read/write functions. • After every instruction cycle the processor will check for interrupts to be processed • if there is no interrupt is present in the system it will go for the next instruction cycle which is given by the instruction register.
  • 20. Interrupt Handling • If there is an interrupt present then it will trigger the interrupt handler • the handler will stop the present instruction which is processing and save its configuration in a register and load the program counter of the interrupt from a location which is given by the interrupt vector table.
  • 22. Interrupt Handling • After processing the interrupt by the processor interrupt handler will load the instruction and its configuration from the saved register, process will start its processing where it’s left. • This saving the old instruction processing configuration and loading the new interrupt configuration is also called as context switching. • The interrupt handler is also called as Interrupt service routine (ISR).
  • 23. Instruction Cycle (with Interrupts) - State Diagram
  • 25. Interrupt Cycle • Added to instruction cycle • Processor checks for interrupt —Indicated by an interrupt signal • If no interrupt, fetch next instruction • If interrupt pending: —Suspend execution of current program —Save context —Set PC to start address of interrupt handler routine —Process interrupt —Restore context and continue interrupted program
  • 26. • the processor and the operating system are responsible for suspending the user program and then resuming it at the same point
  • 29. Multiple Interrupts • Disable interrupts —Processor will ignore further interrupts while processing one interrupt —Interrupts remain pending and are checked after first interrupt has been processed —Interrupts handled in sequence as they occur • Define priorities —Low priority interrupts can be interrupted by higher priority interrupts —When higher priority interrupt has been processed, processor returns to previous interrupt
  • 30. Multiple Interrupts - Sequential
  • 32. Time Sequence of Multiple Interrupts
  • 33. INTERCONNECTION STRUCTURES • A computer consists of a set of components or modules of three basic types (processor, memory, I/O) that communicate with each other. a computer is a network of basic modules. • There must be paths for connecting the modules. • The collection of paths connecting the various modules is called the interconnection structure.
  • 35. Memory Connection • Receives and sends data • Receives addresses (of locations) • Receives control signals —Read —Write
  • 36. Input/Output Connection(1) • I/O is functionally similar to memory. • There are two operations, read and write. • An I/O module may control more than one external device. We can refer to each external device as a port and give each a unique address (e.g., 0, 1,...,M– 1). • an I/O module may be able to send interrupt signals to the processor
  • 37. CPU Connection • Reads instruction and data • Writes out data (after processing) • Sends control signals to other units • Receives (& acts on) interrupts
  • 38. The interconnection structure must support the following types of transfers: • Memory to processor: The processor reads an instruction or a unit of data from memory. • Processor to memory:The processor writes a unit of data to memory. • I/O to processor:The processor reads data from an I/O device.
  • 39. • Processor to I/O: The processor sends data to the I/O device. • I/O to or from memory: For these two cases, an I/O module is allowed to exchange data directly with memory, without going through the processor, using direct memory access (DMA).
  • 40. Buses • A bus is a communication pathway connecting two or more devices. • it is a shared transmission medium. • A signal transmitted by any one device is available for reception by all other devices attached to the bus • There are a number of possible interconnection systems • Single and multiple BUS structures are most common • e.g. Control/Address/Data bus • e.g. Unibus (DEC-PDP)
  • 41. Buses • A bus consists of multiple communication pathways, or lines. • Each line is capable of transmitting signals representing binary 1 and binary 0. • 8-bit unit of data can be transmitted over eight bus lines. • A bus that connects major computer components (processor, memory, I/O) is called a system bus.
  • 42. Bus Structure • A system bus consists about 50 to hundreds of separate lines. • Each line is assigned a particular meaning or function. • The lines can be classified into three groups (data, address, and control lines). • In addition, there may be power distribution lines that supply power to the attached modules.
  • 43. Data Bus • Data lines provide a path for moving data among system modules. • These lines, collectively, are called the data bus —Remember that there is no difference between “data” and “instruction” at this level • The data bus may consist of 32, 64, 128, or even more separate lines, the number of lines being referred to as the width of the data bus. • Because each line can carry only 1 bit at a time, the number of lines determines how many bits can be transferred at a time.
  • 44. Address bus • Identify the source or destination of data • For example, if the processor wishes to read a word (8, 16, or 32 bits) of data from memory, it puts the address of the desired word on the address lines. • Width of the address bus determines the maximum possible memory capacity of the system. • Address lines are also used to address I/O ports.
  • 45. Address Bus • Higher-order bits are used to select a particular module on the bus, and the lower-order bits select a memory location or I/O Port. • For example, on an 8-bit address bus, address (01111111) below might reference location 128 in a memory module (module 0), • and address 10000000 refer to devices attached to an I/O module (module 1).
  • 46. Control Bus • Data and address lines are shared by all components, there must be a means of controlling their use. • Control signals transmit both command and timing information among system modules. • Timing signals indicate the validity of data and address information. • Command signals specify operations to be performed.
  • 47. Control Lines Include • Memory write: Causes data on the bus to be written into the addressed location • Memory read: Causes data from the addressed location to be placed on the bus • I/O write: Causes data on the bus to be output to the addressed I/O port • I/O read: Causes data from the addressed I/O port to be placed on the bus • Transfer ACK: Indicates that data have been accepted from or placed on the bus
  • 48. • Bus request: Indicates that a module needs to gain control of the bus • Interrupt request: Indicates that an interrupt is pending • Interrupt ACK: Acknowledges that the pending interrupt has been recognized • Clock: Is used to synchronize operations • Reset: Initializes all module