Explanation Interrupts System Interconnections. Interrupts A computer system must provide a method for allowing mechanisms to interrupt the normal processing.

Slides:



Advertisements
Similar presentations
Computer Architecture and Organization
Advertisements

Chapter 7: System Buses Dr Mohamed Menacer Taibah University
Computer Architecture
Digital Computer Fundamentals
I/O Organization popo.
INPUT-OUTPUT ORGANIZATION
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
I/O Unit.
CSCI 4717/5717 Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Interrupts (contd..) Multiple I/O devices may be connected to the processor and the memory via a bus. Some or all of these devices may be capable of generating.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
1 Computer System Overview OS-1 Course AA
Chapter 3 System Buses.
University College Cork IRELAND Hardware Concepts An understanding of computer hardware is a vital prerequisite for the study of operating systems.
TECH CH03 System Buses Computer Components Computer Function
2. Methods for I/O Operations
INPUT-OUTPUT ORGANIZATION
CS-334: Computer Architecture
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
MICROPROCESSOR INPUT/OUTPUT
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
THE COMPUTER SYSTEM. Lecture Objectives Computer functions – Instruction fetch & execute – Interrupt Handling – I/O functions Interconnections Computer.
ECE 456 Computer Architecture
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Top Level View of Computer Function and Interconnection.
System bus.
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
COMPUTER ORGANIZATIONS CSNB123. COMPUTER ORGANIZATIONS CSNB123 Expected Course Outcome #Course OutcomeCoverage 1Explain the concepts that underlie modern.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
EEE440 Computer Architecture
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
Review Question (last week) 1.With the aid of diagrams, explain the significant difference between Von Neumann and Harvard Architecture. 1.
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
By Fernan Naderzad.  Today we’ll go over: Von Neumann Architecture, Hardware and Software Approaches, Computer Functions, Interrupts, and Buses.
Chapter 6: Computer Components Dr Mohamed Menacer Taibah University
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Computer Architecture. Top level of Computer A top level of computer consists of CPU, memory, an I/O components, with one or more modules of each type.
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Overview Parallel Processing Pipelining
Chapter 3 Top Level View of Computer Function and Interconnection
Computer System Overview
ECEG-3202 Computer Architecture and Organization
COMP3221: Microprocessors and Embedded Systems
William Stallings Computer Organization and Architecture 7th Edition
William Stallings Computer Organization and Architecture
Presentation transcript:

Explanation Interrupts System Interconnections

Interrupts A computer system must provide a method for allowing mechanisms to interrupt the normal processing. Interrupts improve processor efficiency Most external devices are much slower than the processor and ‘busy waiting’ takes up too many resources. Examples: External interrupts: Timing device, Circuit monitoring the power supply, I/O device requesting data or completed data transfer etc. Timeout errors. Internal interrupts (caused by an exception condition). Illegal use of an instruction or data (traps) example: register overflow, attempt to divide by zero, invalid op code, stack overflow etcTimer: OS system can perform operations on a regular basis. Software Interrupts – Special call instruction that behaves like an interrupt.

Short I/O – the I/O operation is completed within the time it takes to execute instructions in the program that occur before the next I/O command. The processor is kept busy the whole time. Long I/O - The ‘next’ I/O command comes before first I/O has completed. Processor still needs to wait. Some time is saved ! Benefits of Interrupts

An example Busy Wait: Consider a computer that can execute two instructions that read the status register and check the flag in 1 µs. Input device transfers data at an average rate of 100 bytes per second – equivalent to one byte every 10,000 µs. The CPU will check the flag 10,000 times between each transfer. Interrupt Driven: CPU could use this time to perform other useful processing.

Interrupt Cycle The interrupt cycle is added to the instruction cycle. Processor checks for interrupt indicated by an interrupt flag. If there is NO interrupt  Fetch next instruction If there is an interrupt: Suspend operation of the program Save its context Set PC to start address of the interrupt handler Process the interrupt Restore the context of the original program and continue its execution.

Instruction Cycle with Interrupts Following each execute cycle: Check for interrupts Handle active interrupts

Instruction Cycle with Interrupts Disable interrupts Processor will ignore further interrupts whilst 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

Handling Multiple Interrupts Sequential approach – once an interrupt handler has been started it runs to completion (+) Simpler (-)Does not handle priority interrupts well Example: Incoming data might be lost. Nested approach – a higher priority device can interrupt a lower priority one. (+) More complex (-)Interrupts get handled in order of priority.

Priority Interrupts Polling One common branch address for all interrupts. Interrupt sources polled in priority sequence. If an interrupt signal is ‘on’, control branches to a service routine for this source. (-) Time overhead to handle many interrupts can be excessive. The operation can be sped up with a hardware priority-interrupt unit. Daisy-Chain Priority Hardware solution Serial connection of all devices that request interrupts. Device with the highest priority takes first position, 2 nd highest takes 2 nd position etc. Interrupt request line shared by all devices.

Daisy-chain Priority Interrupt A Serial Approach CPU Device 1Device 2Device 3 PIP0PI P0 INT INTACK Interrupt Request Interrupt Acknowledge Processor data bus VAD 1VAD 2VAD 3

One stage of the daisy-chain Priority Arrangement PIRFPOEnable S R Q Vector Address Delay... Priority In PI Interrupt request from device Open-collector inverter Interrupt request to CPU Priority Out PO RF From: Computer System Architecture, Morris Mano

Parallel Priority Interrupt Uses a register – whose bits are set separately by the interrupt signal from each device. Priority established according to the position of bits in the interrupt register. A mask register is used to control the status of each interrupt request. Mask bits set programmatically. Priority encoder generates low order bits of the VAD, which is transferred to the CPU. Encoder sets an interrupt status flip-flop IST whenever a non- masked interrupt occurs. Interrupt enable flip-flop provides overall control over the interrupt system.

Parallel Priority Interrupt Hardware I0I0 I1I1 I2I2 I3I3 Priority Encoder y x ISTIEN Disk Printer Reader Keyboard Enable Interrupt to CPU INTACK from CPU Interrupt Register Mask Register From: Computer System Architecture, Morris Mano

Priority Encoder Circuit that implements the priority function. Logic – if two or more inputs arrive at the same time, the input having the highest priority will take precedence. Boolean functions X = I’ 0 I’ 1 Y = I’ 0 I 1 + I’ 0 I’ 2 IST = I 0 + I 1 + I 2 + I 3 InputsOutputs I0I0 I1I1 I2I2 I3I3 dYIST 1ddd001 01dd d dd0

Interrupt Cycle The Interrupt enable flip-flop (IEN) can be set or cleared by program instructions. A programmer can therefore allow interrupts (clear IEN) or disallow interrupts (set IEN) At the end of each instruction cycle the CPU checks IEN and IST. If either is equal to zero, control continues with the next instruction. If both = 1, the interrupt is handled. Interrupt micro-operations: SP  SP – 1(Decrement stack pointer) M[SP]  PCcPush PC onto stack INTACK  1Enable interrupt acknowledge PC  VADTransfer vector address to PC IEN  0Disable further interrupts Go to fetch next instruction

Software Routines for handling Interrupts Software routines used to service interrupt requests and control interrupt hardware registers. Each device has its own service program reached through a jump instruction stored at the assigned vector address. Example: Keyboard sets interrupt bit whilst CPU is executing instruction at location 749. At the end of the instruction, 750 is pushed onto the stack, the VAD for the keyboard is taken off the bus and placed into the PC. Control is passed to the keyboard routine. Once completed, PC is replaced with original address of next instruction (750) JMP DISK JMP PRINTER JMP READER JMP KEYBOARD Main program Stack Program to service magnetic disk. Program to service line printer. Program to service character reader. Program to service Keyboard.

Interconnection Structures Memory: Outputs data. Inputs read, write, and timing signals, addresses, and data. I/O Module. Outputs data & interrupt signals. Inputs control signals, data, and addresses. CPU: Outputs address, control signals, and data. Inputs instructions data, and interrupt signals.

Bus Interconnection Communication pathway connecting two or more devices. Shared transmission medium - usually broadcast. Typically 50 – 100s of separate lines divided into three functional groups: Data lines At this level ‘data’ and ‘instruction’ are synonymous. Width is a key determinant of performance. (Example: 32 bit words, data bus 16 bits  2 cycles to transmit one word). Address lines Identify source or destination of data (ie address in memory) Width determines maximum memory capacity of system (ie 8080 has 16 bit address  64K address space). Control lines Control lines Control and timing signals (read, write, ack, clock)

Bus Interconnection –Parallel lines on circuit boards –Ribbon cables –Strip connectors on mother boards –Sets of wires

Single Bus Problems Lots of devices on one bus leads to: Propagation delays Long data paths mean that co-ordination of bus use can adversely affect performance If aggregate data transfer approaches bus capacity Most modern systems have at least 4 busses to solve this problem: Processor bus Cache bus Dedicated bus for accessing system cache. Local I/O bus High speed I/O bus for connecting performance critical peripherals such as high-speed networks, disk storage devices. Standard I/O bus Connects slower peripherals such as mouse & modems etc.

Traditional ISA (with Cache)

High Performance Architecture

Elements of Bus Design Type Dedicated vs. Multiplexed Dedicated by functionality ie address vs. data or dedication to a physical subset of components. Arbitration Method Only one module can have control of the bus at any one time. Centralized vs. Distributed Timing Synchronous vs. Asynchronous Bus Width Address Data Data Transfer Type Read, Write, Read-modify-write, Read-after-write, Block

Bus Arbitration Hardware arbitration Serial arbitration – daisy chain Parallel arbitration Dynamic arbitration algorithms System can change the priority of the devices during normal operation. Time slice – fixed length time slice of bus time offered sequentially to each processor in round robin fashion. Polling – address of each device in turn placed on polling lines. A device may activate bus busy if it is being polled. LRU – Least recently used. FIFO – First in first out. Rotating Daisy-chain – dynamic extension of the daisy chain. Bus arbiter 1 Bus arbiter 2 Bus arbiter 3 Bus arbiter 4 Priority Encoder 2 X 4 Decoder Hardware for parallel arbitration Bus Ready

Synchronous Timing Occurrence of events on the bus coordinated by a clock. Bus includes a clock line. Clock transmits alternating 1s and 0s of equal duration. A single 1-0 transmission = 1 clock cycle. All events start at the beginning of a clock cycle.

Timing of Synchronous Bus Operations Stable Address Place stable address on the line during first clock signal. Once the address stabilizes an address enable signal is issued. Read: Read enable signal activated at start of next cycle. Memory module recognizes address and after 1 cycle places data on bus. Write is similar but address + data is placed on the bus early. Valid Data In Valid Data Out

Timing of Asynchronous Bus Operations Occurrence of one event follows the occurrence of a previous event. For read – place status and address on the line. Once stabilized, place a read signal on the bus. Memory decodes address, and places data on the bus. Processor sends and “ACK” – all lines can then be dropped.

Data Transfer Type Bus supports various data transfer types Write (Master to slave) Read (Slave to master) Multiplexed address/data bus Write (Cycle 1 : Address, Cycle 2 : Data) Read (Cycle 1 : Address, Delay, Cycle ?: Data) Non-multiplexed address/data bus Write (Address & Data both sent in same cycle). Read (Address followed by data once address is stabilized) Other types of transfer include: Read after write Block data transfer (Address + multiple blocks of data)