Top Banner Ad
BCS302 · 2023-2422 Questions

COMPUTER ORGANIZATION AND ARCHITECTURE — 2023-24

Section A

2 Marks Each · 7 questions
Q1a2MUnit 1 — types of buses and bus arbitration
Survival ModePredictedRepeated

What are the different types of Buses used in computer architecture?

A bus is a shared set of wires that carries information between processor, memory and peripherals. The address bus carries the location and is one way from the CPU, the data bus carries the information and is two way, and the control bus carries timing and command signals such as read and write.

Key Points

  • Address bus carries location
  • Data bus carries information
  • Control bus carries commands
Q1b2MUnit 2 — Booths algorithm and array multiplier
Predicted

Name the different types of multipliers.

Common multiplier types include the array multiplier using an AND matrix and adder network, the sequential shift and add multiplier using one adder repeatedly, Booth's multiplier for signed operands, and the Wallace tree multiplier that compresses partial products in parallel. Each trades hardware area against speed.

Key Points

  • Array multiplier
  • Shift and add multiplier
  • Booth and Wallace tree
Q1c2MUnit 3 — instruction cycles and sub cycles (fetch and execute etc)
Core Concept

What are the different phases of an instruction cycle?

The phases of an instruction cycle are fetch, decode, execute and possibly indirect address and interrupt cycles. Fetch obtains the instruction using the program counter, decode interprets the opcode, execute performs the operation, an indirect cycle obtains an effective address when needed, and an interrupt cycle services pending interrupts after execution.

Key Points

  • Fetch decode execute
  • Indirect cycle when needed
  • Interrupt check at end
Q1d2MUnit 3 — Hardwire and micro programmed control: micro programme sequencing
Survival ModePredicted

How does control unit of a computer works?

The control unit generates the timing and control signals that direct the processor. It decodes the current instruction, uses the step counter and flags to determine the next micro-operation, and asserts signals that gate buses, select ALU functions, load registers and enable memory reads or writes in the correct sequence.

Key Points

  • Decodes instruction opcode
  • Uses timing and flags
  • Generates control signals
Q1e2MUnit 4 — Cache memories: concept and design issues & performance
Core Concept

Write a short note on locality of reference.

Locality of reference is the tendency of programs to access the same data repeatedly in a short interval, called temporal locality, and to access nearby addresses in succession, called spatial locality. It is the reason cache memories work: keeping recently used and neighbouring data in fast memory satisfies most requests without going to main memory.

Key Points

  • Temporal means repeated access
  • Spatial means nearby addresses
  • Basis of cache effectiveness
Q1f2MUnit 4 — 2D & 2 1/2D memory organization
Survival ModePredicted

Define 2122\frac{1}{2} D memory organization.

Two and a half D memory organization places two memory chips side by side to double the word length and pairs of banks to increase capacity, so the processor sees a word width larger than a single chip. The half dimension refers to using two chips in depth for each address to provide extra data bits or banks.

Key Points

  • Two chips widen the word
  • Paired banks add capacity
  • Half D refers to depth pairing
Q1g2MUnit 5 — Serial Communication: Synchronous & asynchronous communication
Survival ModePredicted

In what way synchronous and asynchronous serial modes of data transfer differ?

Synchronous serial transfer uses a shared clock, so bits are sampled at agreed clock edges and sent continuously in frames with no start or stop bits, giving high efficiency. Asynchronous transfer has no clock and frames each character with a start bit and stop bits, allowing independent clocks but adding overhead and requiring agreed baud rates.

Key Points

  • Shared clock in synchronous
  • Start and stop bits in asynchronous
  • Different overhead and speed

Section B

7 Marks Each · 5 questions
Q2a7MUnit 1 — types of buses and bus arbitration
Survival ModePredicted

What is meant by the term BUS arbitration? Why is it needed? How can bus arbitration be implemented in Daisy chaining scheme?

Answer: Bus arbitration is the process of selecting which bus master (CPU, DMA controller, I/O processor, etc.) gets control of the shared system bus when more than one master requests it at the same time.

Why needed:

  • The system bus is a shared resource; only one master should drive it at a time to avoid bus contention and data corruption.
  • Multiple devices may request memory/I/O access simultaneously.
  • Arbitration ensures orderly access, priority handling, and fairness.

Daisy chaining scheme (implementation):

  1. Common request line: All masters place bus request on a common BUS REQUEST line to the arbiter.
  2. Bus grant line: Arbiter issues BUS GRANT, which passes serially from highest-priority master to lower-priority masters.
  3. Grant propagation: If a master has not requested the bus, it passes the grant to the next master; if it has requested, it blocks the grant, asserts BUS BUSY, and takes control of the bus.
  4. Bus release: After transfer, master deasserts BUS BUSY; bus becomes available for next arbitration.
Aspect Daisy Chaining
Priority Fixed by physical position near arbiter
Hardware Simple, few control lines
Speed Slower due to serial grant propagation
Limitation Failure of one module can block grant; low fairness

Conclusion: Bus arbitration prevents contention on a shared bus, and daisy chaining implements it by serial grant propagation with simple hardware but fixed priority.

Shared pathways inside a computer. A bus is a set of parallel conducting lines that carries information between the processor, memory and input output devices. Because a bus is shared, only one device can drive it at a time. The address bus carries the location being accessed and is unidirectional from the processor, its width determining the maximum addressable memory. The data bus carries the actual information and is bidirectional, its width determining how many bits move in one transfer. The control bus carries timing and command signals such as read, write, interrupt acknowledge and clock, coordinating which device uses the bus and when. Bus arbitration is the process of deciding which of several potential masters gains control when more than one wants to use the bus. In daisy chaining, all devices share a bus grant line that passes serially from one device to the next. A device that requests the bus captures the grant as it passes and blocks it from reaching lower priority devices, so priority is determined by physical position along the chain. The scheme needs few control lines and is simple to extend, but a failure in one device can break the chain and devices far from the processor may starve. Other schemes include independent request and grant lines with priority encoders and distributed arbitration. A good answer defines the bus and its three types, explains why arbitration is necessary when several masters exist, describes the daisy chain signal flow with a diagram and lists its advantages and limitations. Mentioning that synchronous buses use a clock while asynchronous buses use handshaking links this topic to transfer timing.

$Address\ bus,\ Data\ bus,\ Control\ bus$ $Arbitration:\ request \rightarrow grant \rightarrow busy$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Bus arbitration selects one master for shared bus
  • Needed to prevent contention/corruption and ensure orderly access
  • Daisy chaining: common request, serial BUS GRANT, BUS BUSY
  • Advantage simple; limitation fixed priority and propagation delay/failure sensitivity
Q2b7MUnit 2 — Booths algorithm and array multiplier
Survival ModePredicted

Show the multiplication process using Booth's algorithm when the following numbers are multiplied: (−12)∗(−18)(-12) * (-18).

Answer: Using Booth's algorithm for (−12)×(−18)(-12) \times (-18).

Choose 6-bit representation (to cover -18 to +17 range):

  • M=−12=1101002M = -12 = 110100_2
  • −M=+12=0011002-M = +12 = 001100_2
  • Q=−18Q = -18: +18 = 010010, so -18 = 1011102101110_2
  • A=000000A = 000000, Q−1=0Q_{-1}=0, count = 6
Step (Q0,Q−1)(Q_0,Q_{-1}) Operation A (6) Q (6) Q-1
Init - - 000000 101110 0
1 00 ASR 000000 010111 0
2 10 A=A−M=001100A=A-M=001100; ASR 000110 001011 1
3 11 ASR 000011 000101 1
4 11 ASR 000001 100010 1
5 01 A=A+M=110101A=A+M=110101; ASR 111010 110001 0
6 10 A=A−M=001010A=A-M=001010; ASR 000101 011000 1

Multiplying signed numbers efficiently. Booth's algorithm multiplies two signed binary numbers in two's complement form without treating the sign separately. It examines pairs of bits of the multiplier, including an implicit zero appended at the right. For each pair, if the bits are zero zero or one one, no addition is needed; if they are zero one, the multiplicand is added to the accumulator; if they are one zero, the multiplicand is subtracted. After each step the accumulator and multiplier are shifted right arithmetically, preserving the sign. This recoding turns long runs of ones into a single subtraction at the start of the run and no operations in the middle, so it reduces the number of additions compared with ordinary shift and add multiplication. For multiplying minus twelve by minus eighteen using six bit two's complement representations, the multiplier bits end with the pattern one one zero zero one one zero, producing add and subtract steps whose accumulated result is two hundred and sixteen, the correct positive product. For minus five times three, the multiplier has a run that requires a subtraction and then a shift, again giving the correct negative result after the fixed number of cycles. An array multiplier takes a different approach and forms all partial products simultaneously with an AND gate array, then sums them with a network of adders, giving regular hardware and high speed at the cost of area. A good answer explains the bit pair rules, shows a step by step table of accumulator, multiplier and operation for the given numbers, explains why the algorithm works for signed operands and contrasts it with the array approach. Mentioning that the arithmetic right shift must preserve the sign is a common marking point.

Result: (A,Q)=000101 0110002=0000 1101 10002=21610(A,Q)=000101\,011000_2 = 0000\,1101\,1000_2 = 216_{10}.

Verification: (−12)×(−18)=+216(-12)\times(-18)=+216. Correct.

Final answer: (−12)×(−18)=0001010110002=+216\boxed{(-12)\times(-18)=000101011000_2=+216}.

$(-12) \times (-18)$ $M = -12 = 110100_2$ $-M = +12 = 001100_2$ $Q = -18$ $101110_2$ $A = 000000$ $Q_{-1}=0$ $(Q_0,Q_{-1})$ $A=A-M=001100$ $A=A+M=110101$ $A=A-M=001010$ $(A,Q)=000101\,011000_2 = 0000\,1101\,1000_2 = 216_{10}$ $(-12)\times(-18)=+216$ $\boxed{(-12)\times(-18)=000101011000_2=+216}$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Use 6-bit two's complement: M=-12=110100, Q=-18=101110
  • Booth rules: 10 subtract M, 01 add M, 00/11 shift only
  • After 6 cycles, AQ = 000101011000_2
  • Final product = +216, verifies (-12)*(-18)
Q2c7MUnit 3 — Pipelining
Survival Mode

What is pipelining? What are the different stages of pipelining? Explain in detail.

Answer: Pipelining is an instruction execution technique in which the processor divides instruction processing into sequential stages and overlaps execution of multiple instructions. While one instruction is in execute stage, another can be in decode, and another in fetch.

Need/advantage: Increases instruction throughput without necessarily reducing latency of a single instruction.

Common 5-stage pipeline:

  1. IF (Instruction Fetch): Fetch instruction from memory using PC; increment PC.
  2. ID (Instruction Decode/Register Fetch): Decode opcode, read registers, generate control signals.
  3. EX (Execute/ALU): Perform ALU operation or calculate effective address/branch condition.
  4. MEM (Memory Access): Read/write data memory for load/store; branch target update if needed.
  5. WB (Write Back): Write result back to register file.
Stage Main action Hardware involved
IF Fetch instruction PC, instruction memory
ID Decode, read registers Control unit, register file
EX ALU operation/address calc ALU
MEM Data memory access Data memory
WB Write result Register file

Performance: For kk stages, nn instructions, cycle time tt: Tp=(k+n−1)tT_p=(k+n-1)t, ideal speedup ≈k\approx k.

Pipeline hazards: Data hazards, control hazards, structural hazards.

Conclusion: Pipelining improves CPU throughput by overlapping stages, with maximum benefit when hazards are minimized.

Overlapping instruction execution. Pipelining is a technique that increases processor throughput by overlapping the execution of several instructions. Instead of completing one instruction before starting the next, the processor divides execution into stages such as instruction fetch, instruction decode, operand fetch, execute, memory access and write back. Each stage is a separate piece of hardware, and on each clock cycle every stage works on a different instruction, much like an assembly line. For a pipeline with five stages each taking twenty nanoseconds, one instruction without pipelining takes one hundred nanoseconds, so ten instructions take one thousand nanoseconds. With pipelining, after the first instruction completes at one hundred nanoseconds, one more completes every twenty nanoseconds, so ten instructions take one hundred plus nine times twenty, which is two hundred and eighty nanoseconds. The speedup is one thousand over two hundred and eighty, about three point six, and approaches the number of stages for a long stream of instructions. The throughput improves but the latency of a single instruction does not, and the clock period is limited by the slowest stage. Hazards reduce the ideal speedup. Structural hazards arise when two stages need the same resource, data hazards arise when an instruction needs a result not yet written, and control hazards arise from branches whose target is not known immediately. They are handled by forwarding, stalling, branch prediction and delayed branches. A good answer defines pipelining, lists and explains the stages, works through the numerical example with the pipeline timing, states the speedup formula and explains the three hazard types with remedies. Mentioning that deeper pipelines raise clock speed but worsen branch penalties and increases area and power shows a balanced view.

$k$ $n$ $t$ $T_p=(k+n-1)t$ $\approx k$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Pipelining overlaps instruction execution in stages
  • 5 stages: IF, ID, EX, MEM, WB
  • Throughput increases; ideal speedup near number of stages
  • Hazards: data, control, structural
Q2d7MUnit 4 — address mapping and replacement Auxiliary memories: magnetic disk
Survival ModePredicted

Give classification of memory based on the method of access. Also discuss construction and working of magnetic disk and various components of disk access time.

Answer:

Classification of memory based on method of access:

  1. Sequential Access: Data accessed in linear order. Example: magnetic tape.
  2. Direct Access: Has shared read/write mechanism positioned to a location, then sequential within block. Example: magnetic disk, optical disk.
  3. Random Access: Any location accessed directly in nearly same time by address. Example: RAM, ROM, cache.
  4. Associative/Content-Addressable Access: Accessed by content rather than address. Example: CAM, cache tag memory.

Magnetic disk construction:

  • Platters: One or more circular disks coated with magnetic material.
  • Spindle: Rotates platters at constant RPM.
  • Tracks: Concentric circles on platter surface.
  • Sectors: Tracks divided into fixed-size sectors (data blocks).
  • Cylinder: Same track number on all platter surfaces.
  • Read/Write head: Mounted on actuator arm; floats very close to surface.
  • Actuator arm: Moves heads radially to desired track.

Working:

  • Disk controller receives address (cylinder, head/surface, sector).
  • Actuator moves head to required track (seek).
  • Disk rotates until required sector reaches head (rotational latency).
  • Head reads/writes magnetic data (transfer).

Disk access time components:

Taccess=Tseek+Trotational+Ttransfer+TcontrollerT_{access} = T_{seek} + T_{rotational} + T_{transfer} + T_{controller}
Component Meaning
Seek time Time to move head to required track
Rotational latency Time for desired sector to rotate under head; avg = half rotation
Transfer time Time to transfer data block
Controller overhead Electronic/controller processing delay

Conclusion: Magnetic disk is a direct-access auxiliary memory; its performance is dominated by seek and rotational latency.

Storage outside main memory. Auxiliary or secondary memory provides large, nonvolatile storage for programs and data. Memories are classified by access method into random access, where any location takes the same time to reach; sequential access, where data must be traversed in order as on magnetic tape; and direct access, where a seek moves to a track or cylinder and then waits for the desired sector, as on a magnetic disk. A magnetic disk consists of one or more rotating platters coated with magnetic material, read write heads mounted on arms, and concentric tracks divided into sectors. A cylinder is the set of tracks at the same radius on all surfaces. Disk access time is the sum of seek time to move the head to the track, rotational delay while the desired sector rotates under the head, transfer time to read or write the data and a small controller overhead. Magnetic tapes store data in blocks along a long strip and are cheap with very high capacity but slow because access is sequential; they are used for backup and archival storage. Optical disks use a laser to read pits and lands on a reflective surface, with formats such as CD, DVD and Blu-ray offering moderate capacity and durability. A good answer classifies memories by access method, draws or describes disk construction, defines track, sector, cylinder and cluster, writes the access time formula and compares disk, tape and optical storage on capacity, speed, cost and typical use. Mentioning that solid state drives now replace magnetic disks in many roles because they have no moving parts and much lower latency is a useful modern note.

Taccess=Tseek+Trotational+Ttransfer+TcontrollerT_{access} = T_{seek} + T_{rotational} + T_{transfer} + T_{controller}
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Access classification: sequential, direct, random, associative
  • Magnetic disk: platters, tracks, sectors, cylinders, R/W head, actuator
  • Access time = seek + rotational latency + transfer + controller overhead
  • Disk is non-volatile direct-access secondary storage
Q2e7MUnit 5 — Modes of Data Transfer: Programmed I/O
Core Concept

What are the basic differences between interrupt initiated I/O and programmed I/O? Explain in detail.

Answer:

Programmed I/O:

  • CPU actively controls I/O transfer.
  • CPU continuously polls device status register (READY/BUSY).
  • When ready, CPU executes instructions to transfer data word/byte.
  • Simple hardware but wastes CPU time in busy-waiting.

Interrupt-initiated I/O:

  • CPU issues I/O command and continues other work.
  • When device is ready, it sends an interrupt request (IRQ).
  • CPU saves context, executes ISR to transfer data, then resumes main program.
  • Better CPU utilization, but overhead for interrupt handling.
Basis Programmed I/O Interrupt-Initiated I/O
CPU involvement Continuous polling CPU interrupted only when needed
CPU utilization Poor due to busy-wait Better
Response mechanism Polling loop Hardware interrupt signal
Hardware complexity Simple Needs interrupt logic/controller
Software complexity Simple polling routine ISR, context save/restore
Speed suitability Slow devices/simple systems Moderate-speed devices
Overhead Polling overhead Interrupt/context-switch overhead

Example: Programmed I/O repeatedly checks printer READY bit; interrupt I/O lets printer interrupt CPU when buffer ready.

Conclusion: Interrupt-initiated I/O is superior to programmed I/O for CPU efficiency, while programmed I/O is simpler for low-speed or simple systems.

Programmed I/O, interrupts and DMA. Data transfer between a computer and its peripherals can use several methods. In programmed I/O the processor repeatedly reads the device status port until the device signals ready, then transfers one word. It is simple but wastes processor time in a busy wait loop. In interrupt initiated I/O the device sends an interrupt request when it is ready, the processor finishes its current instruction, saves its context and jumps to an interrupt service routine that performs the transfer and returns. This removes polling overhead and lets the processor do useful work meanwhile, but each interrupt has context saving overhead and many small interrupts can be costly. Interrupt hardware includes request lines, an interrupt mask register to disable sources, a priority encoder to select the highest priority pending interrupt, and an interrupt acknowledge signal; interrupts may be vectored, supplying the address of the service routine directly, or non vectored, requiring software to poll for the source. Direct memory access goes further by letting a DMA controller take control of the buses and transfer an entire block of data between device and memory without processor involvement. The processor sets up the controller with the starting address, word count and direction, then continues other work. The controller steals memory cycles when the device is ready and interrupts the processor only when the whole block is complete. DMA is therefore far more efficient for large blocks such as disk transfers. A good answer compares the three methods with respect to CPU involvement, speed and overhead, describes the DMA controller registers and cycle stealing, explains interrupt hardware and gives applications for each method. Mentioning that DMA can compete with the CPU for memory bandwidth explains a limitation of the technique.

$Polling:\ status\ register$ $Ready/Busy\ flags$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Programmed I/O: CPU polls status, busy-wait, simple but wastes CPU time
  • Interrupt I/O: device raises IRQ, CPU runs ISR, better utilization
  • Interrupt needs context save/restore and interrupt hardware
  • Programmed for simple/slow devices; interrupt for better efficiency

Section C

7 Marks Each · 10 questions
Q3a7MUnit 1 — Processor organization
Core Concept

What do you mean by processor organization? Explain various types of processor organization with suitable example.

Answer: Processor organization refers to the way CPU components—registers, ALU, control unit, buses, and memory interface—are arranged and interconnected to execute instructions.

Types of processor organization:

1. Single Accumulator Organization:

  • Uses one implicit accumulator (AC) for most ALU operations.
  • Instruction form: ADD X means AC←AC+M[X]AC \leftarrow AC + M[X].
  • Advantage: Simple design, short instructions.
  • Disadvantage: Frequent memory access, accumulator becomes bottleneck.
  • Example: Early microprocessors / basic accumulator machines.

2. General Register Organization:

  • Has multiple general-purpose registers (R0-Rn).
  • Instructions can be register-register or register-memory.
  • Example: ADD R1, R2, R3 means R1←R2+R3R1 \leftarrow R2 + R3.
  • Advantage: Faster due to reduced memory access; flexible.
  • Disadvantage: More bits needed to specify registers.

3. Stack Organization:

  • Uses LIFO stack; operations implicitly use top-of-stack (TOS).
  • Zero-address instructions: PUSH X, ADD, POP.
  • Example: ADD performs TOS←TOS+(TOS−1)TOS \leftarrow TOS + (TOS-1).
  • Advantage: Simple expression evaluation, compact instructions.
  • Disadvantage: Stack management overhead; limited random access.
Type Operand Location Example Main Merit Main Demerit
Accumulator AC + memory ADD X Simple hardware Memory traffic high
General Register Registers/memory ADD R1,R2,R3 Fast, flexible Longer instruction fields
Stack Top of stack ADD Compact code Stack overhead

Conclusion: Choice of organization affects instruction format, speed, hardware complexity, and programming convenience.

Arranging the processor's datapath. Processor organisation describes how the functional units of a central processing unit are connected and how information moves between them. The main units are the arithmetic and logic unit, the control unit, the register file, the instruction register, the program counter and the address and data buffers, all connected by internal buses. A stack organisation uses a stack pointer to a stack in memory or registers for operand storage and is characteristic of stack machines. In a general register organisation, operands are held in fast registers addressed by fields in the instruction, which reduces memory traffic and is the dominant modern approach. A register-memory machine allows one operand to be in memory, while a load-store or register-register machine requires all operands to be loaded into registers first, which simplifies instruction decoding and supports pipelining. Register windows, used in some reduced instruction set processors, provide many registers that overlap between procedure calls so parameter passing is fast. The control unit generates signals that select register sources, gate buses, enable the arithmetic unit and write results, either through hardwired logic or microprogramming. A good answer defines processor organisation, describes each functional block, contrasts stack, register-memory and load-store organisations with examples, and explains how a simple instruction such as an addition moves through the datapath. Mentioning that the choice of organisation affects instruction length, code density and the number of memory accesses per instruction shows understanding of the design tradeoffs.

$AC \leftarrow AC + M[X]$ $R1 \leftarrow R2 + R3$ $TOS \leftarrow TOS + (TOS-1)$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Processor organization: arrangement of CPU registers, ALU, CU, buses
  • Accumulator: AC implicit, simple but memory bottleneck
  • General register: multiple GPRs, fast and flexible
  • Stack: LIFO/TOS, zero-address instructions, good for expressions
Q3b7MUnit 1 — stack organization and addressing modes
Core Concept

Differentiate between Memory stack and register stack.

Answer: A stack is a LIFO data structure used for PUSH/POP operations. It can be implemented using registers or memory.

Basis Register Stack Memory Stack
Location Implemented using a small set of CPU registers Implemented in a portion of main memory/RAM
Stack pointer SP points to a register in register file; may be small counter SP is a CPU register holding memory address of top of stack
Speed Very fast, inside CPU Slower due to memory access
Size Limited by number of registers Large, limited by allocated memory space
Overflow/underflow Occurs when register set is full/empty Occurs when memory limit crossed or stack empty
Use Temporary operands, expression evaluation in CPU Function calls, return addresses, interrupts, local variables
Example operation PUSH: SP< -SP+1, R[SP]< -DR; POP: DR< -R[SP], SP< -SP-1 PUSH: SP< -SP-1, M[SP]< -DR; POP: DR< -M[SP], SP< -SP+1

Conclusion: Register stack is faster but small; memory stack is larger and flexible but slower.

Last in first out storage. A stack is a storage area organised so that the last item written is the first read. A stack pointer register holds the address of the top item, and push and pop operations update it automatically. In a memory stack the storage resides in a reserved region of main memory. It can be large and flexible, growing to fill available memory, but every push or pop requires a memory access, which is relatively slow, and the stack competes with programs for address space. In a register stack the storage is a small set of dedicated hardware registers inside the processor. Access is very fast and needs no memory cycle, but the depth is limited by the number of registers, and overflow or underflow must be handled explicitly or by spilling to memory. Many machines use a hybrid scheme in which a register file acts as a stack window that is saved to memory on overflow. Stack organization is used for expression evaluation, subroutine return addresses, local variables and interrupt saving of processor state. A good answer defines both forms, compares them on speed, capacity, cost and addressing, explains how the stack pointer changes on push and pop, and gives at least two uses. Noting that a memory stack usually grows downward while a register stack may grow upward is a detail that shows familiarity with real implementations.

$EA = Base + Index + Offset$ $SP \leftarrow SP \pm 1$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Register stack: CPU registers, very fast, limited size
  • Memory stack: RAM portion, slower, large size
  • SP points to top; PUSH/POP follow LIFO
  • Memory stack used for calls/interrupts; register stack for fast temporary storage
Q4a7MUnit 2 — Look ahead carries adders
Survival ModePredictedRepeated

Explain in detail the principle of carry looks ahead adder and design 4-bit CLA adder.

Answer: A carry look-ahead adder (CLA) improves addition speed by computing carries from generate/propagate signals in parallel.

Concept:

  • Gi=AiBiG_i=A_iB_i (generate), Pi=Ai⊕BiP_i=A_i\oplus B_i (propagate).
  • Si=Pi⊕CiS_i=P_i\oplus C_i, Ci+1=Gi+PiCiC_{i+1}=G_i+P_iC_i.
  • Expanded carries: C1=G0+P0C0C_1=G_0+P_0C_0, C2=G1+P1G0+P1P0C0C_2=G_1+P_1G_0+P_1P_0C_0, etc. Thus higher carries do not wait for ripple.

Comparison with ripple carry adder (RCA):

Feature Ripple Carry Adder Carry Look-Ahead Adder
Carry generation Carry ripples from LSB to MSB Carries generated in parallel by look-ahead logic
Propagation delay O(n)O(n); increases with bit width Much lower, ideally constant for a block / O(log⁡n)O(\log n) with multi-level
Hardware complexity Simple, fewer gates More complex, more gates and fan-in
Speed Slow for large nn Fast, suitable for high-speed ALUs
Cost/power Lower Higher
Design regularity Very regular Less regular due to carry logic

Advantages of CLA: High speed, reduced carry propagation delay, better for wide adders. Disadvantages of CLA: Increased hardware complexity, larger area, higher fan-in/fan-out for large bit groups (often solved by multi-level CLA).

Conclusion: CLA trades extra hardware for speed, while RCA is simple but slower for large word sizes.

Adding without waiting for every carry. A ripple carry adder builds an n bit adder from full adders connected in series, so the carry out of each stage becomes the carry in of the next. The sum bit is correct only after the carry has rippled through all preceding stages, giving a delay proportional to n, which is slow for wide words. A look ahead carry adder removes this serial dependency by computing all carry signals in parallel from the input bits and the initial carry. Each bit position defines a generate signal, which is one when both operands are one so a carry is always produced, and a propagate signal, which is one when exactly one operand is one so an incoming carry is passed onward. The carry into stage i is then the generate of the previous stage or the propagate of the previous stage and the carry before it, expanded recursively into a sum of products involving only the input bits and the initial carry. Because these expressions depend only on the operands, all carries can be computed by a few levels of gate logic after the generate and propagate signals are formed. The sum is then the exclusive or of the operands and the computed carry. The advantage is a delay that grows roughly with the logarithm of the word length rather than linearly, which is crucial in fast processors. The disadvantages are increased gate count, more complex wiring and higher power consumption. A good answer draws or describes the block diagram with generate and propagate logic, writes the Boolean carry equations for at least the first few stages, compares delays quantitatively and lists the tradeoffs. Mentioning that the idea is applied hierarchically in carry skip and carry select adders shows how the concept extends.

$G_i=A_iB_i$ $P_i=A_i\oplus B_i$ $S_i=P_i\oplus C_i$ $C_{i+1}=G_i+P_iC_i$ $C_1=G_0+P_0C_0$ $C_2=G_1+P_1G_0+P_1P_0C_0$ $O(n)$ $O(\log n)$ $n$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.
Carry lookahead adder G = A and BP = A xor B carry logic sum XOR C(i+1) = G(i) + P(i) C(i), expanded in parallel for all stages ripple delay is O(n); lookahead delay is roughly O(log n) with more gates

Key Points

  • CLA: Gi=AiBi, Pi=Ai xor Bi, Ci+1=Gi+PiCi, Si=Pi xor Ci
  • RCA delay O(n); CLA much faster with parallel carry logic
  • CLA advantage: speed; disadvantage: complex hardware/fan-in
  • Use CLA in high-speed ALUs, RCA in simple/low-cost designs
Q4b7MUnit 2 — IEEE Standard for Floating Point Numbers
Core Concept

Represent the following decimal number in IEEE standard floating-point format in a single precision method (32 bit) representation method.\n(i) (85.125)10(85.125)_{10}\n(ii) (−307.1875)10(-307.1875)_{10}

Answer: IEEE 754 single precision (32-bit) format: 1 sign bit, 8 exponent bits (bias 127), 23 fraction bits. Value: (−1)S×1.f×2E−127(-1)^S\times 1.f\times 2^{E-127}.

(i) (85.125)10(85.125)_{10}

1. Convert to binary: 85=1010101285 = 1010101_2, 0.125=0.00120.125 = 0.001_2, so 85.125=1010101.001285.125 = 1010101.001_2.

2. Normalize: 1010101.0012=1.010101001×261010101.001_2 = 1.010101001 \times 2^6.

3. Fields:

  • S=0S=0 (positive)
  • E=6+127=133=100001012E = 6+127 = 133 = 10000101_2
  • Fraction f=01010100100000000000000f = 01010100100000000000000 (23 bits)

Representing real numbers in binary. Floating point representation stores a number in three fields: a sign bit, an exponent and a mantissa or significand. The IEEE 754 single precision format uses thirty two bits, with one sign bit, eight exponent bits biased by one hundred and twenty seven, and twenty three fraction bits with an implicit leading one for normalised numbers. The value is minus one to the sign times one point fraction times two to the exponent minus the bias. To convert a decimal number, write its binary form, shift the point until exactly one nonzero digit lies to its left, count the shifts to obtain the unbiased exponent, add the bias and store the remaining bits as the fraction. For eighty five point one two five the binary value is one zero one zero one zero one point zero zero one, which normalises as one point zero one zero one zero one zero zero one times two to the six, giving exponent one hundred and thirty three and a fraction field of zeros and ones. For a negative number such as minus three hundred and seven point one eight seven five the sign bit is one and the same procedure is applied to the magnitude. Double precision uses sixty four bits with eleven exponent bits and a bias of one thousand and twenty three, giving much greater range and precision. Special patterns represent zero, infinity and not a number. A good answer states the format, performs the conversion step by step, gives the final bit pattern in hexadecimal or grouped binary and explains the bias and implicit bit. Mentioning that the exponent bias allows exponents to be stored as unsigned integers simplifies comparison of floating point values is a useful conceptual point. Adding two floating point numbers requires aligning exponents, adding significands, normalising and rounding, and overflow or underflow may occur if the result lies outside the representable range.

Result: 0  10000101  01010100100000000000000\boxed{0\;10000101\;01010100100000000000000}

(ii) (−307.1875)10(-307.1875)_{10}

1. Convert magnitude to binary: 307=1001100112307 = 100110011_2. 0.1875=0.001120.1875 = 0.0011_2 (0.1875×2=0.375,0.75,1.5,1.00.1875\times2=0.375,0.75,1.5,1.0). So 307.1875=100110011.00112307.1875 = 100110011.0011_2.

2. Normalize: 100110011.00112=1.001100110011×28100110011.0011_2 = 1.001100110011 \times 2^8.

3. Fields:

  • S=1S=1 (negative)
  • E=8+127=135=100001112E = 8+127 = 135 = 10000111_2
  • Fraction f=00110011001100000000000f = 00110011001100000000000

Result: 1  10000111  00110011001100000000000\boxed{1\;10000111\;00110011001100000000000}

$(-1)^S\times 1.f\times 2^{E-127}$ $(85.125)_{10}$ $85 = 1010101_2$ $0.125 = 0.001_2$ $85.125 = 1010101.001_2$ $1010101.001_2 = 1.010101001 \times 2^6$ $S=0$ $E = 6+127 = 133 = 10000101_2$ $f = 01010100100000000000000$ $\boxed{0\;10000101\;01010100100000000000000}$ $(-307.1875)_{10}$ $307 = 100110011_2$ $0.1875 = 0.0011_2$ $0.1875\times2=0.375,0.75,1.5,1.0$ $307.1875 = 100110011.0011_2$ $100110011.0011_2 = 1.001100110011 \times 2^8$ $S=1$ $E = 8+127 = 135 = 10000111_2$ $f = 00110011001100000000000$ $\boxed{1\;10000111\;00110011001100000000000}$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • IEEE 754 single: S(1) + E(8, bias 127) + f(23)
  • 85.125 = 1.010101001x2^6 => 0 10000101 01010100100000000000000
  • -307.1875 = -1.001100110011x2^8 => 1 10000111 00110011001100000000000
  • Normalize binary, add bias to exponent, fill 23 fraction bits
Q5a7MUnit 3 — instruction cycles and sub cycles (fetch and execute etc)
Core Concept

Explain the different cycles of an instruction execution.

Answer: The instruction cycle is the complete sequence of steps a CPU performs to fetch and execute one instruction. It consists of fetch, decode, and execute phases, with optional indirect and interrupt phases.

1. Fetch cycle:

  • Get instruction from memory.
  • MAR←PCMAR \leftarrow PC
  • MBR←M[MAR]MBR \leftarrow M[MAR], IR←MBRIR \leftarrow MBR
  • PC←PC+1PC \leftarrow PC + 1

2. Decode cycle:

  • Control unit interprets opcode in IR.
  • Determines operation, addressing mode, and operand location.

3. Operand fetch / Indirect cycle (if needed):

  • If indirect addressing is used, effective address is obtained from memory.
  • Required operands are fetched from registers/memory.

4. Execute cycle:

  • Perform specified operation: ALU operation, data transfer, branch, or I/O.
  • Update flags and destination register/memory.

5. Interrupt cycle (if enabled and pending):

  • Save PC and processor state.
  • Load ISR address into PC and service interrupt.
Cycle Main activity Key registers/signals
Fetch Read instruction PC, MAR, MDR, IR, MEMR
Decode Interpret opcode IR, CU decoder
Execute Perform operation ALU, registers, memory/I/O
Interrupt Service interrupt Stack/PC, ISR address

Conclusion: The instruction cycle repeats continuously: fetch, decode, execute, and handle interrupts when required.

The steps that execute one instruction. The instruction cycle is the repeating sequence by which a processor fetches, interprets and carries out instructions. It begins with the fetch cycle, in which the address in the program counter is placed in the memory address register, memory is read into the memory data register, the instruction is loaded into the instruction register and the program counter is incremented to point to the next instruction. The decode cycle examines the opcode field and any addressing mode bits to determine the operation and the locations of operands. The execute cycle then performs the operation, which may involve calculating an effective address, reading operands from registers or memory, performing an ALU operation and writing the result back to a register or memory location. An indirect cycle is added when the instruction specifies indirect addressing, requiring an extra memory access to obtain the effective address. After execution the processor checks for interrupts and, if one is pending, saves the return address and branches to the interrupt service routine. Each of these phases is made up of micro-operations controlled by timing signals. Instruction formats specify the opcode and operand fields, and may be zero, one, two or three address formats, with fewer addresses requiring fewer bits but more instructions or implicit use of an accumulator. A good answer describes each phase with the register transfers involved, states how the cycle repeats and the role of the program counter, explains the indirect and interrupt cycles and gives examples of instruction formats. Mentioning that pipelining overlaps these phases for different instructions ties the cycle to modern processor design.

$MAR \leftarrow PC$ $MBR \leftarrow M[MAR]$ $IR \leftarrow MBR$ $PC \leftarrow PC + 1$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Instruction cycle: fetch, decode, execute (+indirect/interrupt if needed)
  • Fetch: MAR<-PC, IR<-M[MAR], PC<-PC+1
  • Decode identifies opcode/addressing/operands
  • Execute performs ALU/memory/I-O; interrupt cycle saves state and jumps to ISR
Q5b7MUnit 3 — Hardwire and micro programmed control: micro programme sequencing
Survival ModePredicted

Differentiate between hardwired and micro programmed control unit. Explain each component of hardwired control unit organization.

Answer:

Difference between hardwired and microprogrammed control unit:

Basis Hardwired Control Unit Microprogrammed Control Unit
Implementation Fixed combinational/sequential logic Control memory stores microinstructions
Speed Faster Slower due to control memory access
Flexibility Difficult to modify Easy to modify/update microprogram
Design complexity Complex for large instruction sets Systematic and easier for complex ISAs
Cost for complex ISA High design/debug cost Control memory cost, but simpler design
Instruction modification Requires hardware redesign Change microcode/microroutine
Used in RISC/simple high-speed CPUs CISC/complex instruction CPUs

Hardwired control unit organization and components:

  1. Instruction Register (IR): Stores current instruction; opcode and address fields are separated.
  2. Opcode Decoder: Converts opcode into a specific instruction signal.
  3. Timing Generator / Sequence Counter: Clock-driven counter produces timing pulses T0,T1,...,TnT_0,T_1,...,T_n.
  4. Control Logic Gates: Combinational logic receives opcode, timing, flags, and external signals and generates control signals.
  5. Flags/Status Inputs: Zero, carry, sign, overflow, interrupt signals affect control decisions.
  6. Control Signal Outputs: Enable/load/read/write/ALU-select signals to datapath components.

Working flow: IR opcode -> decoder + timing/flags -> control logic -> control signals to CPU/memory/I/O.

Conclusion: Hardwired CU is fast but rigid; microprogrammed CU is flexible but comparatively slower.

Turning instructions into signals. The control unit directs the operation of the processor by generating the timing and control signals that select registers, gate buses, choose ALU operations and enable memory accesses. In a hardwired control unit these signals are produced by combinational logic built from the instruction opcode, the current state of the instruction cycle, timing signals and condition flags. The design typically includes an instruction decoder, a step counter or state register, a timing generator and a control logic network that implements the Boolean equations for each output. Hardwired control is fast because signals come directly from gates, but it is inflexible and difficult to modify or debug, and its complexity grows rapidly with the instruction set. In a microprogrammed control unit each machine instruction is represented by a sequence of microinstructions stored in a control memory. Each microinstruction specifies a set of control signals and the address of the next microinstruction. Sequencing can be by incrementing the control address register, by branching to the routine for the fetched opcode, or by conditional branching based on flags. Microprogramming is systematic, flexible and easy to extend, but slower because each microinstruction requires a control memory access. Horizontal microprogramming emits many control bits directly with high parallelism and wide words, while vertical microprogramming encodes fields into fewer bits and needs extra decoding, saving memory at the cost of speed. A good answer defines both approaches, describes the components of a hardwired unit, explains microinstruction sequencing with a simple example and compares speed, flexibility, size and ease of design. Mentioning that modern processors often use a mixture, with hardwired control for simple common instructions and microcode for complex ones, shows current practice.

$T_0,T_1,...,T_n$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Hardwired: fixed logic, fast, hard to modify
  • Microprogrammed: control memory + microinstructions, flexible, slower
  • Hardwired components: IR, opcode decoder, timing generator, control logic, flags
  • Control signals are generated from opcode+timing+status inputs
Q6a7MUnit 4 — address mapping and replacement Auxiliary memories: magnetic disk
Predicted

Consider a cache (M1) and memory (M2) hierarchy with following characteristics:\n- M1 : 16K word, 50 ns Access time\n- M2 : 1M word, 400 ns Access time\nAssume 8-word cache blocks and set size 256 words with set associative mapping.\n(i) Show and explain the mapping between M2 and M1.\n(ii) Calculate the effective memory access time with cache hit ratio = 0.95.

Answer:

Given: M1M_1 cache: 16K words, 50 ns. M2M_2 main memory: 1M words, 400 ns. Block size = 8 words. Set size = 256 words with set-associative mapping. Hit ratio h=0.95h=0.95.

(i) Mapping between M2M_2 and M1M_1:

  • M2=1M=220M_2 = 1M = 2^{20} words => 20-bit physical address.
  • M1=16K=214M_1 = 16K = 2^{14} words.
  • Block size = 8 words = 232^3 => word/offset within block = 3 bits.
  • Number of blocks in cache = 16K/8=2048=21116K/8 = 2048 = 2^{11} blocks.
  • Set size = 256 words = 256/8=32256/8 = 32 blocks per set = 252^5 blocks/set.
  • Number of sets = 2048/32=64=262048/32 = 64 = 2^6 sets.

Address format:

Tag=20−6−3=11 bits,Set=6 bits,Word offset=3 bits\text{Tag} = 20 - 6 - 3 = 11\text{ bits},\quad \text{Set} = 6\text{ bits},\quad \text{Word offset} = 3\text{ bits}
Field Bits Purpose
Tag 11 Identifies block within set
Set index 6 Selects one of 64 sets
Word offset 3 Selects word within 8-word block
Total 20 Main memory address

Mapping: A main-memory block maps to set = (block number) mod 64, and can occupy any of 32 lines in that set.

(ii) Effective memory access time:

Teff=h×T1+(1−h)×T2T_{eff} = h\times T_1 + (1-h)\times T_2 Teff=0.95×50+0.05×400=47.5+20=67.5 nsT_{eff} = 0.95\times 50 + 0.05\times 400 = 47.5 + 20 = 67.5\text{ ns}

Caching and mapping main memory. Cache memory is a small, fast memory placed between the processor and main memory to exploit locality of reference. When the CPU requests a word, the cache is checked first; a hit supplies the word quickly, while a miss fetches the whole block from main memory. Direct mapping allows each main memory block to reside in exactly one cache line, determined by taking the line number modulo the number of lines. The address is split into tag, line and word fields, so lookup is fast and hardware is simple, but conflict misses occur when two frequently used blocks map to the same line. Fully associative mapping allows any block to go into any line, which removes conflict misses but requires comparing the tag of every line in parallel, making hardware expensive. Set associative mapping is a compromise: the cache is divided into sets, a block maps to one set but can occupy any way within that set, and only the tags in that set need comparison. For a two way set associative cache with eight word blocks, the word field needs three bits, the set index selects among the sets and the remaining high bits form the tag. Replacement policies such as least recently used decide which line to evict when a set is full. Write policies include write through, which updates main memory immediately, and write back, which updates memory only when a dirty line is evicted. A good answer explains each mapping with an address field diagram, compares hit rate, hardware cost and speed, and states how effective access time is computed from hit ratio, cache time and memory time. Mentioning that increasing associativity reduces conflict misses but increases tag comparison hardware is the central tradeoff.

Result: Address = 11-bit tag, 6-bit set, 3-bit offset; Teff=67.5 ns\boxed{T_{eff}=67.5\text{ ns}}.

$M_1$ $M_2$ $h=0.95$ $M_2 = 1M = 2^{20}$ $M_1 = 16K = 2^{14}$ $2^3$ $16K/8 = 2048 = 2^{11}$ $256/8 = 32$ $2^5$ $2048/32 = 64 = 2^6$ Tag=20−6−3=11 bits,Set=6 bits,Word offset=3 bits\text{Tag} = 20 - 6 - 3 = 11\text{ bits},\quad \text{Set} = 6\text{ bits},\quad \text{Word offset} = 3\text{ bits} Teff=h×T1+(1−h)×T2T_{eff} = h\times T_1 + (1-h)\times T_2 Teff=0.95×50+0.05×400=47.5+20=67.5 nsT_{eff} = 0.95\times 50 + 0.05\times 400 = 47.5 + 20 = 67.5\text{ ns}

Teff=67.5 ns\boxed{T_{eff}=67.5\text{ ns}}

Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • M2 address 20 bits; block offset 3 bits, 64 sets => 6 bits, tag 11 bits
  • Set-associative: block maps to set, any of 32 lines in set
  • Teff = hT1 + (1-h)T2 = 0.9550 + 0.05400
  • Effective access time = 67.5 ns
Q6b7MUnit 4 — address mapping and replacement Auxiliary memories: magnetic disk
Predicted

Explain the direct mapping technique. Consider a digital computer has a memory unit of 64k×1664k \times 16 and cache memory of 1k words. The cache uses direct mapping with 4 block size of four words.\n(i) How many bits are there in the tag, block and word fields of the address format?\n(ii) How many blocks can the cache accommodate?

Answer:

Direct mapping technique: In direct mapping, each main-memory block maps to exactly one cache line: i=jmod  mi = j \mod m, where jj is main-memory block number and mm is number of cache lines. Address is divided into Tag | Block/Line | Word. On access, only the indexed line's tag is compared.

Given: Main memory = 64K×1664K \times 16, cache = 1K1K words, direct mapping, block size = 4 words.

Calculations:

  • Main memory size = 64K=21664K = 2^{16} words => physical address = 16 bits.
  • Block size = 4 words = 222^2 => word field = 2 bits.
  • Cache size = 1K=2101K = 2^{10} words.
  • Number of cache blocks/lines = 1K/4=256=281K/4 = 256 = 2^8 => block/index field = 8 bits.
  • Tag field = 16−8−2=616 - 8 - 2 = 6 bits.

(i) Address format:

Field Bits
Tag 6
Block/Line index 8
Word offset 2
Total 16

(ii) Blocks cache can accommodate:

Cache blocks=10244=256 blocks\text{Cache blocks} = \frac{1024}{4} = 256\text{ blocks}

Caching and mapping main memory. Cache memory is a small, fast memory placed between the processor and main memory to exploit locality of reference. When the CPU requests a word, the cache is checked first; a hit supplies the word quickly, while a miss fetches the whole block from main memory. Direct mapping allows each main memory block to reside in exactly one cache line, determined by taking the line number modulo the number of lines. The address is split into tag, line and word fields, so lookup is fast and hardware is simple, but conflict misses occur when two frequently used blocks map to the same line. Fully associative mapping allows any block to go into any line, which removes conflict misses but requires comparing the tag of every line in parallel, making hardware expensive. Set associative mapping is a compromise: the cache is divided into sets, a block maps to one set but can occupy any way within that set, and only the tags in that set need comparison. For a two way set associative cache with eight word blocks, the word field needs three bits, the set index selects among the sets and the remaining high bits form the tag. Replacement policies such as least recently used decide which line to evict when a set is full. Write policies include write through, which updates main memory immediately, and write back, which updates memory only when a dirty line is evicted. A good answer explains each mapping with an address field diagram, compares hit rate, hardware cost and speed, and states how effective access time is computed from hit ratio, cache time and memory time. Mentioning that increasing associativity reduces conflict misses but increases tag comparison hardware is the central tradeoff.

Result: Tag=6,  Block=8,  Word=2;  Cache accommodates 256 blocks\boxed{\text{Tag}=6,\;\text{Block}=8,\;\text{Word}=2;\;\text{Cache accommodates }256\text{ blocks}}.

$i = j \mod m$ $j$ $m$ $64K \times 16$ $1K$ $64K = 2^{16}$ $2^2$ $1K = 2^{10}$ $1K/4 = 256 = 2^8$ $16 - 8 - 2 = 6$ Cache blocks=10244=256 blocks\text{Cache blocks} = \frac{1024}{4} = 256\text{ blocks}

Tag=6,  Block=8,  Word=2;  Cache accommodates 256 blocks\boxed{\text{Tag}=6,\;\text{Block}=8,\;\text{Word}=2;\;\text{Cache accommodates }256\text{ blocks}}

Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Direct mapping: block j maps to cache line i = j mod m
  • Address 16 bits: 64K words main memory
  • Word offset 2 (block size 4), block index 8 (256 lines), tag 6
  • Cache accommodates 1024/4 = 256 blocks
Q7a7MUnit 5 — Serial Communication: Synchronous & asynchronous communication
Survival ModePredicted

What do you mean by asynchronous data transfer? Explain strobe control and handshaking mechanism.

Answer: Asynchronous data transfer is a data transfer method where sender and receiver are not synchronized by a common clock. Transfer occurs when devices are ready, using control signals.

Strobe control:

  • A single control line called strobe signals that valid data is on the bus.
  • Source-initiated strobe: Source places data on bus and activates strobe; destination reads data on strobe.
  • Destination-initiated strobe: Destination activates strobe to request data; source places data and destination reads it.
  • Limitation: No acknowledgement from other side; sender assumes receiver has accepted data in time.

Handshaking mechanism:

  • Uses two control signals for acknowledgement: e.g., DATA VALID (source) and DATA ACCEPTED/READY (destination).
  • Source-initiated handshaking:
    1. Source places data on bus and asserts DATA VALID.
    2. Destination reads data and asserts DATA ACCEPTED.
    3. Source deasserts DATA VALID; destination deasserts DATA ACCEPTED.
  • Destination-initiated handshaking:
    1. Destination asserts READY/REQUEST.
    2. Source places data and asserts DATA VALID.
    3. Destination accepts data and removes request; source removes data valid.
Method Control lines Reliability Disadvantage
Strobe One strobe Lower No confirmation
Handshaking Request/ack pair Higher Extra control lines/time

Conclusion: Strobe is simple but unconfirmed; handshaking is more reliable because both devices confirm each step.

Sending bits one after another. Serial communication sends data one bit at a time over a single line, which is cheaper and suitable for long distances, though slower than parallel transfer over many lines. In asynchronous communication there is no shared clock. Each character is framed by a start bit, followed by the data bits, an optional parity bit and one or more stop bits. Both ends agree on the baud rate in advance, and the receiver uses the start bit to synchronise on each character, which makes the method simple and tolerant of small clock differences but adds framing overhead. In synchronous communication a common clock signal is shared or recovered from the data, and bits are sent continuously in frames or blocks with sync characters or flags. There is no per character start and stop overhead, so it is faster and efficient for large blocks, but it needs clock distribution and precise timing. Strobe control uses one line to indicate that valid data is present and the receiver samples on the strobe edge; handshaking adds a second line so the receiver acknowledges receipt, preventing data loss when the receiver is slow. A good answer defines both modes with a timing diagram showing the start and stop bits or the clock, compares them on overhead, speed, clock requirements and typical applications such as terminals for asynchronous and network or disk links for synchronous, and explains strobe and handshake control. Mentioning that parity provides only single bit error detection and cannot correct errors is a useful detail.

$Baud\ rate=\frac{1}{bit\ time}$ $Start+data+parity+stop$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Asynchronous transfer: no common clock, uses control signals
  • Strobe: single control signal; source- or destination-initiated
  • Handshaking: DATA VALID + DATA ACCEPTED/READY; reliable two-way control
  • Handshaking better for devices with variable/unknown delays
Q7b7MUnit 5 — Modes of Data Transfer: Programmed I/O
Core Concept

Explain the various modes of data transfer and discuss direct memory access mode in detail. Also explain how DMA is superior to other modes.

Answer:

Modes of data transfer:

  1. Programmed I/O: CPU executes program to check status and transfer data. Simple but CPU busy-waits.
  2. Interrupt-initiated I/O: Device interrupts CPU when ready; CPU executes ISR for transfer. Better CPU utilization.
  3. Direct Memory Access (DMA): DMA controller transfers data directly between memory and I/O device; CPU only initializes and handles completion interrupt.

Direct Memory Access in detail:

  • Need: High-speed devices (disk, network) make programmed/interrupt I/O inefficient for large blocks.
  • DMAC registers: Memory address register, word count register, control register, status register.
  • Working:
    1. CPU programs DMAC with memory address, count, direction, mode.
    2. Device requests DMA service (DREQ).
    3. DMAC requests bus (BR); CPU grants bus (BG).
    4. DMAC transfers data directly to/from memory.
    5. After transfer, DMAC interrupts CPU (completion).
  • DMA modes: Burst, cycle stealing, transparent.

Why DMA is superior:

Criterion Programmed I/O Interrupt I/O DMA
CPU involvement Very high Medium (ISR per transfer/block) Low (setup + completion)
Transfer speed Low Medium High
Best use Simple slow devices Moderate devices Large high-speed block transfer
Bus control CPU CPU DMAC during transfer

Conclusion: DMA is superior for bulk high-speed transfers because it offloads data movement from CPU to DMAC, maximizing CPU efficiency and throughput.

Programmed I/O, interrupts and DMA. Data transfer between a computer and its peripherals can use several methods. In programmed I/O the processor repeatedly reads the device status port until the device signals ready, then transfers one word. It is simple but wastes processor time in a busy wait loop. In interrupt initiated I/O the device sends an interrupt request when it is ready, the processor finishes its current instruction, saves its context and jumps to an interrupt service routine that performs the transfer and returns. This removes polling overhead and lets the processor do useful work meanwhile, but each interrupt has context saving overhead and many small interrupts can be costly. Interrupt hardware includes request lines, an interrupt mask register to disable sources, a priority encoder to select the highest priority pending interrupt, and an interrupt acknowledge signal; interrupts may be vectored, supplying the address of the service routine directly, or non vectored, requiring software to poll for the source. Direct memory access goes further by letting a DMA controller take control of the buses and transfer an entire block of data between device and memory without processor involvement. The processor sets up the controller with the starting address, word count and direction, then continues other work. The controller steals memory cycles when the device is ready and interrupts the processor only when the whole block is complete. DMA is therefore far more efficient for large blocks such as disk transfers. A good answer compares the three methods with respect to CPU involvement, speed and overhead, describes the DMA controller registers and cycle stealing, explains interrupt hardware and gives applications for each method. Mentioning that DMA can compete with the CPU for memory bandwidth explains a limitation of the technique.

$Polling:\ status\ register$ $Ready/Busy\ flags$
Tip from Examiner: Name the unit or technique, describe its operation step by step, and support the answer with a diagram, field layout or worked calculation.

Key Points

  • Three modes: programmed I/O, interrupt-initiated I/O, DMA
  • DMA: CPU initializes DMAC; DMAC transfers block directly memory<->I/O
  • DMA modes: burst, cycle stealing, transparent
  • DMA superior for high-speed large transfers due to minimal CPU involvement