COUPDATED
COUPDATED
COUPDATED
2 What is direct memory transfer? Give an overview and the block diagram of a DMA controller
6. What is Multiprocessor? Explain various methods of interconnection among two or more processor and shared
memory.(Interconnection structures for multiprocessor systems)
Give an overview of the basic functional units and bus structures of a computer?
Discuss various computer types with their applications in real world environment
Convert the following binary number to their equivalent decimal and hexadecimal (base 16) representation. i)
101101.0101 ii) 1010.0111 iii) 10.01
UNIT-II
Explain about sequential and combinational circuits with 2 examples from each.
Consider C=A+B, Explain different ways of writing this instruction with respect to number of addresses used.
Distinguish between fixed point representation and floating point representation with examples.
UNIT 3: THE INPUT-OUTPUT ORGANIZATION.
4. List the functionalities of I/O interface. Draw and explain a combined input/output interface circuit?
NOTE: Some questions have similar answers. For clarification refer notes.
ADDITIONAL NOTES:
CACHE MEMORY:
Cache Mapping
There are three different types of mapping used for the purpose of cache memory which
is as follows:
Direct Mapping
Associative Mapping
Set-Associative Mapping
1. Direct Mapping
The simplest technique, known as direct mapping, maps each block of main memory into
only one possible cache line. or In Direct mapping, assign each memory block to a
specific line in the cache. If a line is previously taken up by a memory block when a new
block needs to be loaded, the old block is trashed. An address space is split into two
parts index field and a tag field. The cache is used to store the tag field whereas the rest
is stored in the main memory. Direct mapping`s performance is directly proportional to
the Hit ratio.
i = j modulo m
where
i = cache line number
j = main memory block number
m = number of lines in the cache
Direct Mapping
For purposes of cache access, each main memory address can be viewed as consisting
of three fields. The least significant w bits identify a unique word or byte within a block of
main memory. In most contemporary machines, the address is at the byte level. The
remaining s bits specify one of the 2 s blocks of main memory. The cache logic interprets
these s bits as a tag of s-r bits (the most significant portion) and a line field of r bits. This
latter field identifies one of the m=2 r lines of the cache. Line offset is index bits in the
direct mapping.
2. Associative Mapping
In this type of mapping, associative memory is used to store the content and addresses
of the memory word. Any block can go into any line of the cache. This means that the
word id bits are used to identify which word in the block is needed, but the tag becomes
all of the remaining bits. This enables the placement of any word at any place in the
cache memory. It is considered to be the fastest and most flexible mapping form. In
associative mapping, the index bits are zero.
Associative Mapping – Structure
3. Set-Associative Mapping
This form of mapping is an enhanced form of direct mapping where the drawbacks of
direct mapping are removed. Set associative addresses the problem of possible
thrashing in the direct mapping method. It does this by saying that instead of having
exactly one line that a block can map to in the cache, we will group a few lines together
creating a set . Then a block in memory can map to any one of the lines of a specific set.
Set-associative mapping allows each word that is present in the cache can have two or
more words in the main memory for the same index address. Set associative cache
mapping combines the best of direct and associative cache mapping techniques. In set
associative mapping the index bits are given by the set offset bits. In this case, the cache
consists of a number of sets, each of which consists of a number of lines.
Set-Associative Mapping
Relationships in the Set-Associative Mapping can be defined as:
m = v * k
i= j mod v
where
i = cache set number
j = main memory block number
v = number of sets
m = number of lines in the cache number of sets
k = number of lines in each set
Consider a slightly larger memory unit that has 1K (1024) memory cells…
128 x 8 memory chips:If it is organised as a 128 x 8 memory chips, then it has got 128
memory words of size 8 bits. So the size of data bus is 8 bits and the size of address bus
is 7 bits (2^7=128). The storage organization of 128 x 8 memory chip is shown in the
figure 3.6.
Therefore, the size of data bus is 1 bit and the size of address bus is 10 bits
(2^10=1024).
A particular memory location is identified by the contents of memory address bus. A
decoder is used to decode the memory address. There are two ways of decoding of a
memory address depending upon the organization of the memory module.
In one case, each memory word is organized in a row. In this case whole memory
address bus is used together to decode the address of the specified location.
UNIT3
SYLLABUS:
Input/Output Organization: Accessing I/O devices, Interrupts,
Processor examples, Direct Memory Access(DMA) , Buses,
Interface circuits, and Standard I/O interfaces.
I/O Interface (Interrupt and DMA Mode)
The method that is used to transfer information between internal storage and external I/O
devices is known as I/O interface. The CPU is interfaced using special communication links by the
peripherals connected to any computer system. These communication links are used to resolve
the differences between CPU and peripheral. There exists special hardware components
between CPU and peripherals to supervise and synchronize all the input and output transfers
that are called interface units.
2. Processor Communication
3. Signal Control
It generates and manages control and timing signals needed for data
transfer, ensuring smooth communication between the CPU and
peripherals.
4. Data Buffering
5. Error Detection
The interface can detect errors in data transmission, ensuring that errors
are flagged and corrected before they affect system performance.
6. Data Conversion
The interface reports the current status of the peripheral device to the
processor.
INPUT-OUTPUT-Modes of Transfer:
The binary information that is received from an external device is usually stored in the
memory unit. The information that is transferred from the CPU to the external device is
originated from the memory unit. CPU merely processes the information but the source
and target is always the memory unit. Data transfer between CPU and the I/O devices
may be done in different modes. Data transfer to and from the peripherals may be
done in any of the three possible ways(TYPES OF INPUT-OUTPUT INTERFACES)
Programmed I/O.
Interrupt- initiated I/O.
Direct memory access( DMA).
Programmed I/O(PIO): It is due to the result of the I/O instructions that are written in
the computer program. Each data item transfer is initiated by an instruction in the
program. Usually the transfer is from a CPU register and memory. In this case it
requires constant monitoring by the CPU of the peripheral devices.
Example of Programmed I/O: In this case, the I/O device does not have direct access
to the memory unit. A transfer from I/O device to memory requires the execution of
several instructions by the CPU, including an input instruction to transfer the data from
device to the CPU and store instruction to transfer the data from CPU to memory. In
programmed I/O, the CPU stays in the program loop until the I/O unit indicates that it is
ready for data transfer. This is a time consuming process since it needlessly keeps the
CPU busy. This situation can be avoided by using an interrupt facility. This is discussed
below.
Interrupt- initiated I/O: Since in the above case we saw the CPU is kept busy
unnecessarily. This situation can very well be avoided by using an interrupt driven
method for data transfer. By using interrupt facility and special commands to inform the
interface to issue an interrupt request signal whenever data is available from any
device. In the meantime the CPU can proceed for any other program execution. The
interface meanwhile keeps monitoring the device. Whenever it is determined that the
device is ready for data transfer it initiates an interrupt request signal to the computer.
Upon detection of an external interrupt signal the CPU stops momentarily the task that
it was already performing, branches to the service program to process the I/O transfer,
and then return to the task it was originally performing.
The I/O transfer rate is limited by the speed with which the processor can test and
service a device.
The processor is tied up in managing an I/O transfer; a number of instructions must be
executed for each I/O transfer.
Terms:
Vectored interrupts: These interrupts are associated with the static vector address.
Non-vectored interrupts: These interrupts are associated with the dynamic vector
address.
Internal interrupts: These devices are generated by the internal components of the
processor such as power failure, error instruction, temperature sensor, etc.
Synchronous interrupts: These interrupts are controlled by the fixed time interval. All
the interval interrupts are called as synchronous interrupts.
Direct Memory Access : The data transfer between a fast storage media such as
magnetic disk and memory unit is limited by the speed of the CPU. Thus we can allow
the peripherals directly communicate with each other using the memory buses,
removing the intervention of the CPU. This type of data transfer technique is known as
DMA or direct memory access. During DMA the CPU is idle and it has no control over
the memory buses. The DMA controller takes over the buses to manage the transfer
directly between the I/O devices and the memory unit.
The Input-Output bus and interface modules play a crucial role in facilitating communication between the CPU
and external devices. The I/O bus connects all the I/O devices to the system, while the interface modules act
as translators between the CPU’s internal bus and the external devices. Let us see each component in detail .
The I/O bus consists of three primary buses: data bus, address bus, and control bus.
The data bus carries the actual data being transferred between the processor and peripherals.
The address bus allows the processor to select a specific peripheral device connected to the
I/O bus.
The control bus provides control signals for managing data transfer, such as read/write,
start/stop, and error detection.
Direct Memory Access (DMA) uses hardware for accessing the memory, that hardware
is called a DMA Controller. It has the work of transferring the data between Input Output
devices and main memory with very less interaction with the processor. The direct
Memory Access Controller is a control unit, which has the work of transferring data.
Address register – It contains the address to specify the desired location in memory.
Word count register – It contains the number of words to be transferred.
Control register – It specifies the transfer mode.
Note: All registers in the DMA appear to the CPU as I/O interface registers. Therefore,
the CPU can both read and write into the DMA registers under program control via the
data bus.
The figure below shows the block diagram of the DMA controller. The unit communicates
with the CPU through the data bus and control lines. Through the use of the address bus
and allowing the DMA and RS register to select inputs, the register within the DMA is
chosen by the CPU. RD and WR are two-way inputs. When BG (bus grant) input is 0, the
CPU can communicate with DMA registers. When BG (bus grant) input is 1, the CPU
has relinquished the buses and DMA can communicate directly with the memory.
Working Diagram of DMA Controller
Cons of DMA
Interface Circuits
An I/O interface consists of the circuitry required to connect an I/O device to a computer bus. On one side of the
interface, we have bus signals. On the other side, we have a data path with its associated controls to transfer data
between the interface and the I/O device – port.
Parallel port
A parallel port transfers data in the form of a number of bits (8 or 16) simultaneously to or from the device. A serial port
transmits and receives data one bit at a time. Communication with the bus is the same for both formats. The conversion
from the parallel to the serial format, and vice versa, takes place inside the interface circuit. In parallel port, the
connection between the device and the computer uses a multiple-pin connector and a cable with as many wires. This
arrangement is suitable for devices that are physically close to the computer. In serial port, it is much more convenient
and cost-effective where longer cables are needed.
• Contains status flags that can be accessed by the processor to determine whether the buffer is full or empty
• Generates the appropriate timing signals required by the bus control scheme
• Performs any format conversion that may be necessary to transfer data between the bus and the I/O device, such as
parallel-serial conversion in the case of a serial port.
Parallel Port
The hardware components needed for connecting a keyboard to a processor Consider the circuit of input interface
which encompasses (as shown in below figure):
–R/~W
–Master-ready
–Address decoder
Now, consider the circuit for the status flag (figure 4.30). An edge-triggered D flip-flop is used along with read-data and
master-ready signals
The hardware components needed for connecting a printer to a processor are: the circuit of output interface, and
–Slave-ready
–R/~W
–Master-ready
–Address decoder
–Handshake control
The input and output interfaces can be combined into a single interface. The general purpose parallel interface circuit
that can be configured in a variety of ways. For increased flexibility, the circuit makes it possible for some lines to serve
as inputs and some lines to serve as outputs, under program control.
Serial Port
A serial interface circuit involves – Chip and register select, Status and control, Output shift register, DATAOUT, DATAIN,
Input shift register and Serial input/output
Standard I/O interfaces
Consider a computer system using different interface standards. Let us look in to Processor bus and Peripheral
Component Interconnect (PCI) bus. These two buses are interconnected by a circuit called bridge. It is a bridge between
processor bus and PCI bus.
Data tansfer:-
The PCI bus is designed primarily to support a brust of data than just one word.
A read or write operation involving a single word treated as a burst of length one.
A bus supports 3 independent address spaces:
->Memory
->I/O
->Configuration
Device Configuration:-
When an I/O device is connected to a computer, several actions are needed to configure both the
devices and software communities with it . A number of switches that have to be set by user to select
certain options. Once the device is connected the software needs to know the address of the device .
It should know other characteristics as
speed
transmission link
whether parity bits are used and so on.
It was developed by several communication companies like compaq , hewlett packard, Intel Microsoft etc.
The USB supports 2 speeds of connection:-
-> Low speed (1.5 megabits/ second)
->Full speed (12 megabits/ second)
The most recent version of the bus (USB 2.0) introduced a 3rd speed of operation called high speed (480
megabits/second)
The USB is designed to meet Several key objectives:
->It provides a simple , low cost , and easy to the interconnection system that overcomes
the difficulties due to the limited number of I/O ports available on a computer.
->Accommodates a wide range of data transfer characteristics for I/O devices, including
telephone and internet connection.
->Enhance user convenience through a plug and play mode of operation.