Professional Documents
Culture Documents
INTERRUPTS
.There are many situations where other taskS can be performed while waiting for an 1/0 device to
become ready.
A hardware signal called an Interrupt will alert the processor when an 1/0 device becomes ready.
Interrupt-signal is sent on the interrupt-request line.
The processor can be performing its own task without the need to continuously check the 1/0-device.
.The routine executed in response to an interrupt-request is called ISR.
The processor must inform the device that its request has been recognized by sending INTA signal.
(INTRInterrupt Request, INTA Interrupt Acknowledge, ISR Interrupt Service Routine)
.For example, consider COMPUTE and PRINT routines (Figure 3.6).
Program I1 Program 2
Interrupt
Occurs
here
2-33
1
Computer Organigation CBCS Model Question Paper
Module2
pointer register
A. a. Whot is interrupt hardware ?explain enabling
and disabling iaterrupt?(10 Mark
the instruction are first automatically
Ans.
A n 1/0 device requests an interrupt by activating a bus-line called interrunt.
tive address of the operand.
request(IR).
ointer register A single IR line can be used toserve ,n"
devices
plement an important data structure called All devices are connected to IR line via swiiches to ground.
To request an interrupt, a device closes its associated switch. Thus, if all IR sionalc
,RÍ are inactivei.e. if all switches are open), the voltage on the IR line will be equai to
#NUMI,R2 Initialization Vdd.
RO When a device requests an interrupt by closing its switch, the voltage on the line
R2+RO
to 0, causing the INTR received by the processor to goto I.
drops
The value of INTR is the logical OR of the requests from individual devices
OP
RO,SUM INTR=INTRI+INTR2+.....+1NTRn
A special gates known as open-collector or open-drain are used to drive the INTR line
Statement YqA+B) *(C+D) using three Resistor R is calleda pul-up resistor because it pulls the line voltage up to the high-
ddress iustruction. (04 Marks) voltage state when the switches are open.
The first device encountcred with its IRQ bit set is the device that skould be serviced.
After servicing this device, next requests nmay be serviced.
Main advantage: Simple & easy to implement.
Main disadvantage: More time spent polling IRQ bits of ali devices (that may not be
requesting any service)
DATAIN
DATAOUT
Processor
Bridge Main
memory
PCI bus
Disk/DMA DMA
controller controller
DhdDt Ethernet
interface
Figure 8.13 Use of DMA controlers in a computer system.
.DMA interface has three registers (Figure 8.12):
1) First register is used for storing starting-address.
2) Second register is used for storing word-count.
3) Third register contains status- & control-flags
Word count
2-33
TYIOat
3. a. Define bus arbitration? Explain detail
any one approach of the bus arbiteration.
Ans. Bus (08 Marks)
arbiteration is the process by which the next device become the bus
master is
selected and bus mastership is transferred to it. The selection of the
bus aster must
take into account the needs of various devices
by establishing a priority systen for
gaining access to the bus.
There are two approaches to bus arbitration
1. Centralized 2. Distributed
BR
Preccssor
DMA DMA
coniraller controlter
BGI BG2 2
Time
BGI
BG2
BBSY
Bus
muster
Processor DMAComroller 2 Processor
Distributed Arbitration:
Distributed Arbitration means that all devices waiting to use the bus have cqual
responsibility in carrying out the arbitration process, without using a central arbiter.
A simple method for distributed arbitration is shown below. Each device on the bus
in assigned a 4-bit identification number. When one or more devices request the
bus, they assert the start-arbitration signal and place their 4-bit ID numbers on four
open-collector lines, ARBO through ARB3. A winner is selected as a result of thke
interactioi among the siginals transmitted over these lines by all contenders. The net
outcome is that the code on the four lines represents the request that has the highest
D number.
ARB3
ARB2
ARB1
ARBO
Sart-Arbitratiena
O.C.
Interface circuit
for device A
4. a. Vith a block diagram, explain how the printer interfaced to processor.
(08 Marks)
Ans. Printer operates under control of the handshake
signals valid and idle in a manner
similar to the handshake used on thens with master ready and slave ready
Data
-
signais.
R/W
Master
ready o-
A
Adder
decoder
A
A
Fig: Outputinterface
The interface contair.s & data register DATAOUT and status flag SOUG flag is set
to I when the printer is ready to accept another character and it is closed to 0 when
a new character is loaded into DATAOT by the processor the interface circuit
can
then place a new character on the data line and activate the valid signal; in response.
the new charater and negates the idle signal, which in
turn
the printerstats pointing
causes the interface to deactivate the valid signal.
. cl . T with raenect to IISB..
COMPUTER ORGANIZATION
PRINTER INTERFACED TO PROCESsOR
Output interface
Data
Data
Address DISP DATTA
R/W Ready
Processor Display
DISP STATUS
Master-ready
New-data
Slave-ready
Figure 7.13 Display to processor connection.
Keyboard is connected to a processor using a parallel-port.
Processor usess
memory-mapped I/0 and
asynchronous bus protocol.
.On the processor-side of the interface, we have:
- Data-lines
Address-lines
Control or R/W line
Master-Ready signal and
Slave-Ready signal.
On the keyboard-side of the interface, we have:
- Encoder-circuit which generates a code for the key pressed.
- Debouncing-circuit which eliminates the effect of a key.
for the key.
Data-fines which contain the code is pressed. This causes the code to be loaded
Valid iine changes from 0 to 1 when the key
into DATAIN and SIN to be set to 1.
GENERAL 8 BIT PARALLEL PROCESSING
P7
DATAIN
DO
DATAOUT
Data
Directio
Myaddes
RS2
E
RS1 C1
RSO Register
sclect
RW
Ready
Accept
NTR
Figure 4.34: General 8 bit parallel interface
Data-lines P, through Po can be used for either input or output purposes (Figure 4.34)
For increased flexibility,
- some lines can be used as inputs and
some lines can be used as outputs.
The DATAOUT register is connected to data-lines via 3-state drivers that are controlled by a DDR.
The processor can write any 8-bit pattern into DDR. (DDR Data Direction Register).
.If DDR=1,
Then, data-line acts as an output-line
Otherwise, data-line acts as an input-line.
Two lines, C, and C, are used to control the interaction between interface-circuit and 1/0 device.
Two lines, C, and C, are also programmable.
Line C is bidirectional to provide different modes of signaling, including the handshake.
The Ready and Accept lines are the handshake control lines on the processor-bus side.
Hence, the Ready and Accept lines can be connected to Master-ready and Slave-ready.
The input signal My-address should be connected to the output of an address-decoder.
The address-decoder recognizes the address assigned to the interface.
There are 3 register select lines: RS,-RS.
Three register select lines allows up to eight registers in the interface.
An
interrupt-request INTR is also provided.
INTR should be connected to the interrupt-request line on the computer-bus.
2-33
COMPUTER ORGANIZATION
PHASES IN SCSI BUS
.The phases in SCSI bus operation are:
1) Arbitration
2) Selection
3) Information transfer
4) Reselection
1) Arbitration
.When the -BSY signal is in inactive state,
t h e bus will be free &
any controller can request the use of bus.
SCSI uses distributed arbitration scheme because
each controller may generate requests at the same time.
Each controller on the bus is assigned a fixed priority.
.When -BSY becomes active, all controllers that are requesting the bus
examines the data-lines &
determine whether highest priority device is requesting bus at the same time.
The controller using the highest numbered line realizes that it has won the arbitration-process.
At that time, all other controllers disconnect from the bus & wait for -BSY to become inactive again.
Tgets examine ID
DB2
DBS
DB6
BSY
SEL
MHz clock
FRAME# Sent by the intiater to indicate the duiration of îransacticn.
AD 32 addres/ data lines, which may be
optionally increased to 64.
C/BE# 4 command/byte enabled Iines
IRDX# Initiator - ready 2nd target ready signals
DEVSEL# A resporse from the device indicating that it has recogniscd its
address and is ready for a transfer transaction.
IDSEL# Initialization device select
The initiater uses the FRAME # signal to indicate. The duration of the burst. Since
it reads four words the intiator égates FRAME # during clock cycle 5, the eycle
in which it receives the third word. The fourth words in clock cycle 6, the target
disconnects its drivers and negates DEVSEL # at the begning of clock cycle 7.
I t CCST h1uc sianol with their functionalities. (05 Marks)
USB PROTOCOLS
All information transferred over the USB is organized in packets.
A packet consists of one or more bytes of information.
There are many types of packets that perform a variety of control functions.
The information transferred on USB is divided into 2 broad categories: 1) Control and 2) Data.
.Control packets perform tasks such as
addressing a device to initiate data transfer.
acknowledging that data have been received correctly or
indicating an error.
Data-packets carry information that is delivered to a device.
A packet consists of one or more fields containing different kinds of information.
The first field of any packet is called the Packet Identifier (PID) which identifies type of tha
packet.
They are transmitted twicce.
1) The first time they are sent with their true values and
2) The second time with each bit complemented.
The four PID bits identify one of 16 different packet types.
Some control packets, such as ACK (Acknowledge), consist only of the PID byte.
Control packets used for controlling data transfer operations are called Token Packets.
)Pctideredd
Bits
Host computer
Root
hub
Hub Hub
1/0 /O /O /O
device device device device
Hub
/O
levice device
tree structure.
Figure 4.43 Universal Serial Bus
A Serial port is used to connect the
processor to l/O devices that require transmission
Aata one bit at a time. The key feature of an of
interface circuit for a serial is that
capable of communicating in a bit-serial fashion on the port it is
device side and in a bit-paraliel
fashion on the bus side. The transformation between the
parallel and serial
is achieved with shift
registers that have parallel access capability. A block formats
of a typical serial interface is shown in
Figure
diagram
4.37. It includes the familiar DATAIN
and DATAOUT registers. The
input shift register accepts bit-serial input from the I/O
device. When all 8 bits of data have been
loaded in parallel into the DATAIN
received, the contents of this shift register are
register. Similarly, output data in the DATAOUT
register are loaded into the output shift register, from which the bits are shifted out and
sent to the /O device.
The part of the interface that deals with the bus is the
same as in the parallel interface
described earlier. The status flags SIN and SOUT serve similar functions. The SIN lag
1S set to I
when new data are loaded in DATAIN; it is cleared to 0 when the
reads the contents of DATAIN. As soon as the data processor
are transferred from the
input shift
Tegister into the DATAIN register, the shift
register can start accepting the next 8-bit
Cnaracter from the I/O device. The SOUT flag indicates whether the output buffer is
1 D l e . lt is cleared to ) when the
processor writes new data into the DATAOUT
INPUT/OTP
CHAPTER
258
Input shift register
Seul
joput
DATAIN
D7
DO
DATAOUT
My-address
RSI
RSO Chip and
Serial
register Output shift register
R/W select output
Ready
Accept
Receiving clock
Status
INTR and
Contro!
Transmission clock
register and set to 1 when data are transferred from DATAOUT into the output S
register.
T h e double buffering used in the input and output paths is importantA Simpc
nterface could be
and
implemented by turning DATAIN and DATAOUT into shift registers
eliminating the shift registers in Figure 4.37. However, this would ward
restrictions on the
operation of the 1/O deviceafter receiving one character imposeathe
Serial iine, the device cannot
start receiving the next
d reads
intertaac
4.7 STANDARD VO INTERFACES
10-bit
address 32-t0-1 R/W
output muliplexer
md
CSS
nput demuhiplexer
S-bit colunin
address
Data
input/output
Azo Azo
Sense/Write circuis]-R/W
. .
Column
address latch Column decoder
D D
circuits.
OR
6. a. Explain thefollowing: (08 Marks)
ii) Virtual memory organization.
i) lit Rate and Miss penalty data in 7 cache is cailed a hit. The number of hits