2078

CSC213 · TU past paper

Computer Architecture 2078 question paper

The complete TU 2078 exam paper for Computer Architecture (CSC213), all 12 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 110 marksSequencerAnswer

    Differentiate between hardwired and microprogrammed control unit. Describe with example of microprogram sequencer used in microprogrammed control unit.[10]

    --- A control unit is the component of the CPU that directs the operation of the processor by generating control signals. There are two approaches to designing a control unit: Feature Hardwired Control Unit Microprogrammed Control Unit -...

  2. 210 marksAddressing ModesAnswer

    Explain the various types of addressing modes and compare them algorithm, advantage and disadvantage.[10]

    The addressing mode specifies a rule for interpreting or modifying the address field of an instruction before the operand is actually referenced or executed. In other words, the way in which the operand of an instruction is specified is ...

  3. 310 marksNumericalDivision of Signed magnitude DataAnswer

    Explain the non-restoring division algorithm with flow chart, and hardware implementation diagram. Divide 10/3 using restoring division.[10]

    Non-Restoring Division Algorithm and Restoring Division Example


    1. Non-Restoring Division Algorithm

    In restoring division, after subtracting the divisor, if the partial remainder becomes negative, the divisor is added back (restored). This wastes an operation.

    In non-restoring division, we do NOT restore. Instead, we keep the negative remainder and adjust in the next step:

    • If A is positive (or zero): shift left, then subtract B.
    • If A is negative: shift left, then add B.

    The quotient bit is set based on the sign of A after the operation.

    Algorithm Steps

    Let A = accumulator (initially 0), Q = dividend, B = divisor, SC = n.

    1. Initialize A = 0, load Q with dividend, B with divisor, SC = n.
    2. If sign of A = 0: Shift left AQ, then A = A - B. If sign of A = 1: Shift left AQ, then A = A + B.
    3. If sign of A = 0: set Q[0] = 1. Else set Q[0] = 0.
    4. Decrement SC. If SC ≠ 0, go to step 2.
    5. At end, if A is negative, restore once: A = A + B.
    6. Quotient in Q, Remainder in A.

    2. Flowchart

                     START
                       |
            A=0, load Q=Dividend,
            B=Divisor, SC=n
                       |
            +------> Shift left AQ
            |          |
            |    sign of A = 0 ?
            |      /          \
            |    YES           NO
            |     |             |
            |  A = A - B     A = A + B
            |     \           /
            |      sign of A = 0 ?
            |      /          \
            |    YES           NO
            |  Q[0]=1        Q[0]=0
            |      \          /
            |     SC = SC - 1
            |          |
            |      SC = 0 ?
            |      /      \
            +----NO       YES
                           |
                     sign of A = 1 ?
                      /        \
                    YES         NO
                 A = A + B       |
                      \         /
                  Quotient=Q, Remainder=A
                           |
                         STOP
    

    3. Hardware Implementation Diagram

            +-----------+   +-----------+
            |  B Register|   | Complementer/
            |  (Divisor) |-->| Adder      |
            +-----------+   +------+-----+
                                   |
                  +----------------+
                  v
            +-----------+-----------+     shift left
            |   A (acc) |   Q (Qtnt)|  <-------------
            +-----+-----+-----------+
                  |
            sign bit (MSB of A)
                  |
                  v
            +-----------------+     +-------------+
            | Control Logic   |<--->| Sequence    |
            | (Add / Subtract)|     | Counter SC  |
            +-----------------+     +-------------+
    

    Components: A register (n+1 bits, partial remainder), Q register (holds dividend then quotient), B register (divisor), parallel adder/subtractor with complementer, sign flip-flop, sequence counter SC, and control logic that selects add or subtract based on the sign of A.


    4. Divide 10 / 3 using Restoring Division

    Given data:

    • Dividend = 10
    • Divisor = 3

    Binary representation (4 bits):

    • Dividend $Q = 1010$ (10)
    • Divisor $B = 0011$ (3)
    • $n = 4$
    • $A = 00000$ (initially 0, using 5-bit A to hold sign)
    • $-B = 11101$ (2's complement of 00011)

    The restoring method: shift left AQ, subtract B. If A < 0, set Q[0]=0 and restore (add B back); else set Q[0]=1.

    StepOperationAQAction
    Init000001010SC = 4
    1Shift left AQ00001010_
    A = A - B111100100A<0, restore: Q[0]=0
    Restore A=A+B000010100
    2Shift left AQ00010100_
    A = A - B111111000A<0, restore: Q[0]=0
    Restore A=A+B000101000
    3Shift left AQ00101000_
    A = A - B000100001A≥0, Q[0]=1
    4Shift left AQ00100010_
    A = A - B000010011A≥0, Q[0]=1

    After 4 iterations:

    • Quotient $Q = 0011 = 3$
    • Remainder $A = 00001 = 1$

    Verification: $10 = 3 \times 3 + 1$ ✓

    Final Result

    $$\boxed{\text{Quotient} = 3, \quad \text{Remainder} = 1}$$

  4. 45 marksCommon Bus System for Basic ComputerAnswer

    Explain the bus interconnection scheme with diagram. [5]

    A bus is a set of conducting wires (lines) that connect multiple components of a computer system and serve as a shared communication pathway for transferring data, addresses, and control signals between the CPU, memory, and I/O devices. ...

  5. 55 marksInstruction FormatsAnswer

    What do you mean by instruction format? Explain with an example. [5]

    Instruction Format

    Definition

    An instruction format defines the layout or structure of a binary instruction stored in memory. It specifies how the bits of an instruction are divided into different fields, each carrying specific information needed by the CPU to execute that instruction.

    The simplest way to organize a computer is to have a single processor register called the accumulator, and an instruction format with two parts:

    • First part (Opcode field): Specifies the operation to be performed (e.g., ADD, SUB, LOAD, STORE).
    • Second part (Address field): Specifies the memory address where the operand is located, i.e., tells the control unit where to find the operand in memory.

    General Structure of an Instruction Format

    +------------------+----------------------+
    |   Opcode (bits)  |   Address (bits)     |
    +------------------+----------------------+
    

    Example: Basic Computer Instruction Format (16-bit)

    In a basic computer, each instruction is 16 bits long, organized as follows:

    Bit position:  15      14  13  12      11  10  9  ...  0
                   +-------+---+---+-------+---+---+-------+
                   |   I   | Opcode (3)    |  Address (12) |
                   +-------+---+---+-------+---+---+-------+
    
    FieldBitsPurpose
    I (Indirect bit)Bit 15Indicates direct (0) or indirect (1) addressing
    OpcodeBits 12 to 14Specifies the operation (3 bits = 8 possible operations)
    AddressBits 0 to 11Specifies the memory address of the operand (12 bits = 4096 locations)

    How It Works During Fetch and Decode

    According to the fetch-decode cycle:

    • T0: AR <- PC (Address Register gets the Program Counter value)
    • T1: IR <- M[AR], PC <- PC + 1 (Instruction is fetched from memory into Instruction Register)
    • T2: Decode IR(12-14), AR <- IR(0-11), I <- IR(15) (Opcode bits 12-14 are decoded; address bits 0-11 are loaded into AR; indirect bit is noted)

    Example Instruction

    Suppose a 16-bit instruction is:

    0  001  000000000101
    ^   ^        ^
    I  Opcode   Address (5)
    
    • I = 0 → Direct addressing
    • Opcode = 001 → Could represent an ADD operation
    • Address = 5 → Operand is located at memory address 5

    This means: "Add the value stored at memory location 5 to the accumulator directly."


    Summary

    Instruction format is essential because it tells the CPU what to do (opcode) and where to find the data (address). The design of the instruction format directly affects the number of operations supported and the size of addressable memory.

  6. 65 marksData Transfer and manipulationAnswer

    Explain the data transfer instructions with example. [5]

    Data transfer instructions are a category of computer instructions used to move data between registers, memory, and I/O devices without performing any arithmetic or logical operation on the data. They form the most fundamental class of i...

  7. 75 marksSymbolic MicroinstructionsAnswer

    Explain the symbolic microinstruction with example. [5]

    Each line of an assembly language microprogram defines a symbolic microinstruction. A symbolic microinstruction uses symbolic (human-readable) notation to represent the microoperations, control, and branching information that the control...

  8. 85 marksInstruction Level PipeliningAnswer

    Explain an instruction pipeline with an example. [5]

    An instruction pipeline is a technique used to improve CPU performance by overlapping the execution of multiple instructions. Instead of completing one instruction fully before starting the next, the processor divides instruction executi...

  9. 95 marksBooth MultiplicationAnswer

    Explain the Booth Multiplication algorithm with example. [5]

    Booth's algorithm gives a procedure for multiplying binary integers in signed 2's complement representation. It handles both positive and negative numbers efficiently by replacing a sequence of additions with shifts, reducing the number ...

  10. 105 marksCache MemoryAnswer

    What are the advantage and disadvantage of direct mapping and associative mapping between cache and main memory? [5]

    In direct mapping, each main memory location can only be copied into one specific location in the cache. Main memory is divided into pages that correspond in size with the cache, and each memory block maps to exactly one cache line deter...

  11. 115 marksDirect Memory Access, Input-Output ProcessAnswer

    What are the major differentiate between Input-output processor (IOP) and direct memory Access (DMA) [5]

    Differences Between Input-Output Processor (IOP) and Direct Memory Access (DMA)

    Brief Introduction

    DMA (Direct Memory Access) is a data transfer mechanism between memory and I/O devices controlled by an external DMA controller circuit, without CPU involvement during the actual transfer.

    IOP (Input-Output Processor) is a more advanced processor with direct memory access capability that can execute its own channel programs stored in main memory, communicating independently with I/O devices.


    Major Differences

    FeatureDMAIOP
    Intelligence / CapabilityA simple controller circuit; can only transfer data between memory and I/O devicesA full processor; can execute a set of instructions called a channel program stored in main memory
    Program ExecutionCannot execute programs; only performs data transfer operationsCan execute a channel program independently once initiated by the CPU
    CPU InvolvementCPU must set up the DMA controller (source, destination, count) before each transferCPU only issues a channel I/O class instruction to initiate; after that, IOP operates completely independently
    Bus Control MethodUses HOLD/HLDA signals (Bus Request BR and Bus Grant BG) to take control of the bus from the CPUAccesses memory using cycle stealing, without fully taking over the bus
    ComplexitySimpler in design and functionalityMore complex; essentially a dedicated I/O processor
    FlexibilityLimited to simple block data transfersHighly flexible; can handle complex I/O operations through programmable channel programs
    Interaction with CPUInterrupts CPU via HOLD line; CPU places buses in high impedance state during burst transfer or cycle stealingOnce initiated, the channel (IOP) operates independently of the CPU with minimal interruption
    Transfer ModesSupports Burst Transfer and Cycle StealingPrimarily uses Cycle Stealing to access main memory
    Use CaseSuitable for simple, high-speed bulk data transfers (e.g., hard disk to memory)Suitable for managing multiple, complex I/O devices simultaneously

    Summary

    DMA is a hardware controller that temporarily takes over the system bus to transfer data directly between memory and I/O without CPU processing. IOP is a dedicated processor that goes further by executing its own channel programs stored in memory, managing I/O operations fully independently after a single initiation command from the CPU. IOP is therefore a superset of DMA functionality.

  12. 125 marksParallel ProcessingAnswer

    Draw a three dimensional hypercube and explain with example. [5]

    --- A hypercube (also called an n-cube) is a geometric structure used in computer architecture and graph theory to represent interconnection networks. An n-dimensional hypercube has: - 2^n nodes (vertices) - Each node is labeled with an ...