9 Input Output And Data Transfer

Microprocessor and Computer Architecture · Unit 9

Input Output and Data Transfer

Exam-focused notes for Input Output and Data Transfer (Microprocessor and Computer Architecture, BIT151): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.

Input Output and Data Transfer in short

The CPU must talk to devices such as keyboards, displays and disks. These devices differ greatly in speed and data format. This chapter explains the interface that joins them, the ways to address devices, and direct memory access (DMA).

Input Output and Data Transfer: notes

I/O interface functions

An I/O interface is a circuit placed between the CPU and a peripheral device. It makes the two work together despite their differences.

Main functions:

  • Device selection: decode the address from the CPU to choose one device.
  • Data buffering: hold data temporarily, because the CPU and the device run at different speeds.
  • Control and timing: pass commands, such as start or stop, and coordinate the transfer.
  • Status reporting: tell the CPU whether the device is ready, busy or in error.
  • Data conversion: change between serial and parallel form, or between voltage levels.
  • Error detection: check data with methods such as parity.
  • Interrupt generation: signal the CPU when the device needs service.

Isolated I/O and memory mapped I/O

There are two ways to give addresses to I/O devices.

Isolated I/O (I/O mapped I/O). Memory and I/O have separate address spaces. Separate instructions and a control signal tell them apart.

  • In the 8085, the instructions are IN port and OUT port. The port address is 8 bits, so there are 256 input and 256 output ports.
  • The signal $IO/\overline{M}$ is high for I/O and low for memory.

Memory mapped I/O. Each device is given an address from the memory space. The CPU uses ordinary memory instructions to reach it.

  • In the 8085, instructions such as LDA, STA, MOV A,M and MOV M,A can read and write devices.
  • The signal $IO/\overline{M}$ is low, as in a normal memory access.

What this unit covers

  • I/O interface functions
  • Isolated I/O and memory mapped I/O
  • Advantages and disadvantages of I/O methods
  • Direct Memory Access (DMA) process
  • DMA controller role and operation

DMA controller role and operation

2082 · 5 marks

Explain the role of DMA controller in DMA operation. [5]

Direct Memory Access (DMA) is a technique that allows I/O devices to transfer data directly to/from main memory without involving the CPU for each byte/word of the transfer. The component that manages this process is the DMA Controller. --- The DMA controller acts as a dedicated hardware unit tha...

Open this answer on its own page →

Isolated I/O and memory mapped I/O

2081 · 5 marks

Differentiate between I/O mapped (isolated) I/O and memory mapped I/O. [5]

--- - I/O devices are given a separate address space from memory. - Special I/O instructions (such as IN and OUT) are used to communicate with I/O devices. - The processor has separate control lines for memory and I/O operations (e.g., M/IO signal distinguishes between the two). - Since I/O and m...

Open this answer on its own page →

2080 · 5 marks

Explain the difference between isolated I/O and memory-mapped I/O? What are the advantages and disadvantages of each? [5]

Note: No specific curriculum notes were found for this topic. The following answer is based on standard computer organization and architecture principles, which are consistent with TU BSc CSIT syllabus. --- In isolated I/O, the I/O devices are given a separate address space from the memory. Speci...

Open this answer on its own page →

2079 · 5 marks

What is the difference between isolated 1/0 and memory-mapped I/0? What are the avantages and disadvantages of each? [5]

Note: No specific reference notes were found for this topic. The following answer is based on standard computer organization and architecture concepts, which align with the TU BSc CSIT curriculum. --- In isolated I/O, the I/O devices are given a separate address space from the memory. Special ins...

Open this answer on its own page →

Direct Memory Access

2081 · 5 marks

Write short notes on (any two): a) DMA b) Flags in 8085 Microprocessor c) Instruction set. [5]

Show solved answer

Short Notes (Any Two): 5 Marks


a) DMA (Direct Memory Access)

DMA is a technique that allows peripheral devices to transfer data directly to/from memory without involving the CPU for each byte of transfer.

Key Points:

  • Normally, the CPU handles all data transfers between I/O devices and memory, which wastes CPU time.
  • In DMA, a special hardware unit called the DMA Controller (DMAC) takes over the system bus temporarily.
  • The CPU sends the starting address, block size, and direction (read/write) to the DMAC, then releases the bus.
  • The DMAC performs the transfer and sends an interrupt to the CPU when done.

Steps in DMA Transfer:

  1. CPU initializes the DMAC (address, count, mode).
  2. DMAC sends a Bus Request (BR) to the CPU.
  3. CPU grants the bus via Bus Grant (BG) and suspends its activity.
  4. DMAC transfers data directly between memory and I/O device.
  5. After transfer, DMAC releases the bus and interrupts the CPU.

Advantages:

  • Very fast data transfer.
  • CPU is free to do other tasks.
  • Suitable for high-speed devices like disk drives, video cards.

b) Flags in 8085 Microprocessor

The 8085 microprocessor has a special 8-bit Flag Register (also called the Program Status Word) that reflects the result of arithmetic and logical operations.

The 8085 has 5 flags:

FlagSymbolDescription
Sign FlagSSet to 1 if result is negative (MSB = 1); else 0
Zero FlagZSet to 1 if result is zero; else 0
Auxiliary Carry FlagACSet to 1 if carry from bit 3 to bit 4 occurs (used in BCD operations)
Parity FlagPSet to 1 if result has even number of 1s; else 0
Carry FlagCYSet to 1 if there is a carry out from the MSB (bit 7)

Flag Register Bit Layout:

D7   D6   D5   D4   D3   D2   D1   D0
 S    Z    0   AC    0    P    1   CY

Importance:

  • Flags are used by conditional jump instructions (e.g., JZ, JNZ, JC, JNC) to control program flow.
  • They are automatically set or reset after arithmetic/logical operations.

c) Instruction Set

An instruction set (also called Instruction Set Architecture, ISA) is the complete collection of instructions that a processor can understand and execute.

Key Points:

  • It defines the interface between hardware and software.
  • Each instruction tells the CPU what operation to perform, on what data, and where to store the result.

Types of Instructions:

CategoryExamplesDescription
Data TransferMOV, MVI, LDA, STAMove data between registers/memory
ArithmeticADD, SUB, INR, DCRPerform arithmetic operations
LogicalANA, ORA, XRA, CMAPerform bitwise logical operations
Branch/ControlJMP, CALL, RET, JZControl flow of program
I/O and Machine ControlIN, OUT, HLT, NOPHandle I/O and CPU control

Instruction Format:

An instruction typically has:

  • Opcode: specifies the operation
  • Operand(s): specifies the data or address

Types of Instruction Sets:

  • RISC (Reduced Instruction Set Computer): fewer, simpler instructions (e.g., ARM)
  • CISC (Complex Instruction Set Computer): many complex instructions (e.g., x86, 8085)

Importance:

  • Determines the capability and performance of a processor.
  • Programmers and compilers use the instruction set to write programs.
Open this answer on its own page →

2080.1 · 5 marks

What is DMA? Explain the role of DMA controller in data transfer. [5]

Show solved answer

Direct Memory Access (DMA)

Definition

DMA (Direct Memory Access) is a memory access technique that allows I/O devices to transfer data directly to or from main memory without the continuous involvement of the CPU. The CPU only initiates the transfer; the actual data movement is handled by a dedicated hardware unit called the DMA Controller (DMAC).

Note: No specific curriculum notes were found for this topic; the answer is based on standard computer organization principles consistent with TU BSc CSIT syllabus.


Role of DMA Controller in Data Transfer

The DMA controller acts as an intermediary between the I/O device and main memory. Its role can be explained through the following steps:

Step-by-Step Operation

StepAction
1CPU receives an I/O request and initializes the DMA controller by providing: starting memory address, number of words to transfer, and direction (read/write).
2CPU issues the transfer command to the DMA controller and resumes its own tasks.
3DMA controller requests the system bus from the CPU using a signal called Bus Request (BR).
4CPU grants the bus by sending Bus Grant (BG) signal and temporarily suspends its bus activity (cycle stealing or burst mode).
5DMA controller takes control of the address bus, data bus, and control bus.
6DMA controller transfers data directly between the I/O device and memory, incrementing the memory address and decrementing the word count after each transfer.
7When the word count reaches zero, the DMA controller sends an interrupt signal to the CPU to indicate completion.
8CPU resumes normal operation and reclaims the bus.

Modes of DMA Transfer

  • Burst Mode: DMA transfers an entire block of data at once; CPU is halted during the entire transfer.
  • Cycle Stealing Mode: DMA steals one bus cycle at a time from the CPU; CPU is slowed but not halted.
  • Transparent Mode: DMA transfers data only when the CPU is not using the bus; slowest but no CPU interference.

Advantages of DMA

  • Frees the CPU from managing data transfer byte by byte.
  • Faster data transfer compared to programmed I/O or interrupt-driven I/O.
  • Suitable for high-speed devices like disk drives, graphics cards, and network interfaces.

Summary Diagram

CPU --> Initializes DMAC (address, count, direction)
DMAC --> Requests Bus --> CPU Grants Bus
DMAC --> Transfers Data (I/O Device <--> Memory)
DMAC --> Sends Interrupt to CPU on Completion
CPU --> Resumes Normal Work

In essence, the DMA controller offloads the data transfer task from the CPU, making the system more efficient by allowing the CPU and I/O operations to proceed concurrently.

Open this answer on its own page →

0 · 5 marks

What is DMA? Explain the basic DMA process. [5]

DMA (Direct Memory Access) is a technique that allows I/O devices to transfer data directly to or from main memory without the continuous involvement of the CPU. A special hardware unit called the DMA Controller manages this transfer, freeing the CPU to perform other tasks during the data transfe...

Open this answer on its own page →

I/O interface functions

2078 · 5 marks

What is the function of I/O interface? Differentiate between Isolated I/O and memory mapped I/O. [5]

An I/O Interface acts as a bridge between the CPU/memory system and the peripheral (I/O) devices. Its main functions are: 1. Data Buffering - Temporarily holds data to compensate for the speed difference between the fast CPU and slow I/O devices. 2. Signal Conversion - Converts signals between th...

Open this answer on its own page →