∑GateAndNet
Practice MCQs
GATE CS / Computer Organization & Architecture
Edit
INTERMEDIATE🔥 High-Yield Exam Topic 4 min read 3 views

Addressing Modes, Hardwired vs Microprogrammed Control Unit & DMA I/O

Effective address computation for PC-relative and indexed modes, horizontal vs vertical microinstructions control store size, and DMA cycle-stealing CPU slowdown.

1. Machine Addressing Modes & Relocation

Addressing ModeEffective Address (EA)Primary Compiler / OS Use Case
ImmediateOperand inside instructionConstants (MOV R1, #42)
Register IndirectEA=[Ri]EA = [R_i]Pointers in C (*ptr)
Base + Displacement / IndexedEA=[Rb]+OffsetEA = [R_b] + \text{Offset}Array indexing A[i] & struct fields
PC-RelativeEA=PCnext+OffsetEA = \text{PC}_{\text{next}} + \text{Offset}Position-Independent Code (PIC) & short branches
Auto-Increment / DecrementEA=[Ri];  Ri←Ri±dEA = [R_i];\; R_i \leftarrow R_i \pm dStack PUSH / POP & loop traversal
🚨 Exam Trap Alert

Classic GATE PC-Relative Trap: If a 4-byte branch instruction sits at byte address 10001000 with signed offset −16-16, when the ALU computes the target, PC\text{PC} already equals 1000+4=10041000 + 4 = 1004. Thus Target =1004+(−16)=988= 1004 + (-16) = 988 (NOT 984984!).

2. Hardwired vs Microprogrammed Control Unit

  • Hardwired Control: Combinational logic gates driven by state counter + IR opcode; fastest clock rate, used in RISC processors.
  • Microprogrammed Control: Stores microinstructions in Control ROM.
    • Horizontal Microprogramming: 1 bit per control signal (NN signals = NN bits); maximum parallelism, zero decoder delay.
    • Vertical Microprogramming: Mutually exclusive micro-operations grouped into fields of ⌈log⁡2(mi+1)⌉\lceil \log_2(m_i + 1) \rceil bits (+1 for NO-OP!).

3. Interrupts vs Direct Memory Access (DMA)

In Cycle Stealing DMA, if a device generates data at RR bytes/sec, transfers ww bytes per bus cycle, and each DMA bus steal stalls the CPU for tstealt_{\text{steal}} seconds:

% CPU Slowdown ( Bus Utilization )=tstealtprep×100%,tprep=wR\%\text{ CPU Slowdown ( Bus Utilization )} = \frac{t_{\text{steal}}}{t_{\text{prep}}} \times 100\%, \quad t_{\text{prep}} = \frac{w}{R}
📐 Quick Revision Formula Sheet
PC-Relative Branch Target Address
Target EA=(PCcurrent+Instruction Length)+Signed Offset\text{Target EA} = (\text{PC}_{\text{current}} + \text{Instruction Length}) + \text{Signed Offset}
💡 PC is ALWAYS incremented to point to the NEXT instruction before adding offset!
Control Memory Size (Microprogrammed CU)
Size=2k×W bits,W=Control Word Bits+Condition Bits+k\text{Size} = 2^k \times W \text{ bits}, \quad W = \text{Control Word Bits} + \text{Condition Bits} + k
💡 Horizontal = unencoded (fast, wide); Vertical = encoded decoders (compact, slower)
#COA#Addressing Modes#Microprogrammed Control#DMA#Interrupts#GATE CS

🎯 Practice PYQs on This Topic (2)

Q1.GATE CS COAMCQMEDIUM
+2 Marks • -0.67 Neg

A 4-byte PC-relative branch instruction is stored in memory starting at byte address 20002000. If the signed displacement field inside the instruction equals −24-24, what is the branch target byte address?

Q2.UGC NET / GATE COAMCQEASY
+1 Marks • -0.33 Neg

Which machine addressing mode is best suited for writing relocatable / position-independent code at runtime?

Previous Topic5-Stage Instruction Pipelining, Hazards & Cache Mapping Bit MathNext Topic C Pointers, Static Storage, Array Decay & Tricky Output Patterns