2077

CSC213 · TU past paper

Computer Architecture 2077 question paper

The complete TU 2077 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. Q1.10 marksNumericalPipeliningAnswer

    What do you mean by pipeline? Explain with space time diagram for a six segmented pipeline showing the time it takes to process eight tasks.[10]

    Pipeline: Definition and Space-Time Diagram

    Given

    • Number of pipeline segments: $k = 6$
    • Number of tasks to be processed: $n = 8$

    (All required numeric values are present.)


    Solution

    What is a Pipeline?

    A pipeline is a technique of decomposing a sequential process into sub-operations, with each sub-operation being executed in a dedicated segment that operates concurrently with all other segments. Information flows through the segments much like an industrial assembly line: while one segment works on one task, another segment simultaneously works on a different task.

    Each segment consists of a combinational circuit that performs a sub-operation, followed by a register (latch) that holds the intermediate result to be passed to the next segment on the next clock pulse. All registers are controlled by a common clock.

    The diagram that shows which segment is busy with which task at each clock period is called a space-time diagram.


    Total Time for a k-Segment Pipeline Processing n Tasks

    For a $k$-segment pipeline executing $n$ tasks, the number of clock cycles required is:

    $$\text{Total Clock Cycles} = k + (n - 1)$$

    Substituting $k = 6$ and $n = 8$:

    $$= 6 + (8 - 1) = 6 + 7 = \boxed{13 \text{ clock cycles}}$$

    • The first task fills all 6 segments and completes at the end of clock cycle 6.
    • Thereafter, one task completes at every clock cycle, so the remaining 7 tasks finish in the next 7 cycles (cycles 7 to 13).

    Space-Time Diagram (6 segments, 8 tasks)

    Segment |               Clock Cycles
            |  1   2   3   4   5   6   7   8   9  10  11  12  13
    --------|------------------------------------------------------
      S1    | T1  T2  T3  T4  T5  T6  T7  T8   .   .   .   .   .
      S2    |  .  T1  T2  T3  T4  T5  T6  T7  T8   .   .   .   .
      S3    |  .   .  T1  T2  T3  T4  T5  T6  T7  T8   .   .   .
      S4    |  .   .   .  T1  T2  T3  T4  T5  T6  T7  T8   .   .
      S5    |  .   .   .   .  T1  T2  T3  T4  T5  T6  T7  T8   .
      S6    |  .   .   .   .   .  T1  T2  T3  T4  T5  T6  T7  T8
    

    Each task moves diagonally through the six segments.

    TaskCompletes at cycle
    T16
    T27
    T38
    T49
    T510
    T611
    T712
    T813

    Speedup Compared with Non-Pipelined Execution

    MethodTime Required
    Non-pipelined$n \times k = 8 \times 6 = 48$ cycles
    Pipelined$k + (n-1) = 13$ cycles

    Speedup:

    $$S = \frac{n \times k}{k + (n-1)} = \frac{48}{13} \approx 3.69$$

    As $n \to \infty$, the maximum speedup approaches $k = 6$.


    Conclusion

    A pipeline overlaps the execution of tasks across multiple segments. A six-segment pipeline processing eight tasks needs only 13 clock cycles (against 48 without pipelining), giving a speedup of about 3.69. The space-time diagram confirms that once the pipeline is full (from cycle 6), one task completes every clock cycle.

  2. Q2.10 marksNumericalBooth MultiplicationAnswer

    Explain Booth multiplication algorithm with hardware implementation diagram. Multiply (-4) x (-3) using Booth multiplication algorithm.[10]

    Booth's algorithm is a technique for multiplying two signed binary numbers represented in 2's complement form. It treats both positive and negative multipliers uniformly and reduces the number of arithmetic operations by examining pairs of adjacent bits, taking advantage of strings of 0's and 1's...

  3. Q3.10 marksModes of TransferAnswer

    Define I/O interface. Comparison between programmed I/O, Interrupt driven I/O and direct memory access (DMA).[10]

    --- An Input/Output (I/O) Interface provides a method for transferring information between internal storage (CPU/Memory) and external I/O devices (peripherals). It is needed because several differences exist between the computer and peripheral devices: Difference Explanation ------ Speed mismatch...

  4. Q4.5 marksProgram Interrupt & Interrupt CycleAnswer

    Draw an instruction cycle state diagram with interrupt and explain it. [5]

    --- When the computer starts, the following registers are initialized: - SC (Sequence Counter) is cleared to 0 - IEN (Interrupt Enable flip-flop) is cleared to 0 - R (Interrupt Request flip-flop) is cleared to 0 --- The instruction cycle begins with fetch and decode: Timing Signal Operation Descr...

  5. Q5.5 marksRegister Transfer LanguageAnswer

    Explain register transfer language with example. [5]

    Register Transfer Language (RTL) is a symbolic notation used to describe the micro-operations and data transfers that occur among registers in a digital computer. It provides a concise and formal way to express how data moves between registers and what operations are performed on that data. --- C...

  6. Q6.5 marksNumericalInstruction FormatsAnswer

    Write codes using 3, 2 and 1 address instruction formats to perform the given operations. $X = A/B + C * D/C$ [5]

    • Expression to evaluate: $X = A/B + C \ast D / C$ - Required formats: 3-address, 2-address, 1-address instructions. $$X = (A/B) + ((C \ast D)/C)$$ Sub-operations: 1. $T1 = A/B$ 2. $T2 = C \ast D$ 3. $T3 = T2/C$ 4. $X = T1 + T3$ --- Format: OPCODE Dest, Src1, Src2 Instruction Operation ------ DIV...
  7. Q7.5 marksAddressing ModesAnswer

    Explain the various addressing modes with example. [5]

    An addressing mode specifies how the operand (or the address of the operand) is determined from the instruction. Different addressing modes provide flexibility in accessing data stored in registers, memory, or within the instruction itself. --- - The operand is directly specified within the instr...

  8. Q8.5 marksDesign of Control UnitAnswer

    Differentiate between hardwired control unit and microprogrammed control unit. [5]

    Differences Between Hardwired Control Unit and Microprogrammed Control Unit

    Definitions

    Hardwired Control Unit: A control unit in which control signals are generated by hardware using conventional logic design techniques. It generates a specific sequence of control signals directly through logic circuits.

    Microprogrammed Control Unit: A control unit whose binary control variables (control signals) are stored in a special memory called control memory. Control signals are generated with the help of micro-instructions stored in that memory.


    Comparison Table

    BasisHardwired Control UnitMicroprogrammed Control Unit
    Signal GenerationControl signals are generated using hardware logic circuitsControl signals are generated using micro-instructions stored in control memory
    SpeedFaster, since signals are produced directly by hardwareSlower, since micro-instructions must be fetched and decoded
    ModifiabilityDifficult to modify; changes require rewiring the hardwareEasy to modify; only the micro-instructions (software level) need to be changed
    CostExpensive, as everything must be realized in terms of logic gatesLess expensive, as only micro-instructions are used
    ComplexityCannot handle complex instructions efficientlyCan handle complex instructions easily
    UsageUsed in RISC (Reduced Instruction Set Computers)Used in CISC (Complex Instruction Set Computers)
    StorageNo control memory requiredRequires a dedicated control memory to store the microprogram

    Summary

    In short, a hardwired control unit trades flexibility for speed and simplicity, while a microprogrammed control unit trades speed for flexibility and the ability to handle complex instruction sets. Modern RISC processors prefer hardwired design, whereas traditional CISC processors (such as Intel x86) rely on microprogramming.

  9. Q9.5 marksPipeliningAnswer

    How performance of computer is increased using pipeline? Explain with practical example. [5]

    A pipeline is a technique where multiple instruction phases are overlapped in execution to improve the throughput of a computer. Instead of completing one instruction fully before starting the next, different stages of different instructions are executed simultaneously, much like an assembly line...

  10. Q10.5 marksDivision of Signed magnitude DataAnswer

    Differentiate between restoring division and non-restoring division. [5]

    Both are hardware algorithms used to divide unsigned integers using shift and subtract operations, but they differ in how they handle the case when the partial remainder becomes negative. --- Feature Restoring Division Non-Restoring Division --------- Basic Idea If partial remainder becomes negat...

  11. Q11.5 marksCache MemoryAnswer

    Give the appropriate reasons why replacement algorithm is required in associative mapping? [5]

    In associative mapping, any block from main memory can be loaded into any line (slot) of the cache. This is the most flexible cache organization because there is no restriction on placement. However, this very flexibility creates a critical problem that makes a replacement algorithm necessary. --...

  12. Q12.5 marksInput-Output InterfaceAnswer

    Differentiate between isolated versus memory mapped I/O. [5]

    Isolated I/O and Memory-Mapped I/O are two different techniques used by a CPU to communicate with I/O devices. They differ primarily in how address spaces and instructions are organized. --- Feature Isolated I/O Memory-Mapped I/O --------- Instructions CPU has distinct input and output instructio...