Skip to content
Unit 4 Syllabus Note· Computer Organization and Architecture

Computer Organization and Architecture

Comprehensive exam revision notes for BCA-207N Unit 4 (Input/Output Organization, Interfaces & Data Transfer Modes). Includes Section A (2M), Section B (5M), and Section C (15M) questions, answers, and diagrams.

Computer Organization and Architecture

Input/Output Organization, Interfaces & Data Transfer Modes

Core Definitions & Key Concepts

Why is an I/O Interface needed between the CPU and peripheral devices

An I/O Interface is required because:

  1. Speed Mismatch: Peripherals operate electromechanically or electronically at orders of magnitude slower speeds than high-speed CPU/RAM.
  2. Data Format Disparity: Peripherals use serial bitstreams or custom encodings, whereas the CPU operates on parallel words (32/64 bits).
  3. Signal Levels: Peripherals use differing voltage levels and control standards requiring level-shifting and buffering.

Isolated (Standard) I/O and Memory-Mapped I/O

FeatureIsolated (Port-Mapped) I/OMemory-Mapped I/O
Address SpaceSeparate address spaces for memory and I/O devices (e.g., IN, OUT instructions).Unified address space; I/O ports are mapped as standard memory addresses.
InstructionsSpecial I/O instructions required (IN, OUT in x86).Standard memory instructions (MOV, LOAD, STORE) access devices.
Memory CapacityEntire memory address space is available for RAM.Consumes part of the addressable memory space for I/O registers.

What is Asynchronous Data Transfer? List two common protocols

Asynchronous Data Transfer occurs when the transmitting and receiving units operate with separate, independent clock pulses. Two standard synchronization protocols are:

  1. Strobe Control: Single control line pulse initiating transfer.
  2. Handshaking: Two-way exchange of control signals (Request and Acknowledge).

Direct Memory Access (DMA)

Direct Memory Access (DMA) is a high-speed data transfer technique where a specialized hardware controller (DMA Controller) transfers entire blocks of data directly between an I/O device and main memory across the system bus without routing data through CPU registers, freeing the CPU for concurrent computation.

What is Cycle Stealing in DMA data transfer

In Cycle Stealing Mode, the DMA controller takes control of the system bus for exactly one bus cycle to transfer a single word, and then releases the bus back to the CPU. The CPU is paused for only one cycle, permitting interleaved execution.

What is an Interrupt Service Routine (ISR)

An ISR (Interrupt Handler) is a dedicated kernel subroutine executed in response to a specific hardware or software interrupt signal. The CPU pushes its PC and flags onto the stack, jumps to the ISR address indicated by the interrupt vector, services the device, and executes IRET to resume interrupted execution.

Conceptual & Architectural Analysis

The Handshaking Data Transfer Protocol for asynchronous communication with timing diagrams

Asynchronous Handshaking Data Transfer Protocol

Unlike simple strobe control (which provides zero feedback), Handshaking employs two separate control lines: Data Ready (from source) and Data Accepted (from destination), eliminating timing errors.

System Architecture / Concept DiagramHorizontal Scroll Enabled
Source-Initiated Handshaking Timing Sequence:

Bus Lines:          ==================[ Valid Data ]====================
                        |                                       |
Data Ready (Source):    +---------------------------------------+
                                |                       |
Data Accepted (Dest):           +-----------------------+
                                        |

Step-by-Step Handshake Cycle:

  1. Source Places Data: Source unit places data onto data bus lines and asserts Data Ready signal high.
  2. Destination Receives: Destination detects Data Ready, reads data from bus lines, and asserts Data Accepted signal high.
  3. Source Acknowledges: Source detects Data Accepted and lowers Data Ready signal, indicating it knows data was received.
  4. Destination Completes: Destination lowers Data Accepted, restoring the system to idle state ready for the next word.

Fault-Tolerance: If either unit crashes or delays, the handshake pauses safely without dropping bytes.

Compare the three Modes of Data Transfer: Programmed I/O, Interrupt-Initiated I/O, and Direct Memory Access (DMA)

Modes of Computer Data Transfer

FeatureProgrammed I/OInterrupt-Initiated I/ODirect Memory Access (DMA)
CPU InvolvementContinuous polling loop. CPU sits in busy-wait checking status flag.CPU executes background code until alerted by interrupt signal.CPU merely initializes DMAC (source, dest, word count); zero involvement during block transfer.
Transfer RateVery slow; limited by CPU instruction cycle loop.Moderate; overhead of saving registers and executing ISR per byte.Blisteringly fast; limited strictly by memory bus bandwidth.
Hardware ComplexityMinimal; zero interrupt hardware required.Moderate; requires priority encoder and interrupt controllers.High; requires dedicated DMA Controller and bus arbitration logic.
Best ApplicationSimple embedded keyboard polling.Infrequent, bursty inputs (mouse clicks, serial port).High-speed block devices (NVMe SSDs, Gigabit Ethernet, GPU framebuffers).

The Daisy-Chaining Priority Interrupt architecture with a neat circuit diagram

Daisy-Chaining Priority Interrupt Architecture

Daisy-chaining is a hardware serial priority arbitration scheme where devices requesting interrupts are chained together in priority order (Device 1 highest, Device N lowest).

System Architecture / Concept DiagramHorizontal Scroll Enabled
   +-----------+          Interrupt Request (INTR)
   |           |<--------------------------------------------------+
   |    CPU    |                                                   |
   |           |---> Interrupt Acknowledge (INTA)                  |
   +-----------+         |                                         |
                         v                                         |
                   +-----------+                             +-----------+
                   | Device 1  | (PI PO)               (PI PO| Device N  |
                   | (Highest) |---------> ... ------------->| (Lowest)  |
                   +-----------+                             +-----------+
                         |                                         |
                         +------------ VAD to Bus -----------------+

Working Principle:

  1. When any device needs service, it pulls the common open-collector INTR line low.
  2. CPU completes current instruction and emits an INTA (Interrupt Acknowledge) pulse into Device 1's Priority-In (PI) pin.
  3. If Device 1 requested interrupt: It intercepts the signal (sets PO = 0) and places its Vector Address (VAD) directly onto the data bus for the CPU.
  4. If Device 1 did not request interrupt: It passes the acknowledge pulse through its Priority-Out (PO) line to Device 2 (PO = 1), which continues down the chain.

In-Depth Analysis & Implementation

Direct Memory Access (DMA) in comprehensive detail. Describe the internal block diagram of a DMA Controller (DMAC), its register structure, bus request/grant arbitration, and compare Burst Transfer vs Cycle Stealing modes

Comprehensive Architecture of Direct Memory Access (DMA)

DMA bypasses the CPU for bulk data transfers between high-speed secondary peripherals and main memory.

System Architecture / Concept DiagramHorizontal Scroll Enabled
       +-------------------------------------------------------+
       |                  System Data Bus                      |
       +-------------------------------------------------------+
           ^                     ^                         ^
           |                     |                         |
       +-------+             +--------+               +----------+
       |  CPU  |<== BR, BG ==|  DMAC  |<== DREQ, DACK | Disk/Net |
       +-------+             +--------+               +----------+
           |                     |                         |
       +-------------------------------------------------------+
       |                  System Address Bus                   |
       +-------------------------------------------------------+

1. Internal Registers of the DMA Controller

  1. Address Register (MAR): Holds the starting physical memory address where data is to be written or read. Automatically increments after every transferred word.
  2. Word Count Register (WCR): Initialized with the total number of words to transfer. Automatically decrements after each transfer. When WCR reaches 0, DMAC raises a terminal count interrupt.
  3. Control / Status Register: Configures transfer direction (Memory-to-I/O or I/O-to-Memory), mode (Burst/Steal), and reports transfer status.

2. Step-by-Step DMA Transfer Sequence:

  1. CPU Setup: The CPU driver writes starting address to MAR, block size to WCR, and initiates the device. The CPU then continues executing unrelated user threads.
  2. DMA Request (DREQ): When peripheral has data ready, it asserts DREQ to the DMAC.
  3. Bus Request (BR): The DMAC asserts BR (Bus Request) to the CPU.
  4. Bus Grant (BG): The CPU finishes its current bus cycle, floats its address/data buses to High-Z, and asserts BG (Bus Grant) back to DMAC.
  5. Direct Data Flow: The DMAC places memory addresses onto the address bus and pulses DACK and I/O Read / Memory Write lines. Data words flow directly from device to RAM at hardware bus speed.
  6. Interrupt on Completion: When WCR = 0, DMAC releases the bus back to the CPU and emits an interrupt alerting the OS that the block transfer is complete.

3. Comparison of DMA Transfer Modes:

  • Burst Mode (Block Transfer): The DMAC retains control of the system bus continuously until the entire block of data (e.g., 4 KB) is transferred. Maximizes transfer speed but locks the CPU out of RAM during the burst.
  • Cycle Stealing Mode: The DMAC requests the bus, transfers one word, and releases the bus back to CPU. Minimizes CPU stalling at the expense of slight arbitration overhead.

Discuss Parallel Priority Interrupt Hardware using a Priority Encoder. Describe the role of the Interrupt Status Register, Mask Register, and explain how software interrupt masking enables nested interrupts

Parallel Priority Interrupt System with Priority Encoder

Parallel priority interrupt hardware resolves simultaneous interrupt requests in a single clock cycle using combinational logic.

System Architecture / Concept DiagramHorizontal Scroll Enabled
Inputs (0-7)       +---------------------+
from Devices ----> | Interrupt Mask Reg  |
                   +---------------------+
                              |
                              v
                   +---------------------+
                   | Interrupt Status Reg|
                   +---------------------+
                              |
                              v
                   +---------------------+
                   |  Priority Encoder   | ===> Outputs: 3-bit Vector Address (VAD)
                   |  (8-to-3 Lines)     | ===> Interrupt Request to CPU (IST)
                   +---------------------+

System Components:

  1. Interrupt Status Register: 8-bit register where flip-flop i is set to 1 when Device i raises an interrupt request.
  2. Mask Register: 8-bit register programmatically set by the CPU. If Mask bit M_i = 1, the interrupt from Device i is blocked (masked); if M_i = 0, it is allowed through.
  3. Priority Encoder: An 8-to-3 line priority encoder generates the binary code corresponding to the highest priority unmasked input bit.

Truth Table for 8-to-3 Priority Encoder:

I_7 (Highest)I_6I_5I_4I_3I_2I_1I_0 (Lowest)Y_2Y_1Y_0Valid (V)
1XXXXXXX1111
01XXXXXX1101
001XXXXX1011
0001XXXX1001
00001XXX0111
000001XX0101
0000001X0011
000000010001
00000000XXX0
  • Nested Interrupt Handling: When an ISR for Device 3 executes, the OS sets Mask bits for levels 0–3 to 1, while leaving levels 4–7 unmasked. Thus, an emergency high-priority device (like Device 7 power-fail) can preempt the current ISR, enabling nested prioritization.

Important Exam Points & Quick Revision

Examiner Insights & University Exam Strategy:

  1. Guaranteed 10/15-Mark DMA Question: Draw the full DMAC architecture with Address Register, Word Count Register, and control bus handshake (BR and BG). Distinguish clearly between Burst mode and Cycle Stealing.
  2. Daisy Chaining vs Priority Encoder: Often contrasted in 5-mark questions. Daisy chaining is serial hardware; Priority encoder is parallel combinational logic.
  3. Isolated vs Memory-Mapped I/O: Write a 4-point comparison table noting address space separation and instruction set impact.
Your reading progress
0%

100% left on this page — finishing it closes the gap for Input/Output Organization, Interfaces & Data Transfer Modes.

Weak topic hint

Input/Output Organization, Interfaces & Data Transfer Modes still counts as a weak topic until you finish this note and answer its questions.

Practise this unit
What Should You Do Next?

Test Your Understanding

Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.