Nothing Special   »   [go: up one dir, main page]

And Demerits of Both.: Q-1 Differentiate Between Isolated Input and Memory-Mapped Input-Output. Discuss The Merits

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Q-1 Differentiate between isolated input and memory-mapped input-output.

Discuss the merits


and Demerits of both.

S.no ISOLATED I/O MEMORY MAPPED I/O

1 Memory and I/O have separate address space Both have the same address
space

2 All address can be used by the memory Due to the addition of I/O
addressable memory become
less for memory

3 Separate instruction control read and write operation Same instructions can control
in I/O and Memory both I/O and Memory

4 In this, I/O address are called ports Normal memory addresses


are for both.

5 More efficient due to separate buses Lesser efficient

6 Larger in size due to more buses Smaller in size

7 It is complex due to separate -separate logic is used Simpler logic is used as I/O is
to control both. also treated as memory only.

Now we shall discuss about merits of I/O mapped I/O and demerits of
memory-mapped I/O −
● We use the instructions IN and OUT for the addressing of input-output mapped input-
output ports. The mnemonics of these instructions indicate that the processor is in the
process of communication with the Input-Output port. For loading the accumulator from
memory-mapped input port with address FFF0H we execute the instructions LDA
FFF0H.
● There are some microprocessors which consists of a control pin for the selection of
memory location or an Input-Output port. As an example to be cited as in the 8085
processor, the pin IO/M* is used for the selection of an Input-Output port or a memory
location.
● 256 locations are allocated for the address space of the Input-Output port since they are
only of the size of 8 bits. The address space of memory consists of 64K locations as the
addresses of the memory are of length 16 bits.
● If we address the Input-Output ports as the memory-mapped Input Output ports with the
addresses ranging from FF00H-FFF0H then these address ranges should not be allotted
for any memory chip.
Q2. Which of the following constitute a control, status or data transfer commands.
a. Skip next instruction: it is a status command as it checks the status of the flag bit.
b. Seek a given record on magnetic disk: it is a control command as it moves the magnetic
head in the desk.
c. Mover printer paper to the beginning of the next page: Status command as it checks if
device power is on.
d. Read interface status register: Control command as it Moves paper position.
e. Check if the I/O device is ready: Data input command as it Reads value of a register.

Q3. Why read and write control lines in DMA controller bidirectional ? under what conditions
and for what purpose are they used as inputs as well as outputs?

Ans: When the CPU communicates with the DMA controller, the read and write lines are
used as inputs from the CPU to the DMA controller.
When the DMA controller communicates with memory the read and write lines are
used as outputs from the DMA to memory.

Q4. How many characters per second can be transmitted over a 1200 baud line in each of the
following modes-

a. Synchronous serial transmission: 1200/8 = 150 characters per second.


b. Asynchronous serial transmission with two stop bits :
1200/11 = 109 characters per second
c. Asynchronous serial transmission with one-stop bits: 1200/10 = 120 characters per
second
Q 5: DMA Controller transfers 16-bit words to memory using cycle stealing. The words are
assembled from a device that transmits character at a rate of 2400 characters per second. The
CPU is fetching and executing the instructions at an average rate of 1 MIPS. By how much will
the CPU be slowed down because of DMA transfer?

Solution - DMA controller transfers 32 bit(4 byte) words to memory(cycle stealing mode).
Device transmits 4800 characters per second (1 character = 1 byte)
So, for 1 byte it will take 1 / 4800 sec.
Since the controller transfers 4 bytes in cycle stealing mode, it will take
4 * (1 / 4800) = 1 / 1200 sec.
i.e. 1200 character will be transferred in cycle stealing mode and it is given that CPU is fetching
and executing instructions at an average rate of one million instructions per second.
slow down or cycle wasted % in DMA transfer = ( 1200 / 1000000) * 100
= 0.12 %

Q6: What are the advantages of interrupt initiated data transfer over transfer under program
control without an interrupt?

Solution- In programmed I/O, the processor is literally responsible for everything. When an I/O
instruction comes, the processor sends the control data via a data bus to the control register of the
I/O module. (Modules and controllers must be present for each peripheral). It then literally waits
for the module to complete its transfer which is indicated by the status register on the module. So
this register is constantly examined by the processor and thus the processor is not allowed to
perform any other task.
However in interrupt I/O, the processor becomes free after having sent the control bits. After
having performed the I/O operation by module, it sends an interrupt to the processor to let it
know. And then the processor handles it.

The main advantage is reduced latency. The processor has to temporarily halt it's work in
programmed I/O, whereas an interrupt I/O, the processor continues to perform and only halts
when the interrupt is received.

Another advantage: in programmed I/O, the system cannot be under two I/O transfers. Because
in programmed I/O, one transfer is completed and then the 2nd can start. But in interrupt I/O,
after having initiated the first transfer, the processor can start another one. The interrupts are then
handled on the basis of priority.

Q7: The size of the data count register of a DMA controller is 16 bits. The processor needs to
transfer a file of 29,154 kilobytes from disk to main memory. The memory is byte-addressable.
What is minimum number of times the DMA controller needs to get the control of the system
bus from the processor to transfer the file from the disk to the main memory?

Solution -
size of data count register of the DMA controller = 16 bits
Data that can be transferred in one go = 216 bytes = 64 kilobytes
File size to be transferred = 29154 kilobytes
So, number of times the DMA controller needs to get the control of the system bus from the
processor to transfer the file from the disk to main memory = ceil(29154/64) = 456

Q8: Why does DMA have priority over CPU, when both the request a memory transfers

Solution- we can transfer data directly to and from memory without the need for the CPU. The
transfer of data between a fast storage device such as magnetic disk and memory is often limited
by the speed of the CPU. Removing the CPU from the path and letting the peripheral device
manager the memory buses directly would improve the speed of transfer. This transfer technique
is called direct memory access(DMA). During DMA transfer, the CPU is idle and has no control
of the memory buses. A DMA controller takes over the buses to manage the transfer directly
between the I/O device and memory.

You might also like