COA · Question paper

CET-1 · 21 Aug 2025

Computer Architecture (C2310C2) · Continuous Evaluation Test CET-1 · 21 August 2025 · 30 marks · 10:30 am – 12:00 pm ITM (SLS) Baroda University · B.Tech CSE/IT/CSN/AI&DS, odd semester 2025-26 · Semester 3. All questions mandatory; choices within questions. Questions transcribed from the original paper. Solutions are written by CampusLoop; check them against your class notes.

Q1. Six MCQs of 1 mark each [6]

1. In an instruction format, the part that specifies the operation to be performed is called the: a) Operand · b) Opcode · c) Address field · d) Instruction register Answer: (b) Opcode.

2. The term "bus" in computer architecture refers to: a) power supply system · b) a pathway for transferring data between different parts of a computer · c) memory management system · d) software layer for I/O Answer: (b).

3. Which register stores the current instruction being executed? a) MAR · b) PC · c) IR · d) Accumulator Answer: (c) Instruction Register (IR).

4. The process of converting a high-level language program into machine code is known as: a) Compiling · b) Assembling · c) Debugging · d) Interpreting Answer: (a) Compiling. (Assembling converts assembly language.)

5. In a CPU, the instruction register (IR) holds the: a) address of the next instruction · b) currently executing instruction · c) data to be processed · d) address of the data Answer: (b). (The PC holds the address of the next instruction.)

6. Which represents the binary equivalent of decimal 15? a) 000F · b) 1111 · c) 11F · d) F000 Answer: (b) 1111. (000F is the hexadecimal form.)

Q2. Answer any two (out of four) [6]

Q2(a) Define the instruction cycle and explain its phases with a diagram.

The instruction cycle is the sequence a CPU repeats for every instruction: fetch → decode → (read effective address) → execute, then check for interrupts.

  • Fetch: T0: AR ← PC; T1: IR ← M[AR], PC ← PC + 1.
  • Decode: T2: D0…D7 ← decode IR(12–14), AR ← IR(0–11), I ← IR(15).
  • Effective address: T3: if I = 1, AR ← M[AR] (indirect).
  • Execute: perform the operation; then SC ← 0 and repeat. Flowchart and details: COA end-sem 2025, Q3.2.

Q2(b) Functions of accumulator registers in ALU design.

The accumulator (AC) is the main processor register in an accumulator-based CPU:

  • Holds one operand of arithmetic/logic operations and receives the result (e.g. ADD: AC ← AC + DR).
  • Is the source and destination of load/store: LDA (AC ← M[AR]), STA (M[AR] ← AC).
  • Its outputs feed the ALU and its inputs come from the ALU, so results can be chained without memory traffic.
  • Supports register-reference operations: CLA, CMA, CIR, CIL, INC, and tests SPA, SNA, SZA.
  • Works with the E (carry) flip-flop for addition carries and circular shifts. This allows one-address instructions (only the memory operand is named), simplifying the instruction format and the ALU data path.

Q2(c) Explain memory-reference instructions with examples.

In the basic computer, an instruction with opcode 000–110 refers to memory (I bit selects direct/indirect). The operand address is in AR after decoding; execution starts at T4:

SymbolOperationRTL (from T4)
ANDAND memory word to ACD0T4: DR ← M[AR]; D0T5: AC ← AC ∧ DR, SC ← 0
ADDadd memory word to ACD1T4: DR ← M[AR]; D1T5: AC ← AC + DR, E ← Cₒᵤₜ, SC ← 0
LDAload into ACD2T4: DR ← M[AR]; D2T5: AC ← DR, SC ← 0
STAstore ACD3T4: M[AR] ← AC, SC ← 0
BUNbranch unconditionallyD4T4: PC ← AR, SC ← 0
BSAbranch and save return addressD5T4: M[AR] ← PC, AR ← AR + 1; D5T5: PC ← AR, SC ← 0
ISZincrement and skip if zeroD6T4: DR ← M[AR]; D6T5: DR ← DR + 1; D6T6: M[AR] ← DR, if DR = 0 then PC ← PC + 1, SC ← 0

Example: ADD 500 adds the word at address 500 to AC.

Q2(d) Describe the interrupt cycle in simple terms.

When an I/O device is ready and interrupts are enabled (IEN = 1), the interrupt flip-flop R is set to 1 at the end of an instruction (in place of the next fetch). The interrupt cycle then saves the return address and jumps to the service routine:

  • RT0: AR ← 0, TR ← PC
  • RT1: M[AR] ← TR, PC ← 0 (return address stored in location 0)
  • RT2: PC ← PC + 1, IEN ← 0, R ← 0, SC ← 0 (jump to location 1, which branches to the service routine; further interrupts disabled) The service routine handles the device, re-enables interrupts (ION) and returns with BUN 0 I (indirect branch via location 0).

Q3. Answer any two (out of four) [6]

Q3(a) What is an instruction code? Explain PC and IR.

An instruction code is a group of bits that tells the computer to perform a specific operation. It has an opcode (which operation) and an address/operand field (which data), and in the basic computer a mode bit I (direct/indirect): | I | opcode (3 bits) | address (12 bits) |.

  • Program Counter (PC): holds the address of the next instruction; incremented after each fetch (PC ← PC + 1), changed by branch instructions.
  • Instruction Register (IR): holds the instruction currently being executed, loaded during fetch (IR ← M[AR]) and decoded by the control unit.

Q3(b) List and explain three types of computer instructions with examples.

The basic computer has 16-bit instructions of three types:

  1. Memory-reference (opcode 000–110): address field points to memory; I selects direct/indirect. Example: ADD 457 (AC ← AC + M[457]), LDA, STA, BUN.
  2. Register-reference (opcode 111, I = 0): operate on AC/E; no memory operand. Example: CLA (7800h, clear AC), CMA, INC, SZA.
  3. Input–output (opcode 111, I = 1): communicate with I/O and interrupts. Example: INP (F800h, AC(0–7) ← INPR), OUT, ION, IOF.

Q3(c) RTL statements: (1) complement R3 (2) increment R2 by 1.

  1. R3 ← R3′ (logic micro-operation: each bit of R3 is inverted; equivalently R3 ← R3 ⊕ 1…1).
  2. R2 ← R2 + 1 (arithmetic micro-operation: increment). With a control condition: P: R2 ← R2 + 1 executes only when control function P = 1.

Q3(d) What are logic micro-operations? Give examples.

Logic micro-operations perform bitwise operations on register contents, each bit independently:

OperationRTLUse
ANDR1 ← R1 ∧ R2selective clear / masking (clear bits where R2 = 0)
ORR1 ← R1 ∨ R2selective set (set bits where R2 = 1)
XORR1 ← R1 ⊕ R2selective complement, compare
ComplementR1 ← R1′invert all bits
ClearR1 ← 0
SetR1 ← all 1s

Example: R1 = 1010, R2 = 1100 → AND = 1000, OR = 1110, XOR = 0110. There are 16 possible logic functions of two variables.

Q4. Answer any two (out of four) [6]

Q4(a) Define register transfer language (RTL) with an example.

RTL is a symbolic notation describing micro-operations among registers, e.g. R2 ← R1, P: R2 ← R1, T1: IR ← M[AR], PC ← PC + 1. Full answer: COA end-sem 2025, Q3.1.

Q4(b) Explain the working of an Arithmetic Logic Shift Unit (ALSU).

An ALSU combines arithmetic, logic and shift circuits for one bit stage (repeated n times) and selects the result with a 4:1 multiplexer:

  • Inputs Aᵢ, Bᵢ, carry Cᵢ, and shift inputs Aᵢ₋₁ (for shr) and Aᵢ₊₁ (for shl).
  • Select lines S₃S₂ choose the unit: 00 arithmetic, 01 logic, 10 shift right, 11 shift left.
  • S₁S₀ and Cᵢₙ select the specific arithmetic operation (add, add with carry, subtract, increment, decrement, transfer) or logic operation (AND, OR, XOR, complement).
  • The arithmetic unit's carry Cᵢ₊₁ goes to the next stage.

So one common circuit performs all micro-operations in one clock, chosen by S₃…S₀ and Cᵢₙ. Draw: one stage with the arithmetic circuit, logic circuit and two shift inputs feeding a 4×1 MUX controlled by S₃S₂.

Q4(c) What are arithmetic micro-operations? Write examples in RTL.

RTLDescription
R3 ← R1 + R2add
R3 ← R1 − R2 (= R1 + R2′ + 1)subtract (2's complement)
R2 ← R2′1's complement
R2 ← R2′ + 12's complement (negate)
R3 ← R1 + R2′ + 1subtraction
R1 ← R1 + 1increment
R1 ← R1 − 1decrement

They are implemented with a binary adder (and multiplexers on the B inputs). Multiplication and division are not single micro-operations; they are sequences of adds and shifts.

Q4(d) Design a common bus system using registers.

For k registers of n bits use n multiplexers of size k × 1; bit i of every register goes into MUX i, and the common select lines choose one register to drive the bus. With 4 registers (A, B, C, D) of 4 bits: four 4×1 MUXes, select lines S₁S₀ (00 → A, 01 → B, 10 → C, 11 → D). The bus outputs connect to every register's inputs; the destination is chosen by its load control. Example: C ← A: S₁S₀ = 00 and load C = 1.

In the basic computer, a 16-bit bus connects memory and 7 registers (AR, PC, DR, AC, IR, TR, plus INPR/OUTR), selected by S₂S₁S₀. Alternatively the bus can be built with tri-state buffers and a decoder (COA end-sem 2025, Q4.5).

Q5. Answer any two (out of four) [6]

Q5(a) Sequence of micro-operations to execute STA, BSA, ISZ and BUN.

After fetch/decode (T0–T3), AR holds the effective address:

  • STA: D3T4: M[AR] ← AC, SC ← 0.
  • BUN: D4T4: PC ← AR, SC ← 0.
  • BSA: D5T4: M[AR] ← PC, AR ← AR + 1; D5T5: PC ← AR, SC ← 0. (Stores the return address at the subroutine's first word and continues at the next word.)
  • ISZ: D6T4: DR ← M[AR]; D6T5: DR ← DR + 1; D6T6: M[AR] ← DR, if (DR = 0) then (PC ← PC + 1), SC ← 0.

Q5(b) Design the 4-bit arithmetic circuit.

A 4-bit parallel adder with 4:1 MUXes on the B inputs (S₁S₀ select B, B′, 0 or all 1s) and input carry Cᵢₙ gives add, add with carry, subtract, subtract with borrow, transfer, increment and decrement. Function table and block diagram: COA end-sem 2025, Q2.6.

Q5(c) Define (i) microcode (ii) microinstruction.

  • Microinstruction: a control word stored in control memory; its bits specify one or more micro-operations for one clock step, plus fields for the next-address/branch condition (e.g. F1 F2 F3 | CD | BR | AD).
  • Microcode / microprogram: the sequence of microinstructions that implements a machine instruction (and the fetch routine); together they form the firmware of a microprogrammed control unit.

Q5(d) Explain the control unit of the basic computer with a diagram.

Components:

  • IR (instruction register): bits 12–14 go to a 3×8 decoder → D0…D7 (which instruction); bit 15 → I flip-flop (addressing mode); bits 0–11 are the address.
  • Sequence counter (SC) (4-bit) with a 4×16 decoder → timing signals T0…T15; incremented each clock, cleared by SC ← 0.
  • Control logic gates: combine Dᵢ, Tⱼ, I and status flags to generate control outputs (register loads, bus selects S₂S₁S₀, memory read/write, ALU operations).

This is a hardwired control unit: e.g. D3T4 activates "write memory, select AC on bus" for STA. Draw IR → decoders → control gates → outputs, with SC and its decoder feeding the gates.