Professional Documents
Culture Documents
Computer Organization: Prepared by Asst. Prof. Sherin Thomas ECE Dept. MBITS, Nellimattam
Computer Organization: Prepared by Asst. Prof. Sherin Thomas ECE Dept. MBITS, Nellimattam
Module V
Prepared By
Asst. Prof. Sherin Thomas
ECE Dept.
MBITS, Nellimattam
Interrupt Initiated I/O
• Interrupt is a hardware signal to the processor from I/O devices
through one of the control line called interrupt-request line.
4 methods:
1. Polling
• When a device raises an interrupt IRQ bit in Status Register set to1.
• ie, The processor should reads the status registers of each I/O device
associated.
• the first devices which set the IRQ bit is served first which is called polling.
• One of the main disadvantage of polling is always checking the IRQ bit for all
the devices which do not request any interrupt.
2. Vectored Interrupt
• This enables the processor to identify individual devices even if they share a
single interrupt-request line.
3. Interrupt Nesting
To implement this scheme, priority level can be assigned to the processor that can be changed by the
program.
Interrupt requests received over these lines are sent to a priority arbitration circuit in the processor.
A request is accepted only if it has a higher priority level than that currently assigned to the processor.
4. Simultaneous request
What is Bridge?
• Allows transfer of a block of data directly between an external device and the main memory, without continuous intervention by the
processor.
• DMA transfers are performed by a control circuit that is part of the I/O device interface called DMA controller.
• Its operation must be under the control of a program executed by the processor.
• To initiate the transfer of a block of words, the processor sends the starting address, the number of words in the block, and the direction of the transfer.
• On receiving this information, the DMA controller proceeds to perform the requested operation.
• When the entire block has been transferred, the controller informs the processor by raising an interrupt signal.
DMA controller registers that are accessed by the processor to initiate transfer operations.
Two registers are used for storing the starting address and the word count
Done Flag = 1 means DMA Controller completes its data transfer and is ready to receive another command.
R/W =0 means it’s a write operation, otherwise it’s a read operation.
When IE[Interrupt Enable] is set to 1, it causes the controller to raise an interrupt after it has completed transferring a block of data.
Finally, the controller sets the IRQ bit to 1 when it has requested an interrupt.
Cycle stealing:
Requests by DMA devices for using the bus are always given higher priority than processor requests.
Among different DMA devices, top priority is given to high-speed peripherals such as a disk, a high-speed network interface, or a graphics display device.
Since the processor originates most memory access cycles, the DMA controller can be said to "steal" memory cycles from the processor.
Hence, this interweaving technique is usually called cycle stealing.
Burst Mode
Alternatively, the DMA controller may be given exclusive access to the main memory to transfer a block of data without interruption.
This is known as block or burst mode.
Standard I/O interfaces
This data path have its controls to transfer data
between Interface and IO device called Port.
Data path
The PCI bus is designed primarily to support burst mode data transfer ie, data are
transferred in blocks than a single word.
•The addressed device that responds to read and write commands is called a target.
The main bus signals used for transferring data are listed in the following table.
Signals whose name ends with the symbol # are asserted when in the low- voltage state.
The main difference between the PCI protocol with others is that in addition to a Target-ready signal, PCI also
uses an Initiator ready signal, IRDY #.
Example:
Consider a bus transaction in which the processor reads four 32-bit words from the memory.
•In this case, the initiator is the processor and the target is the memory.
•A complete transfer operation on the bus, involving an address and a burst of data, is
called a transaction.
A clock signal provides the timing reference used to coordinate different phases of a transaction.
All signal transitions are triggered by the rising edge of the clock.
Read Operation on the PCI Bus
SCSI Bus [SCSI stands for Small Computer System Interface]
It refers to a standard bus defined by the American National Standards Institute (ANSI) under the designation X3.131.
Devices connected to the SCSI bus are not part of the address space of the processor in the same way as devices
connected to the processor bus.
The SCSI bus is connected to the PCI bus through a SCSI controller.
This controller uses DMA to transfer data packets from the main
memory to the device, or vice versa.
A controller connected to a SCSI bus is one of two types - an
initiator or a target.
An initiator(SCSI controller) has the ability to select a particular
target and to send commands specifying the operations to be
performed.
The disk controller operates as a target. It carries out the commands
it receives from the initiator.
The processor sends a command to the SCSI controller, which causes the following sequence of events to
take place:
Initiator --- SCSI Controller Target ----- Disk Controller
1. The SCSI controller, acting as an initiator, contends for control of the bus.
2. When the initiator wins the arbitration process, it selects the target controller and hands over control of the bus to it.
3. The target starts an output operation; in response to this, the initiator sends a command specifying the required read
operation.
4. The target, realizing that it first needs to perform a disk seek operation, sends a message to the
initiator indicating that it will temporarily suspend the connection between them. Then it releases
the bus.
5. The target controller sends a command to the disk drive to move the read head
to the first sector involved in the requested read operation. Then, it reads the data
stored in that sector and stores them in a data buffer.
When it is ready to begin transferring data to the initiator, the target requests
control of the bus. After it wins arbitration, it reselects the initiator controller, thus
restoring the suspended connection.
6. The target transfers the contents of the data buffer to the initiator and then suspends the connection again. Data are
transferred either 8 or 16 bits in parallel, depending on the width of the bus.
7. The target controller sends a command to the disk drive to perform another seek operation. Then, it transfers the
contents of the second disk sector to the initiator, as before. At the end of this transfer, the logical connection between
the two controllers is terminated.
8. As the initiator controller receives the data, it stores them into the main memory using the DMA approach.
9. The SCSI controller sends an interrupt to the processor to inform it that the requested operation has been completed.
Universal Serial Bus (USB)
Universal Serial Bus (USB) is an industry standard developed through a collaborative effort of several computer and
communications companies, including Compaq, Hewlett-Packard, Intel, Lucent, Microsoft, Nortel Networks, and Philips.
USB is simple, low cost mechanism to connect devices like keyboards, microphones, cameras, speakers etc. to the computer.
The USB supports two speeds of operation, called low-speed (1.5 megabits/s) and full speed (12 megabits/s).
The most recent revision of the bus specification (USB 2.0) introduced a third speed of operation, called high-speed (480
megabits/s).
USB Architecture:
To accommodate a large number of devices that can be added
or removed at any time, the USB has the tree structure as
shown in the Figure.
Each node of the tree has a device called a hub, which acts as
an intermediate control point between the host and the I/O
devices.
A root hub connects the entire tree to the host computer.
This is responsible for all the transactions. It acts as the controller.
The leaves of the tree are the I/O devices being served (for
example, keyboard, speaker, or digital TV), which are called
functions in USB terminology
USB Protocols:
All information transferred over the USB is organized in packets, where a packet consists of one or more bytes of
information.
The information transferred on the USB can be divided into two broad categories:
1. Control Packet
Control packets perform tasks such as addressing a device to initiate data transfer, acknowledging that data have been
received correctly, or indicating an error.
Packet Fields
The first field of any packet is called the packet identifier, PID, which identifies the type of that packet.
There are four bits of information in this field, but they are transmitted twice. The first time they are sent with their true
values, and the second time with each bit complemented, as shown in Figure (a). This enables the receiving device to
verify that the PID byte has been received correctly.
All information transferred over the USB is organized in packets, where a packet consists of one or more bytes of
information.
Packet Transmission
The hub verifies that the transmission has been error free by
checking the error control bits, and then sends an
acknowledgment packet (ACK) back to the host.
The hub forwards the token and data packets downstream. All
I/O devices receive this sequence of packets, but only the
device that recognizes its address in the token packet accepts
the data in the packet that follows.
Cache
•The next level of hierarchy is processor cache, holds copies of instructions and
data stored in much larger memory that is provided externally.
•If the processor requests data that is available in the cache, it is returned quickly.
This is called a cache hit.
•Otherwise, the processor retrieves the data from main memory. This is called a
cache miss.
• If the cache hits most of the time, then the processor seldom has to wait for the
slow main memory, and the average access time is low..
Main Memory
•The next level in the hierarchy is called the main memory.
•The main memory is much larger but significantly slower than the cache
memory.
•The access time for the main memory is about ten times longer than the
access time for the cache.
Hard Disk, Or Hard Drive
•The third level in the memory hierarchy is the hard disk, or hard drive.
•Computer systems use the hard disk to store data that does not fit in main
memory.
•The hard disk provides an illusion of more capacity than actually exists in the
main memory. It is thus called virtual memory
•Disk drives provide a huge amount of inexpensive storage. They are very slow
compared to the semiconductor devices used to implement the main memory
MEMORY HIERARCHY INCLUDING
DIFFERENT LEVELS OF CACHE
MEMORY CHARACTERISTICS
Other Characteristics
MEMORY SYSTEM PERFORMANCE ANALYSIS
•Memory system performance metrics are
miss rate or hit rate and average memory access time.
It is the average time a processor must wait for memory per load or store
instruction. In the typical computer system the processor first looks for the data
in the cache. If the cache misses, the processor then looks in main memory. If
the main memory misses, the processor accesses virtual memory on the hard
disk. Thus, AMAT is calculated as
SEMICONDUCTOR MEMORIES
2. It is volatile.
A RAM must be provided with a constant power supply.
If the power is interrupted, then the data are lost.
Thus, RAM can be used only as temporary storage.
The two traditional forms of RAM used in computers are DRAM and SRAM.
Static Random Access Memory (SRAM)
When the word line is at ground level, the transistors are turned
off and a latch retains its state.
Wordline
Let us assume that the cell is in state 1 if the logic value at point X is 1 and at point Y is 0. This state is maintained as long as
the signal on the word line is at ground level.
Read Operation
•In order to read the state of the SRAM cell, the
word line is activated to close switches T1 and
T2.
Word line = 1, access transistors are ON.
•If the cell is in state 1, the signal on bit line
b is high and the signal on bit line b‘ is low.
The opposite is true if the cell is in state 0.
Thus, b and b‘are compliments of each other.
•Sense/Write circuits at the end of the bit lines monitor the state of b and b‘ and
set the output accordingly. It compares the difference between bit b and bit b’.
• if bit b > b’, output is 1
• if bit b < b’, output is 0
Write operation
SRAMs are fast but costly. Less expensive RAM can built using capacitors called DRAM
Such cells do not retain their state indefinitely; hence they are called dynamic RAMs
Since the cell is required to store information for a much longer time, its
contents must be periodically refreshed by restoring the capacitor charge to
its full value.
A single transistor dynamic cell is shown in the figure given below
It consists of a capacitor C, and a transistor T. Hence the information stored in the cell
can be retrieved correctly only if it is read before the charge on the capacitor drops
below some threshold values.
Dram Operation
•Make the Word line active when bit read or written
•Transistor switch closed (current flows)
Read Operation
•During a read operation the transistor in a selected
cell is turned on.
Figure shows the dot notation for a 4-word into 3-bit ROM containing the data
A programmable ROM [PROM]
•A programmable ROM places a transistor in every bit cell but provides a way to
connect or disconnect the transistor to ground.
•Some ROM designs allow the data to be loaded by the user, thus providing a
programmable ROM (PROM). Programmability is achieved by inserting a fuse
at point P in the above Figure.
•The user programs the ROM by
applying a high voltage across the
bitline to selectively blow fuses.
Memory arrays are built as an array of bit cells, each of which stores 1 bit
of data.
Figure shows that each bit cell is connected to a wordline and a bitline.
For each combination of address bits, the memory asserts a single wordline that
activates the bit cells in that row.
When the wordline is HIGH, the stored bit transfers to or from the bitline.
Write Operation:
During a Write operation, the Sense/Write circuits receive input information from the
bidirectional data lines and store it in the cells of the selected word.