Top Banner Ad
BCS302 · 2025-2622 Questions

COMPUTER ORGANIZATION AND ARCHITECTURE — 2025-26

Section A

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

What is a bus? Explain different types of buses used in a computer system.

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 1 — Functional units of digital system and their interconnections
Survival ModeRepeated

Explain the functional units of a digital computer system.

The functional units of a digital computer are the input unit, output unit, central processing unit with its arithmetic logic unit and control unit, and memory. Buses connect them so data and instructions flow from input through memory to the processor and results return to output under control signals.

Key Points

  • Input and output units
  • CPU with ALU and control
  • Memory and connecting buses
Q1c2MUnit 1 — bus architecture
Core Concept

Explain bus architecture and its role in interconnecting various components of a digital system.

Bus architecture is the pattern of shared pathways connecting processor, memory and peripherals. A single bus is cheap and simple but limits concurrent transfers, while multiple buses or a hierarchy with local and system buses allow parallel activity and higher bandwidth at greater cost and complexity.

Key Points

  • Shared communication pathways
  • Single versus multiple buses
  • Tradeoff cost against bandwidth
Q1d2MUnit 1 — Register
Core Concept

What is a register? Explain general-purpose and special-purpose registers.

A register is a small, fast storage location inside the processor built from flip flops. General purpose registers hold temporary data and addresses under program control, while special purpose registers such as the program counter, instruction register and stack pointer have dedicated roles in instruction sequencing and control.

Key Points

  • Small fast on-chip storage
  • General purpose holds temporaries
  • Special purpose has fixed role
Q1e2MUnit 2 — Look ahead carries adders
Survival ModePredictedRepeated

Explain the working of carry look-ahead adder with the help of an example.

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
Q1f2MUnit 2 — Booths algorithm and array multiplier
Core Concept

Explain signed number multiplication using Booth’s Algorithm. Multiply A×BA \times B where A=−5A = -5 and B=3B = 3 using Booth’s Algorithm.

Using Booth's algorithm for minus five times three, represent minus five as 1011 and three as 0011 with an appended zero. Scanning bit pairs gives 10, so subtract the multiplicand, then zeros with no operation, then 01 so add it, with arithmetic shifts between steps. After four cycles the accumulator holds minus fifteen in two's complement, which is 11110001 in eight bits.

Key Points

  • Use two's complement operands
  • 10 subtract and 01 add
  • Result is minus fifteen
Q1g2MUnit 2 — Floating point arithmetic operation
Survival ModeRepeated

Explain floating-point representation and its components.

Floating point representation stores a number as a sign, an exponent and a significand or mantissa. The value is the significand multiplied by the base raised to the exponent, with the sign indicating polarity. Normalisation keeps one nonzero digit before the point to maximise precision and gives a unique representation.

Key Points

  • Sign exponent significand
  • Value is mantissa times base power
  • Normalisation gives uniqueness

Section B

7 Marks Each · 5 questions
Q2a7MUnit 2 — Booths algorithm and array multiplier
Core Concept

Multiply the following numbers using Array Multiplier technique: A=1101A = 1101, B=1011B = 1011.

Answer: In an array multiplier, partial products are generated by ANDing multiplicand bits with each multiplier bit, then shifted and added in a combinational array.

Given: A=11012 (13)A=1101_2\,(13), B=10112 (11)B=1011_2\,(11), expected product =143=100011112=143=10001111_2.

Step 1: Partial products (Pi=A×BiP_i = A \times B_i):

  • B0=1B_0=1: PP0=1101PP0 = 1101
  • B1=1B_1=1: PP1=1101PP1 = 1101 shifted left by 1 = 1101011010
  • B2=0B_2=0: PP2=0000PP2 = 0000 shifted left by 2 = 000000000000
  • B3=1B_3=1: PP3=1101PP3 = 1101 shifted left by 3 = 11010001101000

Step 2: Add partial products:

+0001101+00110100100111+00000000100111+110100010001111\begin{array}{r} \phantom{+}0001101\\ +0011010\\ \hline 0100111\\ +0000000\\ \hline 0100111\\ +1101000\\ \hline 10001111 \end{array}

(Aligning by bit positions: 1101+11010+000000+1101000=1000111121101 + 11010 + 000000 + 1101000 = 10001111_2.)

Verification: 13×11=14313\times 11=143, and 100011112=128+8+4+2+1=14310001111_2=128+8+4+2+1=143.

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: 11012×10112=100011112  (14310)\boxed{1101_2 \times 1011_2 = 10001111_2\;(143_{10})}.

$A=1101_2\,(13)$ $B=1011_2\,(11)$ $=143=10001111_2$ $P_i = A \times B_i$ $B_0=1$ $PP0 = 1101$ $B_1=1$ $PP1 = 1101$ $11010$ $B_2=0$ $PP2 = 0000$ $000000$ $B_3=1$ $PP3 = 1101$ $1101000$ +0001101+00110100100111+00000000100111+110100010001111\begin{array}{r} \phantom{+}0001101\\ +0011010\\ \hline 0100111\\ +0000000\\ \hline 0100111\\ +1101000\\ \hline 10001111 \end{array}

1101+11010+000000+1101000=1000111121101 + 11010 + 000000 + 1101000 = 10001111_2 13×11=14313\times 11=143 100011112=128+8+4+2+1=14310001111_2=128+8+4+2+1=143 11012×10112=100011112  (14310)\boxed{1101_2 \times 1011_2 = 10001111_2\;(143_{10})}

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

  • Array multiplier generates partial products by AND gates
  • PP0=1101, PP1=11010, PP2=000000, PP3=1101000
  • Sum of partial products = 10001111_2
  • Final answer: 1101x1011 = 10001111_2 = 143
Q2b7MUnit 2 — Arithmetic & logic unit design
Core Concept

Explain the design of an Arithmetic and Logic Unit. Describe various arithmetic and logical operations performed by ALU.

Answer: An Arithmetic and Logic Unit (ALU) is a combinational digital circuit in the CPU that performs arithmetic and logic operations on operand data.

Design of ALU:

  1. Inputs: Operand buses AA, BB; function select lines S0,S1,...,SkS_0,S_1,...,S_k; carry-in CinC_{in}.
  2. Arithmetic unit: Adder/subtractor (full adders) performs ADD, SUB, INC, DEC. Subtraction uses two's complement: A−B=A+B‾+1A-B=A+\overline{B}+1.
  3. Logic unit: Gate network performs AND, OR, XOR, NOT, NAND, NOR etc. in parallel.
  4. Shift unit: Performs logical shift left/right, arithmetic shift, rotate.
  5. Multiplexer: Select lines choose one result from arithmetic/logic/shift units.
  6. Outputs: Result FF, and status flags: Carry (CC), Zero (ZZ), Sign (SS), Overflow (VV).
Select Operation type Example operation Result
000 Arithmetic ADD F=A+BF=A+B
001 Arithmetic SUB F=A−BF=A-B
010 Arithmetic INC F=A+1F=A+1
011 Logic AND F=A⋅BF=A\cdot B
100 Logic OR F=A+BF=A+B
101 Logic XOR F=A⊕BF=A\oplus B
110 Logic NOT F=A‾F=\overline{A}
111 Shift/Compare SHL/CMP shift or compare flags

Operations performed: Arithmetic (add, subtract, increment, decrement), logic (AND, OR, XOR, NOT, compare), shift/rotate, and flag generation for branching.

Conclusion: ALU design combines arithmetic, logic, and shift circuits with a multiplexer controlled by function-select lines to execute CPU data-processing instructions.

The arithmetic and logic unit. The arithmetic and logic unit is the part of the processor that performs data processing operations. It receives operands from registers, performs the operation selected by control signals and produces a result plus status flags. Arithmetic operations include addition, subtraction, increment, decrement and sometimes multiply and divide. Logical operations include AND, OR, XOR, NOT and bit shifts or rotates. A typical design is built around an adder that can perform addition or subtraction by complementing one operand and forcing the carry in, together with a logic unit for bitwise functions and a shifter for shifts and rotates. A multiplexer selects which unit's output is written back. Status flags record carry out, zero result, sign and overflow, and are stored in a condition code register for use by conditional branches. Overflow in signed addition occurs when two positive operands give a negative result or two negative operands give a positive result, and can be detected by comparing the carry into and carry out of the sign bit. The ALU width, usually thirty two or sixty four bits, determines the word size of the processor, and carry lookahead logic is often used inside its adder to reduce delay. A good answer describes the block diagram, lists the operations with examples, explains how subtraction uses two's complement addition, defines the flags and explains why the ALU is central to processor performance. Mentioning that complex operations may be implemented as sequences of simple ALU operations in reduced instruction set machines links the design to instruction set choices.

$A$ $B$ $S_0,S_1,...,S_k$ $C_{in}$ $A-B=A+\overline{B}+1$ $F$ $C$ $Z$ $S$ $V$ $F=A+B$ $F=A-B$ $F=A+1$ $F=A\cdot B$ $F=A\oplus B$ $F=\overline{A}$
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

  • ALU inputs: A,B, function select, Cin; outputs: result and flags
  • Arithmetic via adder/subtractor: A+B, A-B using two's complement
  • Logic via gates: AND, OR, XOR, NOT; shift/rotate unit included
  • Multiplexer selects operation; flags Z,C,S,V support decisions
Q2c7MUnit 2 — Floating point arithmetic operation
Core Concept

Explain floating point arithmetic operations. Perform floating point addition using IEEE 754 format for (5.75)10+(−2.5)10(5.75)_{10} + (-2.5)_{10}.

Answer: Floating point arithmetic performs operations on numbers represented as N=(−1)S×1.M×2E−biasN=(-1)^S\times 1.M\times 2^{E-bias}.

General steps:

  • Addition/Subtraction: Align exponents, add/subtract significands, normalize, round.
  • Multiplication: Multiply significands, add exponents, subtract bias, normalize, round.
  • Division: Divide significands, subtract exponents, add bias, normalize, round.

IEEE 754 single-precision addition: (5.75)10+(−2.5)10(5.75)_{10} + (-2.5)_{10}

1. Convert to binary:

  • 5.75=101.112=1.0111×225.75 = 101.11_2 = 1.0111\times 2^2
  • 2.5=10.12=1.01×212.5 = 10.1_2 = 1.01\times 2^1
  • Sign: S1=0S_1=0, S2=1S_2=1 (for -2.5)

2. IEEE 754 fields (bias 127):

  • E1=2+127=129=100000012E_1=2+127=129=10000001_2, M1=01110000000000000000000M_1=01110000000000000000000
  • E2=1+127=128=100000002E_2=1+127=128=10000000_2, M2=01000000000000000000000M_2=01000000000000000000000

3. Align exponents (make both 222^2):

  • 1.01×21=0.101×221.01\times 2^1 = 0.101\times 2^2
  • M2′=0.10100000000000000000000M_2' = 0.10100000000000000000000

4. Add/subtract significands (different signs => subtract):

  • 1.01110000000000000000000−0.10100000000000000000000=0.110100000000000000000001.01110000000000000000000 - 0.10100000000000000000000 = 0.11010000000000000000000

5. Normalize:

  • 0.1101×22=1.101×210.1101\times 2^2 = 1.101\times 2^1

6. Final IEEE 754:

  • Sign S=0S=0 (positive result)
  • Exponent 1+127=128=1000000021+127=128=10000000_2
  • Mantissa 1010000000000000000000010100000000000000000000
0  10000000  101000000000000000000002\boxed{0\;10000000\;10100000000000000000000_2}

Decimal check: 5.75+(−2.5)=3.255.75 + (-2.5)=3.25, and 1.1012×21=11.012=3.251.101_2\times 2^1=11.01_2=3.25. Correct.

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.

$N=(-1)^S\times 1.M\times 2^{E-bias}$ $(5.75)_{10} + (-2.5)_{10}$ $5.75 = 101.11_2 = 1.0111\times 2^2$ $2.5 = 10.1_2 = 1.01\times 2^1$ $S_1=0$ $S_2=1$ $E_1=2+127=129=10000001_2$ $M_1=01110000000000000000000$ $E_2=1+127=128=10000000_2$ $M_2=01000000000000000000000$ $2^2$ $1.01\times 2^1 = 0.101\times 2^2$ $M_2' = 0.10100000000000000000000$ $1.01110000000000000000000 - 0.10100000000000000000000 = 0.11010000000000000000000$ $0.1101\times 2^2 = 1.101\times 2^1$ $S=0$ $1+127=128=10000000_2$ $10100000000000000000000$ 0  10000000  101000000000000000000002\boxed{0\;10000000\;10100000000000000000000_2}

5.75+(−2.5)=3.255.75 + (-2.5)=3.25 1.1012×21=11.012=3.251.101_2\times 2^1=11.01_2=3.25

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

  • Floating-point add: align exponents, operate significands, normalize, round
  • 5.75=1.0111x2^2, -2.5=-1.01x2^1; align to 2^2 gives 0.101x2^2
  • Subtract: 1.0111-0.1010=0.1101; normalize to 1.101x2^1 = 3.25
  • IEEE 754 result: 0 10000000 10100000000000000000000
Q2d7MUnit 3 — Instruction types
Core Concept

Explain different types of instructions. Explain various instruction formats with suitable examples.

Answer:

Types of instructions:

  1. Data transfer instructions: Move data between registers, memory, and I/O. Examples: MOV, LOAD, STORE, PUSH, POP.
  2. Arithmetic instructions: Perform arithmetic operations. Examples: ADD, SUB, MUL, DIV, INC, DEC.
  3. Logical instructions: Perform bitwise/logical operations. Examples: AND, OR, XOR, NOT, CMP.
  4. Shift/rotate instructions: Shift or rotate bits. Examples: SHL, SHR, ROL, ROR.
  5. Program control/branch instructions: Change execution sequence. Examples: JMP, JZ, CALL, RET, HLT.
  6. I/O and interrupt instructions: Handle input/output and interrupts. Examples: IN, OUT, INT.

Instruction formats: An instruction format defines layout of opcode and operand/address fields.

Format Structure Example Remarks
Zero-address OP ADD Stack machine; operands implicit on TOS
One-address OP ADDR ADD X Accumulator implied: AC←AC+M[X]AC\leftarrow AC+M[X]
Two-address OP D,S ADD R1,R2 R1←R1+R2R1\leftarrow R1+R2; one source may be overwritten
Three-address OP D,S1,S2 ADD R1,R2,R3 R1←R2+R3R1\leftarrow R2+R3; flexible, longer instruction

Conclusion: Instruction type indicates the operation class, while instruction format indicates how opcode and operands are encoded in the instruction word.

Kinds of instructions and formats. A processor instruction tells the machine what operation to perform and where to find its operands. Instructions are commonly grouped into data transfer instructions such as load, store and move; arithmetic and logic instructions such as add, subtract, AND and shift; control transfer instructions such as branch, jump, call and return; stack instructions such as push and pop; and system instructions such as interrupt return and status manipulation. An instruction format divides the bits of an instruction into an opcode field that selects the operation and operand fields that specify registers, memory addresses or immediate constants. A three address instruction names two sources and one destination, giving compact code but a longer instruction. A two address instruction uses one field as both a source and the destination, and a one address instruction implies the other operand in an accumulator. Zero address stack instructions take their operands implicitly from the stack. Addressing modes such as immediate, direct, indirect, register, register indirect, indexed and relative determine how the effective address is formed and influence the format. A good answer lists the instruction categories with examples, describes at least three formats with bit field diagrams, explains the tradeoff between instruction length and number of instructions, and shows how addressing modes enlarge the effective address space. Mentioning that complex instruction set computers use variable length formats while reduced instruction set computers favour fixed length formats for easy decoding connects the topic to architecture styles.

$AC\leftarrow AC+M[X]$ $R1\leftarrow R1+R2$ $R1\leftarrow R2+R3$
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

  • Data transfer, arithmetic, logical, shift, control/branch, I/O instructions
  • Zero-address: stack-based (ADD)
  • One-address: accumulator-based (ADD X)
  • Two/three-address: register/memory operands; three-address most flexible
Q2e7MUnit 3 — Reduced Instruction Set Computer
Core Concept

Explain the concept of RISC architecture. Discuss its features and advantages. Compare RISC with CISC architecture.

Answer: RISC (Reduced Instruction Set Computer) is a processor architecture that uses a small, simple, and highly optimized set of instructions, typically executed in one clock cycle.

Features of RISC:

  1. Simple instruction set: Few instructions, simple addressing modes.
  2. Fixed instruction length: Easy decoding and pipelining.
  3. Load-store architecture: Only LOAD/STORE access memory; ALU operations are register-to-register.
  4. Large register file: Reduces memory accesses.
  5. Hardwired control preferred: Faster control signal generation.
  6. Efficient pipelining: Uniform instruction format supports high throughput.
  7. Single-cycle execution goal: Most instructions complete in one cycle.

Advantages: High performance through pipelining, simpler hardware design, faster instruction decode, lower power/efficient implementation for many applications.

RISC vs CISC comparison:

Basis RISC CISC
Instruction set Small and simple Large and complex
Instruction length Mostly fixed Variable
Memory access Load/store only Many instructions can access memory
Registers Large register set Fewer registers
Control unit Mostly hardwired Often microprogrammed
Pipelining Easy and efficient More difficult
Code size Larger (more instructions) Smaller (complex instructions)
Example ARM, MIPS, RISC-V x86, VAX

Conclusion: RISC improves speed and pipelining efficiency by simplifying instructions, while CISC reduces program size by providing powerful complex instructions.

A simpler instruction set for faster execution. A reduced instruction set computer is designed around a small set of simple, fixed length instructions that execute in roughly one clock cycle. The philosophy is to make the common case fast by using a load-store architecture in which only load and store instructions access memory and all arithmetic operates on registers. This gives many registers, simple addressing modes, a small number of instruction formats and straightforward hardwired control, which supports deep pipelining and high clock rates. A complex instruction set computer provides many instructions, variable length formats, multiple addressing modes and instructions that can perform several operations and access memory directly. This gives denser code and fewer instructions per program but complicates decoding and control and makes pipelining harder. RISC generally achieves higher throughput through pipelining and simplicity, while CISC saves memory and can offer powerful instructions for specific tasks; modern processors borrow from both, with CISC chips decoding complex instructions into simple internal micro-operations and RISC chips adding some complex instructions. A good answer defines both approaches, lists the features of RISC such as fixed instruction length, few addressing modes, many registers, load-store design and single cycle execution, compares them in a table on code size, clock speed, control complexity and pipelineability, and notes that the distinction has blurred in modern designs. Mentioning that compiler quality is especially important in RISC because complex operations must be composed from simple instructions shows understanding of the tradeoff.

$RISC:\ load/store$ $Fixed\ length\ instructions$
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

  • RISC: small simple instructions, fixed length, load-store, large register file
  • Advantages: easy pipelining, fast decode, efficient execution
  • CISC: complex variable-length instructions, memory-to-memory operations possible
  • RISC vs CISC trade-off: execution simplicity vs code density/complex instructions

Section C

7 Marks Each · 10 questions
Q3a7MUnit 3 — Pipelining
Core Concept

Explain instruction pipelining. A pipeline has 5 stages and each stage takes 20 ns. (i) Calculate the time required to execute 10 instructions without pipelining. (ii) Calculate the execution time with pipelining. (iii) Find the speedup.

Answer: Instruction pipelining is a technique where multiple instructions are overlapped in execution by dividing instruction processing into stages. Different instructions occupy different stages simultaneously, increasing throughput.

Given: 5-stage pipeline, each stage = 20 ns, n=10n=10 instructions.

(i) Time without pipelining: Each instruction takes k×t=5×20=100k\times t = 5\times 20 = 100 ns. For 10 instructions: Tnp=n×k×t=10×5×20=1000T_{np} = n \times k \times t = 10\times 5\times 20 = 1000 ns.

(ii) Time with pipelining: For a kk-stage pipeline, nn instructions take (k+n−1)(k + n - 1) cycles. Tp=(k+n−1)×t=(5+10−1)×20=14×20=280T_p = (k + n - 1)\times t = (5 + 10 - 1)\times 20 = 14\times 20 = 280 ns.

(iii) Speedup:

S=TnpTp=1000280=3.571≈3.57S = \frac{T_{np}}{T_p} = \frac{1000}{280} = 3.571 \approx 3.57
Metric Value
Non-pipelined time 1000 ns
Pipelined time 280 ns
Speedup 3.57

Conclusion: Pipelining reduces total execution time from 1000 ns to 280 ns, giving speedup of about 3.57 for 10 instructions.

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.

$n=10$ $k\times t = 5\times 20 = 100$ $T_{np} = n \times k \times t = 10\times 5\times 20 = 1000$ $k$ $n$ $(k + n - 1)$ $T_p = (k + n - 1)\times t = (5 + 10 - 1)\times 20 = 14\times 20 = 280$ S=TnpTp=1000280=3.571≈3.57S = \frac{T_{np}}{T_p} = \frac{1000}{280} = 3.571 \approx 3.57
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 stages to increase throughput
  • Non-pipelined: 10520 = 1000 ns
  • Pipelined: (5+10-1)*20 = 280 ns
  • Speedup = 1000/280 = 3.57
Q3b7MUnit 3 — Hardwire and micro programmed control: micro programme sequencing
Core Concept

Explain the design and working of a hardwired control unit. Discuss about its advantages and disadvantages.

Answer: A hardwired control unit generates control signals using fixed combinational/sequential logic circuits (gates, decoders, flip-flops, counters) rather than stored microinstructions.

Design and working:

  1. Instruction Register (IR): Holds current instruction; opcode is sent to decoder.
  2. Opcode decoder: Decodes opcode into one active line representing the instruction.
  3. Timing/control counter & clock: A sequence counter/clock generates timing states T0,T1,T2,...T_0,T_1,T_2,... for step-by-step control.
  4. Control logic network: Combinational logic combines decoded opcode, timing signals, flags, and interrupt/status signals to produce required control signals.
  5. Control signal outputs: Signals such as PC load/increment, MAR load, MEMR/MEMW, ALU select, register load/enable are asserted at proper timing.

Working (instruction cycle):

  • Fetch: T0:MAR←PCT_0: MAR\leftarrow PC; T1:IR←M[MAR],PC←PC+1T_1: IR\leftarrow M[MAR], PC\leftarrow PC+1.
  • Decode: Opcode decoded; effective address/control path selected.
  • Execute: Appropriate control signals activate ALU/memory/register transfer for that instruction.
Advantages Disadvantages
Very fast operation (direct hardware) Difficult to design and modify
Efficient for simple/fixed instruction sets Complex wiring for large instruction sets
Less control memory overhead Adding new instructions requires hardware redesign
Good for RISC/simple processors Hard to debug and maintain

Conclusion: Hardwired control is fast because signals are generated directly by logic, but it lacks flexibility compared to microprogrammed control.

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_2,...$ $T_0: MAR\leftarrow PC$ $T_1: IR\leftarrow M[MAR], 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

  • Hardwired CU uses fixed logic: decoder, timing counter, control gates
  • Inputs: opcode, timing states, flags; outputs: control signals
  • Fast execution but difficult to modify/extend
  • Used where speed is critical and instruction set is stable
Q4a7MUnit 3 — micro operations
Core Concept

What are micro-operations? Explain different types of micro-operations.

Answer: Micro-operations are elementary low-level operations performed on data stored in registers during one clock pulse. A machine instruction is executed as a sequence of micro-operations.

Types of micro-operations:

1. Register transfer micro-operations:

  • Transfer data between registers without changing information.
  • Example: R2←R1R2 \leftarrow R1, MAR←PCMAR \leftarrow PC.

2. Arithmetic micro-operations:

  • Perform arithmetic on numeric data.
  • Examples: R3←R1+R2R3 \leftarrow R1 + R2, R1←R1+1R1 \leftarrow R1 + 1, R2←R2−1R2 \leftarrow R2 - 1, R3←R1‾+1R3 \leftarrow \overline{R1}+1 (2's complement).

3. Logic micro-operations:

  • Bitwise operations on non-numeric data.
  • Examples: R3←R1∧R2R3 \leftarrow R1 \land R2 (AND), R3←R1∨R2R3 \leftarrow R1 \lor R2 (OR), R3←R1⊕R2R3 \leftarrow R1 \oplus R2 (XOR), R1←R1‾R1 \leftarrow \overline{R1} (NOT).

4. Shift micro-operations:

  • Shift/rotate register contents.
  • Examples: Logical shift left/right, arithmetic shift right, rotate left/right.
  • Example: R1←shl(R1)R1 \leftarrow shl(R1), R2←shr(R2)R2 \leftarrow shr(R2).
Type Purpose Example
Register transfer Move data R2←R1R2\leftarrow R1
Arithmetic Numeric operation R3←R1+R2R3\leftarrow R1+R2
Logic Bitwise operation R3←R1⊕R2R3\leftarrow R1\oplus R2
Shift Bit movement/rotate R1←shl(R1)R1\leftarrow shl(R1)

Conclusion: Micro-operations are the basic CPU actions; control signals trigger them in proper sequence to implement instructions.

The elementary actions inside an instruction. Micro-operations are the small, atomic actions performed during an instruction cycle, each usually completed in one clock pulse. They are the lowest level of machine activity controlled by the control unit. Register transfer micro-operations move data from one register to another, written symbolically as a source to destination transfer; example include loading the program counter into the address register or moving memory data into a register. Arithmetic micro-operations perform addition, subtraction, complement and increment, and form the basis of the ALU operations. Logic micro-operations perform bitwise AND, OR, XOR and complement, useful for masking and setting bits. Shift micro-operations move bits left or right, with logical shifts filling with zeros, arithmetic shifts preserving the sign and circular shifts wrapping bits around. The instruction cycle itself is a sequence of micro-operations: fetch transfers the program counter to the address register, reads memory into the instruction register and increments the program counter; decode examines the opcode; execute performs the operation-specific micro-operations; and interrupt handling saves the return address. A microprogrammed control unit stores groups of these micro-operations as microinstructions. A good answer defines micro-operations, classifies them into register transfer, arithmetic, logic and shift with symbolic examples, relates them to the instruction cycle and explains how the control unit sequences them. Mentioning that several nonconflicting micro-operations can occur in the same clock cycle is the key to understanding horizontal microprogramming and efficient datapath design.

$R2 \leftarrow R1$ $MAR \leftarrow PC$ $R3 \leftarrow R1 + R2$ $R1 \leftarrow R1 + 1$ $R2 \leftarrow R2 - 1$ $R3 \leftarrow \overline{R1}+1$ $R3 \leftarrow R1 \land R2$ $R3 \leftarrow R1 \lor R2$ $R3 \leftarrow R1 \oplus R2$ $R1 \leftarrow \overline{R1}$ $R1 \leftarrow shl(R1)$ $R2 \leftarrow shr(R2)$ $R2\leftarrow R1$ $R3\leftarrow R1+R2$ $R3\leftarrow R1\oplus R2$ $R1\leftarrow shl(R1)$
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

  • Micro-operations are elementary register-level operations per clock pulse
  • Register transfer: R2<-R1
  • Arithmetic: add/sub/inc/dec; Logic: AND/OR/XOR/NOT
  • Shift: logical/arithmetic shift and rotate
Q4b7MUnit 4 — Basic concept and hierarchy
Core Concept

Explain the memory hierarchy with diagram. A memory chip has a capacity of 64K×864K \times 8. (i) Find the number of address lines required. (ii) How many such chips are needed to design a 256K×16256K \times 16 memory system?

Answer: Memory hierarchy organizes memory into levels based on speed, cost, and capacity so that CPU gets fast access most of the time while maintaining large overall storage.

Hierarchy (top to bottom):

  1. Registers - inside CPU, fastest, smallest, most expensive/bit.
  2. Cache (L1/L2/L3) - SRAM, very fast, small.
  3. Main memory (RAM) - DRAM, moderate speed/cost, larger.
  4. Secondary storage - SSD/HDD, slow, large, non-volatile.
  5. Tertiary/offline - magnetic tape/optical, slowest, very large.

Principle: Locality of reference (temporal and spatial) keeps frequently used data in faster levels. Teff=hT1+(1−h)T2T_{eff}=hT_1+(1-h)T_2.

Level Speed Capacity Cost/bit Volatility
Registers Fastest Very small Highest Volatile
Cache Very fast Small High Volatile
Main memory Moderate Medium Moderate Volatile
Secondary Slow Large Low Non-volatile

Numerical: Memory chip = 64K×864K \times 8.

(i) Address lines required: 64K=21664K = 2^{16} locations. Therefore, 16 address lines are required. Data lines = 8.

(ii) Chips needed for 256K×16256K \times 16:

  • Address expansion: 256K/64K=4256K/64K = 4 times more locations => 4 rows/groups.
  • Data expansion: 16/8=216/8 = 2 chips in parallel for word width.
  • Total chips = 4×2=84 \times 2 = 8 chips.

Fast, small, expensive storage near the CPU. Memory hierarchy organises storage into levels that trade speed against size and cost. At the top are registers inside the processor, which are fastest and smallest, followed by cache levels, main memory, solid state storage, magnetic disks and finally removable or archival media. Each level is larger, slower and cheaper per bit than the one above it. The hierarchy works because of locality of reference: programs tend to access the same locations repeatedly in a short time, called temporal locality, and nearby locations in succession, called spatial locality. Keeping the currently active data in the fastest level therefore gives most accesses short latency. A memory chip of capacity sixty four K by eight has sixteen address lines because sixty four K is two to the sixteen, and eight data lines. To build a two hundred and fifty six K by sixteen memory system requires four times the words and twice the word width, so eight such chips arranged as four banks of two. Cache performance is measured by hit ratio and effective access time, which is hit time plus miss rate times miss penalty. A good answer draws the hierarchy pyramid with representative sizes and speeds, explains both forms of locality, works through the chip count calculation with address and data line reasoning and states why the arrangement is efficient. Mentioning that the hierarchy gives the apparent speed of the fastest memory and the capacity and cost of the cheapest storage is the key idea.

Result: 16 address lines;  8 chips required\boxed{16\text{ address lines};\;8\text{ chips required}}.

$T_{eff}=hT_1+(1-h)T_2$ $64K \times 8$ $64K = 2^{16}$ $256K \times 16$ $256K/64K = 4$ $16/8 = 2$ $4 \times 2 = 8$ $\boxed{16\text{ address lines};\;8\text{ chips required}}$
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.
Memory hierarchy pyramid registers cache main memory faster, smaller, costlier per bit upward; disks and tape below

Key Points

  • Memory hierarchy: registers > cache > main memory > secondary > tertiary
  • Faster levels: smaller, costlier; slower: larger, cheaper
  • 64Kx8 needs 16 address lines (2^16 locations)
  • 256Kx16 needs (256K/64K)(16/8)=42=8 chips
Q5a7MUnit 4 — address mapping and replacement Auxiliary memories: magnetic disk
Core Concept

Explain the following cache mapping techniques: (i) Direct Mapping (ii) Associative Mapping (iii) Set-Associative Mapping

Answer: Cache mapping determines where a main-memory block can be placed in cache.

(i) Direct Mapping:

  • Each main-memory block maps to exactly one cache line: Line=(Block number)mod  (Number of cache lines)Line = (Block\ number) \mod (Number\ of\ cache\ lines).
  • Address fields: Tag | Line/Index | Word/Block offset.
  • Working: CPU checks index line; if tag matches and valid bit is 1, hit occurs; otherwise miss and block is loaded into that fixed line.
  • Advantage: Simple, fast lookup. Disadvantage: Conflict misses when different blocks map to same line.

(ii) Associative Mapping (Fully Associative):

  • A main-memory block can be placed in any cache line.
  • Address fields: Tag | Word/Block offset (no line index).
  • Working: Tag is compared in parallel with all cache lines; hit if any matches.
  • Advantage: Minimum conflict misses, flexible placement. Disadvantage: Expensive parallel comparators, slower/complex hardware.

(iii) Set-Associative Mapping:

  • Cache divided into sets; each block maps to one set but can occupy any line within that set: Set=(Block number)mod  (Number of sets)Set = (Block\ number) \mod (Number\ of\ sets).
  • kk-way set associative means kk lines per set.
  • Address fields: Tag | Set index | Word/Block offset.
  • Working: Index selects set; tags of kk lines compared in parallel.
  • Advantage: Balance between direct and associative. Disadvantage: More hardware than direct mapping.
Mapping Placement Address fields Main advantage Main disadvantage
Direct One fixed line Tag, Index, Offset Simple/fast Conflict misses
Fully associative Any line Tag, Offset Flexible, fewer conflicts Costly parallel compare
Set-associative Any line in a set Tag, Set, Offset Balanced Moderate complexity

Conclusion: Direct is simplest, fully associative is most flexible, and set-associative is the practical compromise used in most processors.

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.

$Line = (Block\ number) \mod (Number\ of\ cache\ lines)$ $Set = (Block\ number) \mod (Number\ of\ sets)$ $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

  • Direct: block maps to one line; Tag|Index|Offset
  • Fully associative: block to any line; Tag|Offset; parallel tag compare
  • Set-associative: block to any line within set; Tag|Set|Offset
  • Trade-off: simplicity vs conflict misses vs hardware cost
Q5b7MUnit 4 — 2D & 2 1/2D memory organization
Core Concept

Explain 2D and 2$\frac{1}{2}$D memory organization. Write their advantages and disadvantages.

Concept. Memory organization describes how individual storage cells are addressed inside a chip. The aim is to reduce the number of address lines and decoders while keeping access fast. Two common arrangements are two dimensional, written as 2D, and two and a half dimensional, written as 2 and a half D.

2D organization. The cells are arranged as a matrix of rows and columns. The address is divided into a row part and a column part. A row decoder activates one word line, and a column decoder selects the required bit line, so exactly one cell is reached by two decoders instead of one large decoder. For example, a 16 kilobit memory can be viewed as 128 rows by 128 columns, needing only seven row address lines and seven column address lines. The output is usually one bit, so several such chips are placed in parallel when a wider word is required.

2 and a half D organization. Here the row and column decoders are shared by several planes, or banks, of cells. The address has three parts: row, column and bank or block select. One row line and one column line are common to all planes, and a small block decoder chooses which plane drives the output. A 1 megabit chip, for instance, can be arranged as 1024 rows by 1024 columns with eight planes, giving an eight bit word. The extra half dimension refers to this stacking of banks rather than a full third address dimension.

Advantages. Two dimensional layout sharply reduces decoder hardware and pin count, gives regular geometry that is easy to fabricate, and keeps access time short. The two and a half D arrangement extends the same benefit to larger capacities, allows a wider data word without duplicating decoders, and supports bank interleaving, which improves throughput.

Disadvantages. Two dimensional memory needs many chips in parallel to obtain a wide word, increasing board area and power. In the two and a half D form, shared lines increase capacitance and delay, bank selection adds a small extra step, and a fault in the shared decoder can disable several banks at once. The design is also harder to test and repair.

Result. Both schemes trade decoder complexity for organised addressing; 2D suits smaller memories and 2 and a half D suits large, wide memories.

$Memory\ array=rows\times cols$ $2.5D:\ stacked\ dies$
Tip from Examiner: Draw the row and column matrix and label the row, column and bank address fields. Always write one advantage and one limitation for each scheme, since marks are usually split evenly between them.

Key Points

  • 2D uses row and column decoders on a cell matrix
  • Address split into row and column fields
  • 2 and a half D shares decoders across banks
  • Bank select adds the third field
  • Trade-off: fewer decoders but longer shared lines
Q6a7MUnit 5 — I/O interface
Core Concept

What is an I/O interface? Explain its functions. Why is an interface required between CPU and I/O devices?

Answer: An I/O interface is a hardware unit that connects CPU/system bus with peripheral devices. It provides buffering, control, status, and signal conversion between CPU and I/O devices.

Functions of I/O interface:

  1. Data buffering: Temporary storage to match speed difference between CPU and peripheral.
  2. Status reporting: Status register indicates READY, BUSY, ERROR, DONE.
  3. Control/command decoding: Control register accepts commands like read, write, start, stop.
  4. Address decoding: Identifies whether addressed device/port is selected.
  5. Data format conversion: Serial-parallel conversion, voltage/level/timing adaptation.
  6. Error detection: Parity/checking mechanisms where applicable.
  7. Interrupt/DMA support: Generates interrupt or coordinates DMA transfer.

Why interface required between CPU and I/O devices:

  • Speed mismatch: CPU is very fast; peripherals are slow/variable.
  • Data format mismatch: CPU uses parallel digital words; devices may use serial/analog/different formats.
  • Different operating modes: Devices have different control protocols.
  • Bus compatibility: Peripherals cannot be directly connected to system bus without control.
  • Timing/control differences: Interface handles synchronization and handshaking.
CPU need Interface role
Speed matching Buffering/latching
Device selection Address decoding/port selection
Device control Command/status registers
Reliable transfer Handshaking, interrupt, error check

Conclusion: I/O interface is essential for compatible, reliable, and efficient communication between CPU and diverse peripherals.

Connecting peripherals to the processor. An input output interface is the circuitry between the CPU and a peripheral device that makes their different speeds, signal levels and timing compatible. Its functions include address decoding so the device responds to its assigned addresses, data buffering so a burst from the CPU can be held until the device is ready, command decoding to interpret read and write requests, status reporting to indicate busy, ready or error conditions, and error detection such as parity checks. An interface is needed because peripherals are much slower than the processor, use different voltage and current levels and may transfer data serially while the CPU uses a parallel bus. I/O ports are the addressable registers through which the processor communicates, usually classified as data ports, status ports and control ports. They may be memory mapped, sharing the same address space as memory and using ordinary load and store instructions, or isolated I/O with a separate address space and special input and output instructions. Peripheral devices include keyboards, mice, printers, disks, displays, scanners and network adapters, each with its own controller. A good answer defines the interface, lists and explains its functions, contrasts memory mapped and isolated I/O, describes the role of ports and gives examples of peripherals. Mentioning that without buffering and handshaking the processor would have to match the exact timing of every device, which is impractical, is the essential justification.

$I/O\ mapped\ vs\ memory\ mapped$ $Port\ address$
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

  • I/O interface connects CPU bus to peripheral devices
  • Functions: buffering, status, control, address decoding, format conversion
  • Needed due to speed, format, timing, protocol mismatches
  • Supports programmed I/O, interrupt I/O, and DMA
Q6b7MUnit 5 — Serial Communication: Synchronous & asynchronous communication
Core Concept

Define and differentiate synchronous and asynchronous communication with example.

Answer:

Basis Synchronous Communication Asynchronous Communication
Clock Common clock/shared timing signal between sender and receiver No common clock; sender and receiver use agreed baud rate
Timing Continuous synchronization Synchronization at character/byte level
Framing Data sent in blocks/frames Each byte framed by start and stop bits
Overhead Low overhead Higher overhead due to start/stop/parity bits
Speed Suitable for high-speed continuous transfer Suitable for low-speed/irregular transfer
Gap between data No random gap in synchronized block Gaps allowed between characters
Example SPI, I2C, synchronous USART, clocked data link UART, RS-232, keyboard-to-computer serial input

Synchronous example: In SPI, master provides SCLK and data is sampled on clock edges. Asynchronous example: UART sends a byte as: idle(1) + start bit(0) + data bits + optional parity + stop bit(1).

Conclusion: Synchronous communication is clock-driven and efficient for continuous streams, while asynchronous communication uses start/stop framing and is simpler for intermittent data.

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

  • Synchronous: shared clock, block/frame transfer, low overhead, high speed
  • Asynchronous: no shared clock, start/stop bits per byte, higher overhead
  • Synchronous examples: SPI/I2C; Asynchronous: UART/RS-232
  • Choice depends on speed, distance, and data regularity
Q7a7MUnit 5 — Interrupts: interrupt hardware
Core Concept

Explain the concept of interrupts. Describe interrupt hardware and explain different types of interrupts.

Answer: An interrupt is a signal that temporarily suspends the normal execution of a program so that CPU can service a higher-priority or urgent event. After servicing, CPU resumes the interrupted program.

Interrupt hardware:

  1. Interrupt request lines (IRQ): Devices raise interrupt signals.
  2. Interrupt controller/priority encoder: Accepts multiple requests, resolves priority, sends one interrupt to CPU.
  3. Interrupt enable/disable flip-flop: Allows CPU to mask or allow interrupts.
  4. Mask register: Enables/disables individual interrupt sources.
  5. Vector address logic/table: Provides ISR starting address (vectored interrupt).
  6. Stack/PC save hardware: Saves return address and processor status.

Working sequence:

  • Device asserts IRQ -> controller prioritizes -> CPU acknowledges after current instruction.
  • CPU saves PC/PSW/register context -> loads ISR address -> executes ISR -> restores context -> returns.

Types of interrupts:

  1. Hardware vs Software: Hardware from external/internal devices; software from program instruction/exception (INT, trap).
  2. Maskable vs Non-maskable (NMI): Maskable can be disabled; NMI cannot.
  3. Vectored vs Non-vectored: Vectored has fixed/supplied ISR address; non-vectored uses common routine/polling.
  4. Internal vs External: Internal from CPU conditions (overflow, divide-by-zero); external from I/O devices.
  5. Priority interrupts: Higher-priority interrupt serviced first; may support nesting.
Type Example Key feature
Maskable Keyboard, printer Can be disabled by CPU
NMI Power failure, memory parity error Cannot be ignored
Vectored Device supplies vector Fast ISR dispatch
Software/Trap Divide by zero, INT instruction Generated by program/CPU condition

Conclusion: Interrupt hardware enables efficient event-driven CPU response, and interrupt types determine priority, masking, and service method.

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.

$Interrupt\ vector\ table$ $Maskable/non-maskable$
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

  • Interrupt suspends normal execution to service urgent event, then resumes
  • Hardware: IRQ lines, priority controller, mask/enable, vector table, context save
  • Types: hardware/software, maskable/NMI, vectored/non-vectored, internal/external
  • ISR address obtained via vector; context saved/restored
Q7b7MUnit 5 — interrupt initiated I/O and Direct Memory Access
Core Concept

Explain the working of Direct Memory Access. Describe the DMA controller and its advantages over other I/O methods.

Answer: Direct Memory Access (DMA) is an I/O transfer technique where a DMA controller transfers data directly between I/O device and main memory without continuous CPU intervention.

Working of DMA:

  1. Initialization: CPU programs DMA controller registers: memory address, word count, direction (read/write), device control.
  2. Bus request: DMA controller requests system bus from CPU using BUS REQUEST.
  3. Bus grant: CPU completes current bus cycle, tri-states bus, and sends BUS GRANT.
  4. Data transfer: DMA controller places address and control signals; data moves directly between memory and I/O device. Word count decremented, address incremented.
  5. Completion: When count becomes zero, DMA sends interrupt to CPU indicating transfer complete.

DMA controller (DMAC): Main components:

  • Address register: Holds memory address.
  • Word count register: Number of words/bytes to transfer.
  • Control register: Transfer direction, mode, device control.
  • Status register: Done, error, busy.
  • Data buffer/bus interface: Handles data and bus signals.

DMA transfer modes: Burst mode, cycle stealing, transparent mode.

Advantages over other I/O methods:

Method CPU involvement Best for
Programmed I/O CPU polls and transfers data Very simple/low-speed
Interrupt I/O CPU handles each transfer via ISR Moderate-speed devices
DMA CPU only initializes and gets completion interrupt High-speed block transfers

Conclusion: DMA improves performance by freeing CPU from byte/word-by-byte transfer, making it superior for large/high-speed I/O data blocks.

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.

$DMA:\ source,\ dest,\ count$ $Cycle\ stealing$
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

  • DMA transfers data directly between I/O and memory via DMAC
  • CPU initializes address, count, direction; DMAC handles transfer
  • DMAC components: address, word count, control, status, bus interface
  • Better than programmed/interrupt I/O for high-speed block transfers