Chapter 2
Computer Architecture
TU BSc CSIT past exam questions
Past questions and answers
72 questions set from this chapter. Most repeated first.
- 2079 · 5 marks
Explain common bus system for basic computer.
Similar questions: Explain common bus system of basic computer (2081)
Answer
Common bus system. In the basic computer, the registers and memory are connected through a single common bus of 16 lines, so that any register can send data to any other by using one shared set of wires. Only one source can drive the bus at any time. The source is chosen by a bus selector built from 16 multiplexers (4-to-1 style, 8 inputs), controlled by the select lines .
| Register placed on the bus | |
|---|---|
| 000 | none |
| 001 | AR (address register, 12 bits) |
| 010 | PC (program counter, 12 bits) |
| 011 | DR (data register) |
| 100 | AC (accumulator) |
| 101 | IR (instruction register) |
| 110 | TR (temporary register) |
| 111 | Memory (4096 x 16) |
Diagram:
+------------- 16-bit common bus --------------+
| | | | | | | | |
MEM AR PC DR AC IR TR INPR OUTR
(111) (001) (010) (011) (100) (101) (110)
^ select by S2 S1 S0 (bus selector / multiplexers)
Operation:
- The bus selector places the contents of the selected register on the bus.
- A destination register receives the data when its LD (load) control is at the clock edge. Registers also have INR (increment) and CLR (clear) inputs.
- The 12-bit registers AR and PC use the lower 12 bits of the bus; the memory address is always taken from AR.
- Memory read: puts memory on the bus () and loads DR. Memory write: with DR on the bus.
- Example : and LD of AR .
- The adder and logic unit takes AC and DR as inputs and its output goes to AC; the output of AC is also an input to the bus.
Advantage: fewer connections than separate paths between every pair of registers. Disadvantage: one transfer at a time over the bus.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Write the program for the following statement using three, single, zero address instructions.
X = (AB+C-D) / (E+FG)
Similar questions: Write the program for following statement by (2080)
Answer
Statement:
(a) Three-address instructions (OP dest, src1, src2):
MUL R1, A, B ; R1 = A*B
ADD R1, R1, C ; R1 = A*B + C
SUB R1, R1, D ; R1 = A*B + C - D
MUL R2, F, G ; R2 = F*G
ADD R2, R2, E ; R2 = E + F*G
DIV X, R1, R2 ; X = R1 / R2
(b) Single-address (accumulator) instructions (AC is the implied operand):
LOAD F ; AC = F
MUL G ; AC = F*G
ADD E ; AC = E + F*G
STORE T ; T = E + F*G
LOAD A ; AC = A
MUL B ; AC = A*B
ADD C ; AC = A*B + C
SUB D ; AC = A*B + C - D
DIV T ; AC = (A*B+C-D) / T
STORE X ; X = AC
(c) Zero-address (stack) instructions (operands are on the stack, the operation uses the top elements):
PUSH A
PUSH B
MUL ; A*B
PUSH C
ADD ; A*B + C
PUSH D
SUB ; A*B + C - D
PUSH E
PUSH F
PUSH G
MUL ; F*G
ADD ; E + F*G
DIV ; (A*B+C-D) / (E+F*G)
POP X
This is the evaluation of the reverse Polish form .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Write the program for following statement by using three, single, zero address instructions.
X = (A+BC-D)/(EF+G)
Similar questions: Write the program for the following statement (2079)
Answer
Evaluate . The numerator is and the denominator is .
(a) Three-address instructions (each instruction OP dest, src1, src2). Temporary registers R1 and R2 are used.
MUL R1, B, C ; R1 = B*C
ADD R1, R1, A ; R1 = A + B*C
SUB R1, R1, D ; R1 = A + B*C - D
MUL R2, E, F ; R2 = E*F
ADD R2, R2, G ; R2 = E*F + G
DIV X, R1, R2 ; X = R1 / R2
(b) Single-address (accumulator) instructions. One operand is in memory, the other is the accumulator AC. T is a temporary memory location.
LOAD B ; AC = B
MUL C ; AC = B*C
ADD A ; AC = A + B*C
SUB D ; AC = A + B*C - D
STORE T ; T = numerator
LOAD E ; AC = E
MUL F ; AC = E*F
ADD G ; AC = E*F + G
STORE U ; U = denominator
LOAD T ; AC = numerator
DIV U ; AC = numerator / denominator
STORE X ; X = AC
(c) Zero-address (stack) instructions. Operations take their operands from the top of the stack. The expression is converted to reverse Polish notation: .
PUSH A
PUSH B
PUSH C
MUL ; B*C
ADD ; A + B*C
PUSH D
SUB ; A + B*C - D
PUSH E
PUSH F
MUL ; E*F
PUSH G
ADD ; E*F + G
DIV ; (A+B*C-D) / (E*F+G)
POP X
The three-address program is shortest (6 instructions) but each instruction is long; the stack program has the shortest instructions but needs the most (14).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Explain common bus system of basic computer with a diagram.
Similar questions: Explain common bus system for basic computer (2079)
Answer
Common bus system. The basic computer has registers (AR, PC, DR, AC, IR, TR), a memory unit with 4096 words of 16 bits, and the INPR/OUTR registers. For data to move between them, instead of a dedicated path for each pair, a single shared common bus is used. The bus is 16 bits wide, and only one register or memory output can place data on it at one time.
Selection of the source. Three select lines drive a multiplexer (or three-state buffers) that picks the source:
| Register placed on bus | |
|---|---|
| 000 | none |
| 001 | AR |
| 010 | PC |
| 011 | DR |
| 100 | AC |
| 101 | IR |
| 110 | TR |
| 111 | Memory |
Diagram (description).
+------------------------------+
S2 S1 S0 ->| 16-bit common bus (mux) |
+--^---^---^---^---^---^---^---+
| | | | | | |
Memory AR PC DR AC IR TR
(111) (001)(010)(011)(100)(101)(110)
Each register has LD (load), INR (increment), CLR (clear).
AR, PC and the memory address use the 12 low-order bits;
AC <-> ALU <-> DR; INPR -> ALU; AC -> OUTR.
Operation.
- The source register is selected by ; its contents go on the bus.
- The destination register has its LD (load) input enabled and takes the bus contents at the next clock pulse. Several registers may load the same bus value at once.
- The address register AR (12 bits) supplies the memory address; the memory read/write is controlled by Read/Write signals, and data passes through the bus.
- PC and DR may be incremented (INR) or cleared (CLR); AC takes input from the adder/logic circuit (ALU) which combines AC and DR, as well as INPR.
- The 12-bit contents of AR and PC are placed in the low-order 12 bits of the bus (the top four bits are 0), and IR sends the 12-bit address field to the bus.
Example: sets and enables LD of AR. The memory read sets and enables LD of DR.
Benefits: fewer connections and lower cost. Drawback: only one transfer can happen per clock cycle.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 10 marks
In the RISC architecture, what is meant by over lapping register window? Explain the relationship among register windows with over lapping register windows.
Answer
Overlapping register windows. In a RISC processor (e.g. Berkeley RISC, SPARC) a large bank of registers is divided into small windows, one per procedure. Procedure calls are very frequent in high-level programs, and saving and restoring registers to memory on every call/return is slow. With register windows, a call simply switches to a new window instead of pushing registers on the stack. The windows are overlapped: the registers at the end of one window are physically the same registers as those at the start of the next window, so parameters can be passed without copying.
Organisation of each window. Every window consists of:
- Local registers: used only by that procedure for its local variables and temporaries.
- High (input) registers: shared with the calling procedure; they receive the parameters passed by the caller and hold values returned to it.
- Low (output) registers: shared with the called procedure; the procedure puts parameters for the next call here.
- A few global registers, visible to all procedures.
Relationship among windows. For procedures A, B and C where A calls B and B calls C:
- The low (output) registers of A's window are the same physical registers as the high (input) registers of B's window.
- The low registers of B are the high registers of C.
- Local registers of each window are private and never shared.
Example (Berkeley RISC, 74 registers): 10 global registers R0-R9; 64 registers in windows. Each window has 10 local registers, 6 high (input), 6 low (output), so a window has 22 registers visible, and 16 physical registers are shared between adjacent windows. With 4 windows, the total is window registers (the windows form a circular buffer, so the last window overlaps the first).
window A: [ high_A | local_A | low_A ]
|| (same physical registers)
window B: [ high_B | local_B | low_B ]
||
window C: [ high_C | local_C | low_C ]
Operation. On a call, the current window pointer (CWP) moves to the next window, so the caller's low registers instantly become the callee's high registers. On return, CWP moves back and the results left in the callee's high registers are seen by the caller as its low registers. If the nesting depth exceeds the number of windows, the oldest window is saved to memory (window overflow) and brought back on underflow. Advantages: fast procedure call/return, no parameter copying, fewer memory references.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 10 marks
Explain the Flynn’s classification of computer architectures with diagrams.
Answer
Flynn's classification. Michael Flynn (1966) classified computer architectures by the number of instruction streams and data streams that are processed simultaneously, giving four classes.
1. SISD (Single Instruction, Single Data). A conventional uniprocessor. One control unit fetches one instruction at a time and one processing unit operates on one data item at a time. Example: classic von Neumann machines, older PCs. Pipelining or a superscalar design may overlap instructions but the model is still SISD.
IS IS DS
CU ---------> PU <------> Memory
2. SIMD (Single Instruction, Multiple Data). One control unit broadcasts the same instruction to many processing elements, each working on its own data in lock-step. Suited to regular data-parallel work such as vector/matrix operations and image processing. Examples: array processors, vector processors, GPUs, MMX/SSE extensions.
+--> PU1 <--> Memory 1
CU --- IS ------>+--> PU2 <--> Memory 2
+--> PUn <--> Memory n
3. MISD (Multiple Instruction, Single Data). Several processing units each execute a different instruction on the same data stream. It is rarely built in practice; examples are fault-tolerant systems executing different programs on the same input for redundancy (space-shuttle flight computers) and sometimes systolic arrays/pipelines.
CU1 --IS1--> PU1 \
CU2 --IS2--> PU2 >--- single data stream <--- Memory
CUn --ISn--> PUn /
4. MIMD (Multiple Instruction, Multiple Data). Multiple processors, each with its own control unit, execute different instructions on different data at the same time. This is the most general and most common parallel model. Examples: multicore processors, multiprocessor servers, clusters and distributed systems. It has two forms:
- Shared-memory (tightly coupled) multiprocessors, all CPUs access a common memory.
- Distributed-memory (loosely coupled) multicomputers, each CPU has local memory and communicates by message passing.
CU1 -IS1-> PU1 <-DS1-> Memory 1 \
CU2 -IS2-> PU2 <-DS2-> Memory 2 >-- interconnection network
CUn -ISn-> PUn <-DSn-> Memory n /
| Class | Instruction streams | Data streams | Example |
|---|---|---|---|
| SISD | 1 | 1 | Single-core CPU |
| SIMD | 1 | many | Vector processor, GPU |
| MISD | many | 1 | Fault-tolerant redundant systems |
| MIMD | many | many | Multicore, clusters |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 10 marks
What are the different types of pipe line hazards? Explain each pipe line hazard with example.
Answer
Pipeline hazards. A hazard is a situation that prevents the next instruction in the pipeline from executing in its designated clock cycle, causing a stall (bubble) and reducing throughput. There are three types.
1. Structural hazards. Two instructions need the same hardware resource at the same time, and the resource cannot serve both.
Example: with a single memory shared for instructions and data, a LOAD instruction in its memory-access (MEM) stage conflicts with the instruction fetch (IF) of a later instruction in the same cycle. One must wait a cycle.
| Cycle | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| LOAD | IF | ID | EX | MEM | WB | |
| I2 | IF | ID | EX | MEM | WB | |
| I3 | IF | ID | EX | MEM | ||
| I4 | IF (conflict with LOAD MEM) |
Remedy: separate instruction and data memories (caches), duplicate or pipeline the functional units, or stall.
2. Data hazards. An instruction depends on the result of a previous instruction that is not yet complete. Types:
- RAW (read after write, true dependence): I2 reads a register before I1 has written it.
ADD R1, R2, R3 ; writes R1 in WB (cycle 5)
SUB R4, R1, R5 ; reads R1 in ID (cycle 3): stale value
- WAR (write after read, anti-dependence): a later instruction writes a register before an earlier instruction has read it (occurs when instructions are reordered).
- WAW (write after write, output dependence): two instructions write the same register and the writes complete in the wrong order.
Remedies: operand forwarding (bypassing) passes the ALU result straight to the next instruction's input; stalling/inserting NOPs (pipeline interlock); compiler instruction scheduling; register renaming (for WAR/WAW).
3. Control (branch) hazards. A branch or jump changes the program counter, so the instructions fetched after the branch may be the wrong ones, and the target is not known until the branch is decoded or executed.
Example:
BEQ R1, R2, LABEL ; outcome known in EX/MEM stage
ADD R3, R4, R5 ; fetched, but may need to be discarded
...
LABEL: SUB R6, R7, R8
If the branch is taken, the instructions already fetched behind it must be flushed, costing 1-3 cycles.
Remedies: branch prediction (static or dynamic with a branch history table), delayed branch (the compiler fills the delay slot with a useful instruction), branch target buffer, early branch resolution in the decode stage, and prefetching both paths.
Summary: structural hazards come from resource conflicts, data hazards from dependences between instructions, and control hazards from changes in the instruction flow.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Explain the computer components.
Answer
A computer system consists of hardware components that work together under a program. The basic components are as follows.
1. Central Processing Unit (CPU). It fetches, decodes and executes instructions. It contains:
- Arithmetic Logic Unit (ALU): performs arithmetic (add, subtract) and logical (AND, OR, compare, shift) operations.
- Control Unit (CU): generates timing and control signals that direct the other components and sequence the instruction cycle.
- Registers: small, very fast storage inside the CPU, such as the program counter (PC), instruction register (IR), memory address register (MAR), memory buffer register (MBR) and accumulator.
2. Main memory. Stores the programs and data currently in use. It is divided into addressable locations. RAM is volatile and read/write; ROM holds permanent start-up code. The CPU transfers data using MAR and MBR.
3. Input/Output (I/O) devices and modules. Input devices (keyboard, mouse, scanner) bring data in; output devices (monitor, printer) deliver results. I/O modules interface the devices to the system, handling speed and format differences, using programmed I/O, interrupts or DMA.
4. Secondary storage. Hard disk, SSD and optical media provide large, permanent (non-volatile) storage at lower speed.
5. System bus (interconnection). The shared pathways that carry information between components: the data bus (data transfer), address bus (location of memory/I/O) and control bus (read/write, interrupt, clock signals).
+-----------------+
| CPU (ALU, CU, |
| registers) |
+--------+--------+
| system bus (data, address, control)
+----------+-----------+
| |
Main memory I/O modules ---> devices
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Explain the store-program concept with example.
Answer
Stored-program concept. The idea, proposed by John von Neumann (and used in the IAS machine), is that the instructions of a program and its data are stored together in the same main memory in binary form. The CPU reads instructions from memory one after another, and decodes and executes them. Earlier machines (such as ENIAC) were programmed by rewiring or setting switches, which was slow and error-prone; with a stored program the machine is reprogrammed simply by loading different contents into memory.
Key features
- A single read/write memory holds both instructions and data, addressed by location.
- Instructions are executed sequentially unless a branch changes the flow; the program counter (PC) holds the address of the next instruction.
- Instructions can be treated as data, so a program can be loaded, modified or generated by another program (compilers, loaders, operating systems).
- The processor repeatedly performs the fetch-decode-execute cycle.
Example. Computing , with at address 100, at 101 and at 102, program stored at addresses 0-3:
| Address | Content | Meaning |
|---|---|---|
| 0 | LOAD 100 | AC M[100] (A) |
| 1 | ADD 101 | AC AC + M[101] (B) |
| 2 | STORE 102 | M[102] AC |
| 3 | HALT | stop |
| 100 | 5 | data A |
| 101 | 7 | data B |
| 102 | ? | result C |
Execution: PC=0, the CPU fetches LOAD 100 into IR via MAR/MBR, increments PC, decodes, and loads 5 into the accumulator. Next it fetches ADD 101, giving AC = 12. Then STORE 102 writes 12 into location 102. Finally HALT stops the machine. The instructions and the data lie in the same memory.
The shared path between CPU and memory limits speed (the von Neumann bottleneck).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Differentiate between CISC and RISC architectures.
Answer
CISC (Complex Instruction Set Computer) and RISC (Reduced Instruction Set Computer) are two design philosophies for the instruction set of a processor.
| Basis | CISC | RISC |
|---|---|---|
| Instruction set | Large (100 to 300+ instructions), many complex ones | Small, simple, mostly single-operation instructions |
| Instruction format | Variable length | Fixed length (usually 32 bit) |
| Execution time | Instructions take multiple clock cycles | Most instructions complete in one cycle |
| Addressing modes | Many (10 or more) | Few (typically 3 to 5) |
| Memory access | Any instruction may operate on memory | Only LOAD and STORE access memory (load/store architecture) |
| Control unit | Mostly microprogrammed | Mostly hardwired |
| Registers | Few general purpose registers | Large register file (often with register windows) |
| Pipelining | Difficult and less efficient | Easy and highly efficient |
| Code size | Small programs, less memory | Larger programs, more instructions |
| Complexity | Complexity is in hardware | Complexity is moved to the compiler |
| Examples | Intel x86, VAX, Motorola 68000 | ARM, MIPS, SPARC, PowerPC |
In short, CISC tries to reduce the number of instructions per program, while RISC reduces the number of cycles per instruction.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Differentiate between instruction pipeline and an arithmetic pipeline.
Answer
Pipelining divides a task into sub-tasks handled by separate segments that work in parallel on different tasks. The two main types are the instruction pipeline and the arithmetic pipeline.
| Basis | Instruction pipeline | Arithmetic pipeline |
|---|---|---|
| Purpose | Overlaps the phases of instruction execution | Overlaps the stages of a single arithmetic operation |
| Where used | In the CPU control path, for all instructions | In the ALU or floating-point unit |
| Stages | Fetch, decode, operand fetch, execute, write back | e.g. for floating-point addition: compare exponents, align mantissas, add mantissas, normalise |
| Data handled | Stream of different instructions | Stream of operand pairs for the same kind of operation |
| Hazards | Structural, data and control (branch) hazards | Hazards are fewer; mainly stage delays and rounding |
| Typical use | General purpose processors | Vector and scientific processors (e.g. Cray, floating-point units) |
| Complexity | Needs hazard detection, forwarding and branch prediction | Needs registers between the stages and balanced stage delays |
Example (arithmetic pipeline). Floating-point addition of and is split into four segments: (1) compare exponents, (2) align mantissa of the smaller number, (3) add mantissas, (4) normalise the result. While one pair is being normalised, the next pair is already in the addition stage.
Example (instruction pipeline). While instruction is being executed, is being decoded and is being fetched.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Divide 10/4 using non-restoring division.
Answer
Non-restoring division. The dividend is , the divisor is , the accumulator is and the count is bits.
Rule for each cycle:
- If : shift left one bit, then .
- If : shift left one bit, then .
- If the new set , otherwise set .
After cycles, if perform a final correction .
| Cycle | Operation | ||
|---|---|---|---|
| Initial | 0000 | 1010 | |
| 1 | shift left, so | 0001 → 1101 | 010_ → 0100 (, ) |
| 2 | shift left, so | 1010 → 1110 | 100_ → 1000 (, ) |
| 3 | shift left, so | 1101 → 0001 | 000_ → 0001 (, ) |
| 4 | shift left, so | 0010 → 1110 | 001_ → 0010 (, ) |
| Correction | so | 1110 + 0100 = 0010 | 0010 |
Result: Quotient and remainder .
Check: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Define associative memory. Explain with block diagram how it can be implemented
Answer
Associative memory (content addressable memory, CAM) is a memory in which a word is located by its content rather than by its address. A search key is given and the memory compares it with all stored words simultaneously; the words that match are flagged. It is much faster than address-based search because all comparisons happen in parallel in hardware.
Block diagram and working.
Argument register (A) ----> n bits
Key register (K) --------> mask (which bits to compare)
|
v
+-----------------------------------------+ Match register (M)
| Associative memory array | +----+
| m words x n bits |----->| M1 | word 1 matches?
| (each cell has compare logic) |----->| M2 |
| |----->| .. |
+-----------------------------------------+ | Mm |
^ | +----+
Input (write) Output (read)
Components:
- Argument register A holds the word to be searched.
- Key register K masks the argument. Only bit positions where take part in the comparison; where the bit is ignored.
- Associative memory array of words, each bits, where every cell has comparison logic.
- Match register M has one bit per word. if word matches the unmasked part of A.
Operation. The argument is placed in A and the mask in K. Every word is compared with A in parallel, the match bits are set in M, and the words with are read out (or written for a write operation). For a single bit of cell in word the match is and the word matches if
Uses: cache memory tags, virtual-memory page tables (TLB), and database or routing-table lookup.
Drawback: every cell needs comparison logic, so it is expensive compared to ordinary RAM.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Differentiate between hardwired control unit and a micro programmed control unit.
Answer
The control unit generates the control signals that drive the data path. It can be built in two ways.
| Basis | Hardwired control unit | Microprogrammed control unit |
|---|---|---|
| Implementation | Fixed logic circuit of gates, flip-flops, decoders and counters | Control signals are stored as microinstructions in a control memory (ROM) |
| Design method | Designed using state tables and logic minimisation | Designed by writing a microprogram |
| Speed | Faster, no memory access to produce signals | Slower, a control-memory fetch for each microinstruction |
| Flexibility | Inflexible; changing the instruction set needs redesign of the circuit | Flexible; change the microprogram to modify or add instructions |
| Complexity | Very complex for large instruction sets, hard to test | Simple and systematic, even for complex instruction sets |
| Cost | Costly to design for large sets | Cheaper for complex sets but needs control memory |
| Error correction | Difficult | Easy, microprogram can be edited |
| Typical use | RISC processors | CISC processors |
| Cost of changes | High | Low |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
How does DMA controller work? Give an example of DMA data transfer
Answer
Direct Memory Access (DMA) lets an I/O device transfer a block of data directly to or from main memory without passing every word through the CPU. The transfer is managed by a DMA controller.
Structure of the DMA controller. It contains an address register (starting memory address), a word count register (number of words left), a control register (read/write, mode), a data buffer, and request/acknowledge lines (DREQ, DACK, and the bus-request/bus-grant lines BR and BG to the CPU).
Working.
- The CPU initialises the DMA controller by writing the memory start address, the word count and the direction (read or write), and then continues with other work.
- When the device is ready it raises DREQ. The DMA controller sends a bus request (BR/HOLD) to the CPU.
- The CPU finishes its current bus cycle, floats its address, data and control buses and replies with bus grant (BG/HLDA). The DMA controller now controls the bus.
- The controller places the address on the address bus, issues the read or write signal, and moves one word between the device and memory. It then increments the address register and decrements the word count.
- Steps 3 and 4 repeat until the count reaches zero (burst mode) or one word at a time with the bus returned in between (cycle stealing).
- When the count is zero, the controller releases the bus and sends an interrupt to the CPU to say that the transfer is complete.
Example. Reading a 512-byte disk sector into memory starting at address : the CPU loads address register , word count and direction = write to memory. The disk controller then fills memory by DMA, using cycle stealing, while the CPU runs another program. At the end, the DMA controller interrupts the CPU. The CPU is involved only at the start and at the end, so the transfer is much faster than programmed or interrupt I/O.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2075 · 5 marks
Explain an inter connection network and its use.
Answer
Interconnection network. In a multiprocessor or multicomputer system, an interconnection network is the hardware path that connects processors to memory modules or to other processors so that they can communicate and share data. Its design decides the bandwidth, latency, cost and scalability of the system.
Common types.
- Time-shared common bus: all units share one bus; cheap but only one transfer at a time.
- Multiport memory: each memory module has several ports, one per processor; fast but needs many connections.
- Crossbar switch: a switch at every processor-memory crosspoint; all non-conflicting transfers go in parallel, but cost grows as .
- Multistage switching network (omega network): stages of switches; uses switches, cheaper than a crossbar but may block.
- Hypercube: nodes, each connected to neighbours.
- Mesh, ring, tree: other static topologies for direct processor-to-processor links.
Uses.
- Connecting many processors to shared memory in multiprocessors.
- Message passing between nodes in clusters and parallel computers.
- Allowing parallel communication and so improving speed.
- Providing alternative paths, which gives fault tolerance.
- Inside chips as network-on-chip, and in data-centre switches and routers.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 10 marks
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.
Answer
Pipeline. Pipelining is a technique in which a task is divided into a sequence of sub-tasks, each executed in its own segment (stage), and the segments work simultaneously on different tasks. Each segment output is held in a register that feeds the next segment, and all segments operate under a common clock. It increases throughput; the time for one task is not reduced, but a new task can finish every clock cycle once the pipe is full.
Space-time diagram for segments and tasks.
The first task needs cycles to leave the pipeline and each following task finishes one cycle later, so the total number of clock cycles is
| Segment \ Clock | 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 |
Task T1 completes at clock 6, T2 at 7, and so on until T8 completes at clock 13. So the pipeline needs 13 clock cycles for 8 tasks.
Comparison with a non-pipelined unit. A non-pipelined unit with the same total delay needs cycles, so
As the speedup approaches .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 10 marks
Explain Booth multiplication algorithm with hardware implementation diagram. Multiply (-4) x (-3) using Booth multiplication algorithm.
Answer
Booth's multiplication algorithm multiplies two signed numbers in 2's complement form directly. It treats a string of 1s in the multiplier as , so a run of 1s needs only one subtraction at its start and one addition after its end, and it handles signs automatically.
Hardware. The registers are:
- BR holds the multiplicand .
- AC (initially 0) and QR (multiplier) form a combined register that shifts right.
- is a one-bit flip-flop to the right of QR (initially 0).
- SC is a sequence counter set to , the number of bits.
- A parallel adder/subtractor combines AC and BR.
BR (multiplicand) --> [ Parallel adder / subtractor ] <-- AC
|
AC -> QR -> Q(-1) (arithmetic shift right)
Control logic examines Q0 and Q(-1), counter SC
Algorithm.
- Initialise AC , , BR multiplicand, QR multiplier, SC .
- Examine :
- : AC AC BR
- : AC AC BR
- or : no operation
- Arithmetic shift right the combined AC, QR, (the sign bit of AC is kept).
- Decrement SC. If SC go to step 2, otherwise stop. The product is in AC:QR.
Example using 4 bits. , , multiplier .
| Step | Operation | AC | QR | ||
|---|---|---|---|---|---|
| Initial | 0000 | 1101 | 0 | ||
| 1 | 10 | AC M | 0100 | 1101 | 0 |
| ASR | 0010 | 0110 | 1 | ||
| 2 | 01 | AC M | 1110 | 0110 | 1 |
| ASR | 1111 | 0011 | 0 | ||
| 3 | 10 | AC M (carry ignored) | 0011 | 0011 | 0 |
| ASR | 0001 | 1001 | 1 | ||
| 4 | 11 | no operation | 0001 | 1001 | 1 |
| ASR | 0000 | 1100 | 1 |
Product AC:QR .
Check: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 10 marks
Define I/O interface. Comparison between programmed I/O, Interrupt driven I/O and direct memory access (DMA).
Answer
I/O interface. An I/O interface is the hardware (and its control logic) that sits between the CPU/system bus and a peripheral device. It resolves the differences in speed, data format, voltage levels and timing between them. Its functions are: address decoding to select the device, buffering of data, status and control signals, converting data between serial and parallel form, and interrupt/DMA handling.
Comparison of the three data transfer techniques.
| Basis | Programmed I/O | Interrupt-driven I/O | DMA |
|---|---|---|---|
| Who controls the transfer | CPU, through a program | CPU, in an interrupt service routine | DMA controller |
| CPU involvement | Full; CPU polls the status flag continuously (busy waiting) | CPU works until the device interrupts, then transfers each word | Only to start and to handle the final interrupt |
| CPU efficiency | Poor, time is wasted in polling | Better, no polling | Best, CPU is free during transfer |
| Speed of transfer | Slow | Moderate | Fast (block transfer at memory speed) |
| Data path | Device to CPU register to memory | Device to CPU register to memory | Device directly to memory |
| Hardware cost | Lowest | Moderate (interrupt controller, interrupt lines) | Highest (DMA controller) |
| Overhead per word | Polling and instruction execution | Context saving and interrupt latency for each word | None per word; overhead only per block |
| Suitable for | Simple, slow devices (keyboard in simple systems) | Moderately slow devices | High speed devices such as disk and network |
| Example | Reading a switch by polling | Keyboard, printer | Disk read of a sector |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Draw an instruction cycle state diagram with interrupt and explain it
Answer
Instruction cycle. The CPU executes a program by repeating the instruction cycle for each instruction. With interrupts, the cycle is extended so that interrupt requests can be checked and serviced after each instruction.
State diagram.
+--> (1) Instruction address calc. --> (2) Instruction fetch --> (3) Instruction decode
| |
| v
| +--> (4) Operand address calc. --> (5) Operand fetch --> (6) Data operation
| | |
| +------------------ more operands ----------------------------+
| v
| (7) Operand address calc. --> (8) Operand store
| |
| +---------------- more results <------------------------------+
| v
| Interrupt check
| / \
| no interrupt interrupt
| | |
+-----------------------------------------------------+ (9) Interrupt: save PC,
+----------------------------------------------------------- load ISR address ---+
Explanation of the states.
- Instruction address calculation: determine the address of the next instruction (usually PC + length).
- Instruction fetch: read the instruction from memory into the instruction register.
- Instruction operation decoding: decode the opcode to find the operation and the number and type of operands.
- Operand address calculation: find the effective address of each source operand if it is in memory.
- Operand fetch: read the operand from memory or register.
- Data operation: perform the arithmetic or logical operation in the ALU.
- Operand address calculation (result): find the destination address.
- Operand store: write the result to memory or register.
States 4 to 8 may repeat for instructions with multiple operands or results.
Interrupt handling. At the end of each instruction execution the CPU checks the interrupt line. If no interrupt is pending (or interrupts are disabled), it fetches the next instruction. If an interrupt is pending, the CPU saves the current PC (and status) on the stack, loads the PC with the address of the interrupt service routine, executes it, and then restores the saved PC and resumes the interrupted program.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Explain register transfer language with example
Answer
Register Transfer Language (RTL). A symbolic notation used to describe the micro-operations of a digital system in terms of the transfer of data between registers and the operations performed on that data. A micro-operation is an elementary operation performed on data stored in registers, such as shift, load, clear, increment, add.
Notation.
- Registers are named by capital letters: , , , . Bits are shown in brackets, e.g. .
- Replacement (transfer) is written with an arrow: copies the contents of into ; the source is not changed.
- A condition is written before a comma: means the transfer happens only if control signal .
- Simultaneous operations are separated by commas: (swap).
- Memory is shown as , a read is and a write is .
Types of micro-operations with examples.
| Type | Example |
|---|---|
| Transfer | |
| Arithmetic | , , (subtract) |
| Logic | , |
| Shift |
Example (hardware). For , the output of is connected to the input of , and the load input of is enabled by the control signal at the clock edge. For the bus-based transfer, a common bus built with multiplexers or tri-state buffers selects the source register and the destination loads it.
Instruction fetch in RTL:
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Write codes using 3, 2 and 1 address instruction formats to perform the given operations.
X = A/B + C × D/C
Answer
The expression is evaluated as .
(a) Three-address instructions (OP dest, src1, src2):
DIV R1, A, B ; R1 = A / B
MUL R2, C, D ; R2 = C * D
DIV R2, R2, C ; R2 = (C * D) / C
ADD X, R1, R2 ; X = R1 + R2
(b) Two-address instructions (OP dest, src; the destination is also the first operand):
MOV R1, A ; R1 = A
DIV R1, B ; R1 = A / B
MOV R2, C ; R2 = C
MUL R2, D ; R2 = C * D
DIV R2, C ; R2 = (C * D) / C
ADD R1, R2 ; R1 = A/B + C*D/C
MOV X, R1 ; X = R1
(c) One-address instructions (all operations use the accumulator AC):
LOAD C ; AC = C
MUL D ; AC = C * D
DIV C ; AC = (C * D) / C
STORE T ; T = AC (temporary)
LOAD A ; AC = A
DIV B ; AC = A / B
ADD T ; AC = A/B + C*D/C
STORE X ; X = AC
Counts: 4 instructions for 3-address, 7 for 2-address and 8 for 1-address. As the number of addresses per instruction decreases, the program becomes longer but each instruction is shorter.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Explain the various addressing modes with example.
Answer
The addressing mode is the rule used to find the operand (effective address, EA) from the address field of an instruction. Modes give flexibility to handle pointers, arrays, loops and relocation.
| Mode | How the operand is found | Example |
|---|---|---|
| Implied | Operand is implicit in the opcode (e.g. accumulator or stack) | CMA (complement accumulator) |
| Immediate | The operand itself is in the instruction | MVI A, 25 or ADD #5 |
| Register direct | Operand is in the named register | MOV R1, R2 |
| Register indirect | Register holds the memory address of the operand; EA | MOV A, (R1) |
| Direct (absolute) | Address field is the EA | LDA 2000H |
| Indirect | Address field points to a memory word holding the EA; EA | LOAD @500 |
| Relative | EA | JMP +10 (branches) |
| Indexed | EA | LOAD 1000(X) for array element |
| Base register | EA | Used for relocation and segments |
| Auto-increment / decrement | Register used as pointer, then incremented or decremented | MOV A, (R1)+ |
Example. Let the instruction be LOAD 500 with R1 , memory , , .
- Immediate: AC .
- Direct: AC .
- Indirect: AC .
- Register indirect (R1 ): AC .
- Indexed (X ): EA , AC .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Differentiate between hardwired control unit and microprogrammed control unit
Answer
| Basis | Hardwired control unit | Microprogrammed control unit |
|---|---|---|
| Principle | Control signals produced by fixed combinational and sequential logic | Control signals are read from a control memory as microinstructions |
| Components | Instruction decoder, step counter, gates, flip-flops | Control memory (ROM), control address register, microinstruction register, sequencer |
| Speed | Fast, limited only by gate delays | Slower due to control memory access |
| Flexibility | Hard to modify; any change needs rewiring | Easy to modify by changing the microprogram |
| Design | Complex for large instruction sets; time-consuming | Systematic and simple |
| Cost | High design cost for complex sets, cheaper for small sets | Needs control memory but cheaper for complex sets |
| Testing and debugging | Difficult | Easier |
| Instruction set | Suited to small, simple (RISC) sets | Suited to large, complex (CISC) sets |
| Examples | MIPS, ARM | IBM 360, VAX, Intel x86 (older) |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
How performance of computer is increased using pipeline? Explain with practical example
Answer
How pipelining improves performance. In a non-pipelined processor one instruction must finish before the next starts. In a pipelined processor the instruction is divided into stages (for example fetch, decode, execute) and a new instruction enters the pipeline every clock cycle, so several instructions are in progress at once. The execution time of one instruction does not decrease, but the throughput (instructions completed per unit time) increases and the CPI approaches 1.
For stages, tasks and clock period (non-pipelined time per task ):
Practical example (washing clothes / assembly line). Washing, drying and ironing each take 30 minutes. For 4 loads without overlap, the total time is min. With a pipeline, the washer starts the next load as soon as the first moves to the dryer, so the total is min, a speedup of 2.
Example with instructions. Take a 3-stage pipeline (fetch, decode, execute) with 10 instructions and a clock of 1 ns.
- Non-pipelined: ns.
- Pipelined: ns.
- Speedup .
| Clock | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Fetch | I1 | I2 | I3 | I4 | I5 |
| Decode | I1 | I2 | I3 | I4 | |
| Execute | I1 | I2 | I3 |
Real speedup is lower than ideal because of hazards (data, control, structural) and unequal stage delays, which are reduced by forwarding, branch prediction and stalls.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Differentiate between restoring division and non-restoring division
Answer
Both algorithms divide unsigned integers using shift and subtract, for a dividend in , divisor and partial remainder .
| Basis | Restoring division | Non-restoring division |
|---|---|---|
| Idea | If is negative, the old value of is restored by adding back | No restoration; a negative is corrected in the next step by adding |
| Per-cycle operation | Shift left, subtract ; if add back and set , else | Shift left; if subtract , else add ; if the new , else |
| Additions/subtractions per cycle | One or two | Exactly one |
| Speed | Slower (extra addition when the result is negative) | Faster |
| Hardware | Needs restore step and control | Simpler cycle, but needs final correction |
| Final step | Not needed | If at the end add to get the remainder |
| Complexity | Simple to understand | Slightly harder to understand |
Why non-restoring works. Restoring then shifting gives . Non-restoring skips the restore and simply adds in the next cycle, so the result is the same with one fewer operation.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Give the appropriate reasons why replacement algorithm is required in associative mapping?
Answer
In associative (fully associative) mapping a main-memory block can be placed in any cache line, and the tag of every line is compared in parallel with the requested block address.
A replacement algorithm is required because:
- There is no fixed line for a block. When a miss occurs and the cache is full, the hardware must choose which of the existing blocks to remove. In direct mapping this is not needed because each block has exactly one possible line.
- The cache is much smaller than main memory, so the number of blocks that can compete for space is much larger than the number of lines.
- The choice affects the hit ratio. Removing a block that will be used again soon causes another miss, while removing a block that will not be needed keeps performance high.
- It must be done in hardware for speed, since the cache is accessed at CPU speed.
Common algorithms: Least Recently Used (LRU), First-In First-Out (FIFO), Least Frequently Used (LFU) and Random replacement. LRU is the most popular because of temporal locality of reference.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2077 · 5 marks
Differentiate between isolated versus memory mapped I/O
Answer
| Basis | Isolated I/O (I/O-mapped) | Memory-mapped I/O |
|---|---|---|
| Address space | Separate address space for I/O and memory | I/O devices share the memory address space |
| Control signals | Separate signals (IORD, IOWR, M/IO) | Same MEMR and MEMW signals as memory |
| Instructions | Special instructions IN and OUT | Ordinary memory instructions (LOAD, STORE, MOV) |
| Addressing modes | Limited (only direct or register) | All memory addressing modes are available |
| Address available for memory | Full address space (e.g. 64 KB) | Reduced by the size used for I/O |
| Number of I/O ports | Limited (e.g. 256 for 8-bit port address) | Large, up to the address space left |
| Hardware | Needs extra control pins and decoding | Simple; no extra control signals |
| Data manipulation | Data must move through accumulator | Any register or arithmetic instruction can work on I/O data directly |
| Programming | Easy to separate I/O code | More flexible, but memory and I/O are mixed |
| Example | Intel 8085, 8086 (IN/OUT) | Motorola 68000, ARM |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Differentiate between hardwired and microprogrammed control unit. Describe with example of microprogram sequencer used in microprogrammed control unit.
Answer
Hardwired versus microprogrammed control unit.
| Basis | Hardwired control unit | Microprogrammed control unit |
|---|---|---|
| Implementation | Fixed logic: decoders, gates, flip-flops, counters | Microinstructions stored in a control memory (ROM) |
| Speed | Fast | Slower because of control-memory access |
| Flexibility | Hard to change; redesign needed | Easy to change by editing the microprogram |
| Complexity | Complex for large instruction sets | Systematic and easier to design |
| Cost | High for complex sets | Lower for complex sets, but needs control memory |
| Debugging | Difficult | Easier |
| Used in | RISC machines | CISC machines |
Microprogram sequencer. In a microprogrammed control unit, each machine instruction is carried out by a sequence of microinstructions in the control memory. The microprogram sequencer (next-address generator) decides the address of the next microinstruction.
Components:
- Multiplexer (MUX) selects the source of the next address.
- Branch logic tests the status bits and selects the branch condition.
- Incrementer adds 1 to the control address register (CAR) for sequential execution.
- Subroutine register (SBR) stores the return address for micro-subroutines.
- Mapping logic converts the opcode of the instruction into the starting address of its microroutine.
- Control address register (CAR) holds the current address, and the control memory with its microinstruction register supplies the control word.
Instruction opcode --> [Mapping logic] ---+
CAR --> [Incrementer] --------------------+
SBR (return address) ---------------------+--> [MUX] --> CAR --> [Control memory] --> Microinstruction
Branch address field ---------------------+ ^
External address ---------------------+ |
Status bits --> [Branch/condition logic]-----select-+
Example (instruction fetch/execute sequence). The next address is selected as:
- Sequential: .
- Unconditional branch: address field.
- Conditional branch: if the condition (e.g. Z flag) is true address field, else .
- Call: , address field.
- Return: .
- Map: mapping of the opcode (at the end of the fetch routine, to jump to the routine for the decoded instruction).
For example, the fetch routine at addresses to ends with a MAP microinstruction which loads CAR with the start address of the ADD routine, e.g. . The ADD microprogram executes sequentially and finishes with a branch back to the fetch routine at .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Explain the various types of addressing modes and compare them algorithm, advantage and disadvantage.
Answer
The addressing mode specifies how the effective address (EA) of the operand is found from the address field of the instruction.
Types, algorithm (EA calculation), advantages and disadvantages.
| Mode | Algorithm / effective address | Advantages | Disadvantages |
|---|---|---|---|
| Implied | Operand is implicit (accumulator or stack top) | Shortest instruction, no address field | Very limited use |
| Immediate | Operand = address field | No memory access to fetch the operand, fast; good for constants | Operand size limited by the field; value cannot change at run time |
| Register direct | Operand | Very fast, small field | Few registers |
| Register indirect | EA | Small field, good for pointers and arrays | Extra memory reference; the register must be set up |
| Direct | EA | Simple, one memory reference | Limited address space by field size |
| Indirect | EA | Large address space, supports pointers | Two or more memory references; slow |
| Relative | EA | Position independent code, short branches | Range limited by displacement |
| Indexed | EA | Efficient for arrays and loops | Needs an index register, extra addition |
| Base register | EA | Relocation of programs and segments | Extra addition, base register must be managed |
| Auto-increment/decrement | EA , then | Efficient for stacks and sequential array access | Side effects, more complex hardware |
Example. For LOAD 500 with , , , index and :
- Immediate: operand .
- Direct: operand , EA .
- Indirect: EA , operand .
- Register indirect: EA .
- Indexed: EA .
- Relative: EA .
Comparison summary. Speed (fastest to slowest): immediate, register, register indirect, direct, indexed/relative/base, indirect. Flexibility (least to most): immediate and direct, then register indirect, then indexed, base and indirect. Modes with a computed address give flexibility at the price of more memory references or additions.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Explain the non-restoring division algorithm with flow chart, and hardware implementation diagram. Divide 10/3 using restoring division.
Answer
Non-restoring division. It divides without restoring the accumulator after a negative result.
Hardware. Registers:
- A (accumulator, bits) holds the partial remainder, initially 0.
- Q ( bits) holds the dividend and ends with the quotient.
- M ( bits) holds the divisor.
- An adder/subtractor combines A and M, and a counter holds .
- The sign bit of A controls whether to add or subtract.
M (divisor) ---> [ Adder / Subtractor ] <--- A (partial remainder)
|
A:Q shifted left as one register, q0 gets quotient bit
Control logic uses sign of A, counter n
Flow chart (algorithm).
- Start: , dividend, divisor, .
- If (sign bit 0): shift left, then . Otherwise (): shift left, then .
- If now then , else .
- . If go to step 2.
- If then (final correction).
- Stop: is the quotient and is the remainder.
Divide using restoring division (as asked). , , , . Each cycle: shift left, ; if , restore () and ; else .
| Cycle | After shift (, ) | Action | |||
|---|---|---|---|---|---|
| Initial | 0000 | 1010 | |||
| 1 | 0001, 010_ | restore, | 0001 | 0100 | |
| 2 | 0010, 100_ | restore, | 0010 | 1000 | |
| 3 | 0101, 000_ | keep, | 0010 | 0001 | |
| 4 | 0100, 001_ | keep, | 0001 | 0011 |
Result: Quotient , remainder .
Check: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Explain the bus interconnection scheme with diagram.
Answer
Bus interconnection. A bus is a shared communication path of lines that connects the CPU, memory and I/O modules, so that they can exchange data. Only one device can transmit at a time, while all others can listen.
Bus structure.
+-----+ +--------+ +-------+ +-------+
| CPU | | Memory | | I/O 1 | | I/O 2 |
+--+--+ +----+---+ +---+---+ +---+---+
| | | |
=====+=============+=============+=============+===== Address bus
=====+=============+=============+=============+===== Data bus
=====+=============+=============+=============+===== Control bus
Three groups of lines.
- Address bus: carries the address of the memory location or I/O port; unidirectional from the CPU. Its width fixes the maximum memory ( locations for lines).
- Data bus: carries data and instructions; bidirectional. Its width (8, 16, 32, 64 bits) gives the amount of data moved at once.
- Control bus: carries timing and control signals such as memory read/write, I/O read/write, interrupt request/acknowledge, bus request/grant, clock and reset.
Operation. To write to memory: the CPU requests the bus, places the address on the address bus and the data on the data bus, and asserts memory-write on the control bus. The addressed device is selected by decoding the address and takes the data.
Multiple bus hierarchy. A single bus becomes a bottleneck when many devices are attached, so systems use a hierarchy: a local bus (CPU to cache), a system bus (to main memory), and expansion buses (PCI, USB) connected through bridges, which gives higher performance.
Bus arbitration is needed when more than one device may be bus master: centralised (daisy chaining, polling, independent request) or distributed.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What do you mean by instruction format? Explain with an example.
Answer
Instruction format. An instruction format defines the layout of the bits of an instruction, divided into fields. It tells the control unit how to interpret the instruction. The main fields are:
- Opcode: specifies the operation (add, load, jump).
- Address / operand fields: specify the operand or its location (register or memory address).
- Mode field: specifies the addressing mode used to find the operand.
| Opcode | Mode | Operand 1 / Address | Operand 2 / Address |
Types by number of address fields.
- Three-address:
ADD R1, R2, R3means . - Two-address:
ADD R1, R2means . - One-address:
ADD Xmeans . - Zero-address (stack):
ADDpops two items from the stack and pushes the sum.
Example. A 16-bit instruction with a 4-bit opcode, 3-bit mode and 9-bit address:
| Opcode (4) | Mode (3) | Address (9) |
|---|---|---|
| 0001 | 001 | 000000101 |
The 4-bit opcode gives operations, and the 9-bit address field can address words. This instruction could mean ADD using direct addressing with the operand at address 5.
Fixed versus variable length. Fixed-length formats (RISC) are easy to decode; variable-length formats (CISC) save space but are harder to decode.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Explain the data transfer instructions with example
Answer
Data transfer instructions copy data from one place to another (register, memory, I/O or stack) without changing its value, and normally do not alter the flags. The source is not modified.
| Instruction | Meaning | Example |
|---|---|---|
Move (MOV) | Copy between registers, or between register and memory | MOV R1, R2 () |
Load (LD/LOAD) | Memory to register or accumulator | LD R1, 500 () |
Store (ST/STORE) | Register or accumulator to memory | ST R1, 600 () |
Exchange (XCHG) | Swap the contents of two locations | XCHG R1, R2 |
Input (IN) | Read from an I/O port to a register | IN A, 40H |
Output (OUT) | Write a register to an I/O port | OUT 41H |
Push (PUSH) | Put a word on top of the stack | PUSH R1 (, ) |
Pop (POP) | Take the top word from the stack to a register | POP R1 (, ) |
| Immediate load | Load a constant into a register | MVI A, 25 or LDI R1, 25 |
Example program. To copy the value in memory location 500 to location 600:
LD R1, 500 ; R1 = M[500]
ST R1, 600 ; M[600] = R1
To swap R1 and R2 using the stack:
PUSH R1
PUSH R2
POP R1
POP R2
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Explain the symbolic microinstruction with example.
Answer
Symbolic microinstruction. In a microprogrammed control unit each microinstruction is stored in control memory as a binary word. When writing a microprogram, a symbolic microinstruction is the human-readable form of that word. An assembler converts the symbols into the binary microinstruction.
Fields of a symbolic microinstruction (as in the basic computer microprogram with a 20-bit word):
| Field | Meaning |
|---|---|
| F1, F2, F3 | Three micro-operation fields, each selecting one micro-operation (e.g. ADD, CLRAC, INCAC, DRTAC, READ, WRITE) |
| CD | Condition for branching: U (unconditional), I (indirect bit), S (sign), Z (zero) |
| BR | Branch type: JMP, CALL, RET, MAP |
| AD | Address field: symbolic address (label) of the next microinstruction |
A symbolic line is written as: LABEL: F1, F2, F3, CD, BR, AD. A field that is not used is written NOP. A label ends with a colon, and the assembler assigns it a control-memory address.
Example: fetch routine.
ORG 64
FETCH: PCTAR U JMP NEXT
NEXT: READ, INCPC U JMP NEXT1
NEXT1: DRTAR U MAP
PCTAR(F1) means .READ(F2) means andINCPC(F3) means .DRTARmeans .U JMP NEXTmeans jump unconditionally to the labelNEXT.MAPloads the control address register from the opcode, so execution moves to the microroutine of the instruction.
The assembler gives each line a binary word. For example, PCTAR corresponds to F1 , so the first word has F1 , F2 , F3 , CD (U), BR (JMP) and AD address of NEXT.
Advantage. Symbols make the microprogram easy to write, read and debug compared with raw binary.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Explain an instrction pipeline with an example.
Answer
Instruction pipeline. Pipelining divides instruction processing into several stages, each handled by a separate segment. While one instruction is in a later stage, the next instructions occupy the earlier stages. Several instructions are therefore in progress at the same time, which raises throughput.
Four-segment instruction pipeline:
- FI - fetch the instruction from memory.
- DA - decode the instruction and calculate the effective address.
- FO - fetch the operand from memory.
- EX - execute the instruction and store the result.
Space-time diagram for three instructions :
| Clock | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| FI | DA | FO | EX | |||
| FI | DA | FO | EX | |||
| FI | DA | FO | EX |
Speed-up. For instructions and stages with clock period :
- Pipelined time .
- Non-pipelined time .
Example: with and , , which approaches for large .
Problems (hazards). Resource conflicts (structural), data dependency between instructions (data hazard), and branch instructions (control hazard) can stall the pipeline. They are handled by operand forwarding, delayed load, branch prediction and delayed branch.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Explain the Booth Multiplication algorithm with example.
Answer
Booth multiplication algorithm. Booth's algorithm multiplies two signed numbers in 2's complement form. A string of 1s in the multiplier is treated as , so only the two ends of a string of 1s need an operation (subtract at the start, add at the end).
Registers: = multiplicand, = multiplier, , (an extra flip-flop), (number of bits).
Steps. Examine (the last bit of and ):
- (beginning of a string of 1s): (subtract).
- (end of a string of 1s): .
- or : no operation.
- Arithmetic shift right (sign bit of is kept), then .
- Repeat until . The product is in .
Example: with 4 bits. (), (), .
| Step | Operation | ||||
|---|---|---|---|---|---|
| initial | 0000 | 0011 | 0 | ||
| 1 | 10 | 0011 | 0011 | 0 | |
| ashr | 0001 | 1001 | 1 | ||
| 2 | 11 | ashr | 0000 | 1100 | 1 |
| 3 | 01 | 1101 | 1100 | 1 | |
| ashr | 1110 | 1110 | 0 | ||
| 4 | 00 | ashr | 1111 | 0111 | 0 |
The product is , which is in 2's complement. This agrees with .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What are the advantage and disadvantage of direct mapping and associative mapping between cache and main memory?
Answer
Direct mapping. Each main-memory block can go to only one cache line, given by ( = block number, = number of cache lines). The address is split into tag, line and word fields.
| Advantages | Disadvantages |
|---|---|
| Simple and cheap hardware | Each block has a fixed cache line, so two frequently used blocks that map to the same line keep replacing each other (thrashing) |
| Only one tag comparison is needed, so access is fast | Hit ratio is lower when the program uses blocks with the same index |
| No replacement algorithm is needed; the line is fixed | Cache utilisation can be poor, since some lines stay unused while others are overloaded |
Associative mapping. Any main-memory block can be placed in any cache line. The address is split into a tag and a word field; the tag is compared with the tags of all lines in parallel.
| Advantages | Disadvantages |
|---|---|
| Most flexible; a block can go in any free line | Needs expensive associative (content-addressable) memory, with a comparator for every line |
| Highest hit ratio and best cache utilisation | Complex hardware and slower, since all tags are searched |
| Thrashing is avoided | A replacement algorithm (LRU, FIFO, random) is needed |
| Tag is longer, so more storage is needed for tags |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What are the major differentiate between Input-output processor (IOP) and direct memory Access (DMA)
Answer
IOP versus DMA.
| Basis | Input-output processor (IOP) | Direct memory access (DMA) |
|---|---|---|
| Nature | A processor with its own instruction set and program, able to execute I/O programs (channel programs) | A hardware controller that only transfers blocks of data between I/O device and memory |
| Intelligence | Can fetch and decode instructions, do code conversion, error checking and format conversion | Cannot execute instructions; only has address register, word count register and control logic |
| CPU involvement | CPU only starts the IOP and gets an interrupt at the end of the whole I/O program | CPU initialises the DMA registers for each block transfer and gets an interrupt after the block |
| Control | IOP controls many devices and sequences of transfers | DMA controller handles transfer for one or a few devices |
| Memory | Has its own local memory in some designs and shares system memory | Uses only the system bus and memory |
| Cost and complexity | High | Low |
| Example | IBM channel, Intel 8089 | Intel 8237 |
In short, a DMA controller is a simple data mover, while an IOP is a special-purpose processor that takes over the full I/O workload from the CPU.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Draw a three dimensonal hypercube and explain with example.
Answer
Hypercube (n-cube) interconnection. A hypercube is a multiprocessor interconnection structure with nodes (processors), each node connected to neighbours. A 3-dimensional hypercube has nodes, each with 3 links, and links in all.
Each node is given a binary address of bits. Two nodes are directly connected if their addresses differ in exactly one bit.
110 ------------ 111
/| /|
010 ------------ 011|
| 100 ---------- |101
|/ |/
000 ------------ 001
Edges: -, -, -, - (differ in bit 0); -, -, -, - (bit 1); -, -, -, - (bit 2).
Example of routing. To send a message from node to node , XOR the addresses: . The number of 1s is 3, so the distance is 3 hops. The message corrects one differing bit per hop, for example . The maximum distance (diameter) in an -cube is .
Properties. Short diameter (), several alternative paths between nodes, good fault tolerance, and the number of links per node grows only as .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
What is cache memory? Explain the mapping process. Differentiate between direct mapping and associate mapping.
Answer
Cache memory. A small, very fast memory placed between the CPU and main memory. It holds copies of the most recently or frequently used instructions and data, so that most memory accesses are served at cache speed. It works because of the locality of reference (temporal and spatial). If the CPU finds the word in the cache it is a hit, otherwise a miss and the block is loaded from main memory.
Mapping process. The transformation of main-memory blocks into cache lines is called mapping. Main memory is divided into blocks of words and the cache into lines of the same size. There are three techniques.
1. Direct mapping. Block goes to line ( = number of lines). The address has three fields: Tag | Line | Word. The line field selects one cache line, and the tag stored there is compared with the tag of the address. If equal it is a hit.
2. Associative mapping. A block can be placed in any line. The address has Tag | Word. The tag is compared with all line tags simultaneously.
3. Set-associative mapping. The cache is divided into sets of lines. Block goes to set and to any line in that set. The address has Tag | Set | Word. It is a compromise of the other two.
Example. Main memory K words (-bit address), cache K words, block size words. Then word field bits, cache lines , so the line field bits and the tag bits for direct mapping. For associative mapping the tag is bits.
Difference between direct and associative mapping.
| Basis | Direct mapping | Associative mapping |
|---|---|---|
| Placement | A block maps to exactly one line () | A block can go in any line |
| Address fields | Tag, line, word | Tag, word |
| Tag comparison | One comparison | All tags compared in parallel |
| Hardware | Simple and cheap | Costly (associative memory) |
| Replacement algorithm | Not needed | Needed (LRU, FIFO, random) |
| Hit ratio | Lower because of conflict misses | Higher |
| Speed | Fast lookup | Slower and more complex search |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
Describe micro-programmed control unit. Explain different types of addressing modes with example.
Answer
Micro-programmed control unit. A control unit whose control signals are generated by a stored program called a microprogram, kept in a control memory (ROM). Each machine instruction is executed by a sequence of microinstructions, each of which produces the control word for one clock period.
Organisation:
- Control memory stores the microprograms.
- Control address register (CAR) holds the address of the next microinstruction.
- Control data register / microinstruction register holds the microinstruction being executed.
- Next-address generator (sequencer) decides the next CAR value: increment, branch, call, return or map from the opcode.
- Control signals go to the datapath; the status bits go back to the sequencer.
Working. The opcode of the instruction is mapped to the starting address of its microroutine and loaded into CAR. The microinstruction is read, its fields drive the control lines, and the sequencer computes the next address. The routine ends by returning to the fetch routine.
Advantages: flexible and easily modified, systematic design. Disadvantage: slower than a hardwired unit.
Addressing modes. The addressing mode tells how the operand (or its effective address, EA) is found from the address field of the instruction. Assume , , index register , and the address field , with , , .
| Mode | Effective address / operand | Example |
|---|---|---|
| Implied | Operand is implicit in the opcode | CMA complements AC |
| Immediate | Operand is in the instruction itself | LDA #500, |
| Register | Operand is in a register | ADD R1, operand |
| Register indirect | Register holds the EA | LD (R1), EA , operand |
| Autoincrement / autodecrement | Register indirect, then register is | LD (R1)+ |
| Direct | Address field is the EA | LD 500, operand |
| Indirect | Address field gives the address of the EA | LD @500, EA , operand |
| Relative | (PC already points to the next instruction) | |
| Indexed | , operand | |
| Base register | Used for relocation of programs |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
Differentiate between floating point representation and fixed point representation. Divide 23 by 9 using restoring division algorithm.
Answer
Fixed-point versus floating-point representation.
| Basis | Fixed point | Floating point |
|---|---|---|
| Position of binary point | Fixed (usually at the right end for integers, or fixed after the sign for fractions) | Moves; its position is given by an exponent |
| Format | Sign + magnitude bits | Sign, exponent and mantissa: |
| Range | Small | Very large range of very big and very small numbers |
| Precision | Fixed absolute precision | Fixed relative precision |
| Hardware | Simple and fast | Complex (alignment, normalisation) |
| Overflow | Occurs easily | Rare |
| Use | Integer arithmetic, simple processors | Scientific computation, FPU |
Restoring division of by . Dividend , divisor , , count .
Each step: shift left , then . If set and restore (add back); else set .
| Step | Operation | ||
|---|---|---|---|
| start | 00000 | 10111 | |
| 1 | shift left | 00001 | 0111_ |
| (negative) | restore: 00001 | 01110 | |
| 2 | shift left | 00010 | 1110_ |
| (negative) | restore: 00010 | 11100 | |
| 3 | shift left | 00101 | 1100_ |
| (negative) | restore: 00101 | 11000 | |
| 4 | shift left | 01011 | 1000_ |
| (positive) | 00010 | 10001 | |
| 5 | shift left | 00101 | 0001_ |
| (negative) | restore: 00101 | 00010 |
Result: quotient and remainder .
Check: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What are different methods for representing signed numbers? Represent (-71) in those formats.
Answer
Methods of representing signed numbers. The leftmost bit is the sign bit ( = positive, = negative). Three methods are used:
- Signed magnitude: the sign bit followed by the magnitude in binary.
- Signed 1's complement: a negative number is the 1's complement (every bit inverted) of the positive number.
- Signed 2's complement: a negative number is the 1's complement plus 1.
Representation of in 8 bits.
.
| Method | Working | Result |
|---|---|---|
| Signed magnitude | sign , magnitude | |
| 1's complement | invert | |
| 2's complement |
Check of 2's complement: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Explain Direct Memory Acess with suitable diagram.
Answer
Direct Memory Access (DMA). A technique in which an I/O device transfers a block of data directly to or from main memory without passing through the CPU. A DMA controller takes control of the buses (bus request, then bus grant) and does the transfer, so the CPU is free to do other work and is interrupted only at the end of the block. It is used for fast devices such as disks.
DMA controller registers:
- Address register: starting memory address of the block.
- Word count register: number of words to transfer.
- Control register: mode of transfer (read/write).
Block diagram:
CPU <--- Data bus ---> | DMA controller | <--- Address bus --->
| Address reg |
Memory <----------------> | Word count | <---> I/O device
| Control reg |
BR (bus request) <-------- DMA request
BG (bus grant) --------> DMA acknowledge
Interrupt <-------- at end of transfer
Operation:
- The CPU initialises the controller with the memory address, word count and direction, and then continues other work.
- The device sends a DMA request. The controller asks the CPU for the bus using BR.
- The CPU finishes the current bus cycle, floats its buses and replies with BG.
- The controller places the address on the address bus and transfers a word between device and memory; the address register is incremented and the word count decremented.
- When the word count is , the controller releases the bus and interrupts the CPU.
Modes of transfer: burst (block) mode, where the controller holds the bus for the whole block, and cycle stealing, where it takes the bus for one cycle at a time.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Explain the data transfer and manipulation instruction with example.
Answer
Data transfer instructions. These move data between memory, registers and I/O without changing the data.
| Instruction | Mnemonic | Example |
|---|---|---|
| Load | LD | LD R1, 500 loads into |
| Store | ST | ST R1, 500 stores into |
| Move | MOV | MOV R2, R1 copies to |
| Exchange | XCH | XCH R1, R2 swaps contents |
| Input / Output | IN, OUT | IN R1, port |
| Push / Pop | PUSH, POP | PUSH R1 puts on the stack |
Data manipulation instructions. These perform operations on data and give the computational ability of the processor. There are three groups.
1. Arithmetic instructions: increment INC, decrement DEC, add ADD, subtract SUB, multiply MUL, divide DIV, add with carry ADDC, negate NEG. Example: ADD R1, R2 gives .
2. Logical and bit-manipulation instructions: clear CLR, complement COM, AND, OR, XOR, clear carry CLRC, set carry SETC. Example: AND R1, #0F clears the upper four bits, so .
3. Shift instructions: logical shift right/left SHR/SHL, arithmetic shift ASHR/ASHL, rotate ROR/ROL, rotate through carry RORC/ROLC. Example: SHL on gives (multiplies by 2); ASHR on gives (the sign is kept).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Explain the binary adder-subtractor circuit with suitable diagram.
Answer
Binary adder-subtractor. A binary adder is built from a chain of full adders (FA). A 4-bit parallel adder adds and , the carry out of each FA going to the carry in of the next.
For each bit: and .
Subtraction is done by the 2's complement method: . To combine both in one circuit, each input is passed through an XOR gate whose other input is the mode control , and is also the carry input of the first FA.
B3 --XOR-- FA3 -- S3 M = 0 : add
B2 --XOR-- FA2 -- S2 M = 1 : subtract
B1 --XOR-- FA1 -- S1
B0 --XOR-- FA0 -- S0
M ---> all XOR inputs and C0
A3..A0 go directly to FA3..FA0; C4 = carry out
- : and , so the circuit computes .
- : and , so the circuit computes .
Overflow detection (for signed numbers): the extra XOR gate gives i.e. the carry into the sign bit XOR the carry out of the sign bit. shows overflow.
Example: (): , ; , discard the carry, result .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What do you mean by Register Transfer Language? Explain the use of Register Transfer Language control function.
Answer
Register Transfer Language (RTL). A symbolic notation used to describe the micro-operations of a digital system. A micro-operation is an elementary operation on data stored in registers (transfer, arithmetic, logic, shift). RTL describes the registers and the information flow between them clearly and concisely.
Notation:
- copies the contents of into .
- , , denote registers; denotes a range of bits; denotes memory.
- A comma separates micro-operations that happen at the same clock, e.g. .
Control function. A control function is a Boolean variable (or expression) that is or and decides whether a transfer takes place. It is written before a colon:
The transfer from to takes place only when (the load input of is enabled by ). A control function can combine conditions, for example , and in the basic computer the timing signals and the decoded opcode are used as control functions.
Hardware use.
- comes from the control unit and goes to the load input of the destination register, so the transfer occurs at the next clock edge.
- For the transfer of to , the output of is connected to the input of , which loads when .
- When several sources transfer to the same register at different times, e.g. and , a multiplexer or bus selects the source, and the load is enabled by .
Example (instruction fetch):
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What do you mean by sequencer? Explain with microprogram sequencer.
Answer
Sequencer. A sequencer (next-address generator) is the part of the control unit that determines the order in which the control signals or microinstructions are issued. In a microprogrammed control unit, the microprogram sequencer produces the address of the next microinstruction, to be loaded in the control address register (CAR). It must provide sequential execution, branching (conditional and unconditional), subroutine calls and returns, and the mapping from an instruction opcode to the start of its microroutine.
Block diagram of a microprogram sequencer:
Opcode ---> [Mapping logic] ---+
Branch address (from control |
memory) ----------------------+--> [MUX 1] --> [CAR] --> [Control memory]
SBR --------------------------+ ^ |
CAR+1 (from incrementer) -----+ | S1 S0 |
[Input logic] <-- I1 I0 (BR field)
Status bits --> [MUX 2] --T-----^ ^
(selected by CD field) +-- L (load SBR with CAR+1)
Components:
- MUX 1 selects the next address: gives , the branch address, the subroutine register SBR, the address from the mapping logic.
- MUX 2 selects one status bit according to the CD field and gives the test value .
- Input logic uses the BR field bits and to produce and the SBR load signal .
- Incrementer gives . SBR stores the return address of a micro-subroutine.
Input logic truth table:
| (BR) | Action | |||
|---|---|---|---|---|
| 00 (JMP) | 0 | 00 | 0 | next sequential |
| 00 (JMP) | 1 | 01 | 0 | jump to branch address |
| 01 (CALL) | 0 | 00 | 0 | next sequential |
| 01 (CALL) | 1 | 01 | 1 | call: SBR CAR+1, jump |
| 10 (RET) | x | 10 | 0 | return: CAR SBR |
| 11 (MAP) | x | 11 | 0 | CAR mapped address |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Write short notes on (any two):
a. CISC
b. Overlapped register
c. Pipelining hazards
Answer
(a) CISC (Complex Instruction Set Computer). A CISC processor has a large instruction set (often 100 to 300 instructions) with many addressing modes and variable-length instruction formats. A single instruction can do a complex job such as a memory-to-memory operation or string handling.
Characteristics:
- Many complex instructions and addressing modes; a program needs fewer instructions.
- Instructions take multiple clock cycles; control is usually microprogrammed.
- Few general registers; memory operands are directly used in many instructions.
- Variable instruction length makes pipelining harder.
- Examples: Intel x86, VAX, Motorola 68000.
Advantages: smaller programs and a simple compiler mapping from high-level statements. Disadvantages: complex hardware, slower clock and poor pipelining.
(b) Overlapped register windows. Used in RISC processors to speed up procedure call and return. The large register file is divided into windows. Each window has local registers, plus registers that overlap with the neighbouring windows.
- Global registers are common to all procedures.
- Local registers belong to one procedure only.
- Input (high) registers of a procedure are the same physical registers as the output (low) registers of the calling procedure.
When procedure A calls B, the window pointer moves to the next window; the parameters placed by A in its output registers are directly visible as input registers of B, so no copying to memory or stack is needed. On return, the results go back the same way. This avoids the time of saving and restoring registers in memory.
(c) Pipeline hazards. Situations that stop the next instruction from executing in its clock cycle, so the pipeline stalls.
- Structural (resource) hazards: two instructions need the same hardware, e.g. one memory for instruction fetch and operand fetch. Solved by separate resources or a stall.
- Data hazards: an instruction needs a result that a previous instruction has not yet produced. Types are RAW, WAR and WAW, e.g.
ADD R1,R2,R3followed bySUB R4,R1,R5. Solved by operand forwarding, hardware interlocks, delayed load or compiler scheduling. - Control (branch) hazards: a branch changes the PC, so the instructions fetched after it may be wrong. Solved by prefetching both paths, a branch target buffer, branch prediction or delayed branch.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
Explain the working of Booth’s multiplication algorithm and perform multiplication of 50 and (-13) using the same algorithm.
Answer
Booth's multiplication algorithm. Booth's algorithm multiplies two signed binary numbers in 2's complement form. A string of 1s in the multiplier from bit to bit is worth , so instead of adding for every 1, we subtract at the first 1 of a string and add after the last 1. This makes the multiplication of signed numbers uniform and faster when the multiplier has long strings of 1s.
Registers. = multiplicand, = multiplier, , , .
Algorithm. For each of the cycles examine ( is the least significant bit of ):
| Action | |
|---|---|
| 10 | (i.e. ) |
| 01 | |
| 00 or 11 | no change |
Then do an arithmetic shift right of (keeping the sign of ) and . When , the -bit product is in .
Multiplication of using bits.
, . : , 1's complement , plus 1 gives .
| Cycle | Operation | ||||
|---|---|---|---|---|---|
| init | 00000000 | 11110011 | 0 | ||
| 1 | 10 | 11001110 | 11110011 | 0 | |
| ashr | 11100111 | 01111001 | 1 | ||
| 2 | 11 | ashr | 11110011 | 10111100 | 1 |
| 3 | 01 | 00100101 | 10111100 | 1 | |
| ashr | 00010010 | 11011110 | 0 | ||
| 4 | 00 | ashr | 00001001 | 01101111 | 0 |
| 5 | 10 | 11010111 | 01101111 | 0 | |
| ashr | 11101011 | 10110111 | 1 | ||
| 6 | 11 | ashr | 11110101 | 11011011 | 1 |
| 7 | 11 | ashr | 11111010 | 11101101 | 1 |
| 8 | 11 | ashr | 11111101 | 01110110 | 1 |
Product .
Since the sign bit is , the product is negative. Its magnitude is the 2's complement: .
Hence . This is correct.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
Explain the instruction format of basic computer. Write down symbolic representation for FETCH routine.
Answer
Instruction format of the basic computer. The basic computer has a 16-bit instruction word. The three types of instruction are distinguished by the opcode bits (bits 12-14) and the mode bit (bit 15).
1. Memory-reference instruction (opcode to ):
| 15 | 14-12 | 11-0 |
|---|---|---|
| Opcode | Address |
is direct addressing and is indirect addressing; the 12-bit address field addresses 4096 words. Examples: AND, ADD, LDA, STA, BUN, BSA, ISZ.
2. Register-reference instruction (opcode , ):
| 15 | 14-12 | 11-0 |
|---|---|---|
| 0 | 111 | Register operation (one bit set) |
They act on the registers; examples are CLA, CMA, CIR, INC, HLT.
3. Input-output instruction (opcode , ):
| 15 | 14-12 | 11-0 |
|---|---|---|
| 1 | 111 | I/O operation (one bit set) |
Examples are INP, OUT, SKI, SKO, ION, IOF.
The control unit decodes the three opcode bits into . If the instruction is a memory-reference instruction; if and it is register-reference; if and it is input-output.
Fetch routine (symbolic representation). The sequence counter SC gives timing signals
- : the address of the next instruction is moved from PC to AR through the common bus.
- : the instruction is read from memory into IR and PC is incremented.
- : the opcode is decoded, the address field is moved to AR and the mode bit is saved in flip-flop .
After , the control unit goes on to the indirect cycle or the execution depending on and .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
What is DMA? Explain the DMA controller with block diagram. How the DMA interact with I/O device.
Answer
DMA (Direct Memory Access). A method of data transfer in which a special controller, the DMA controller, transfers a block of data directly between an I/O device and main memory without CPU intervention for each word. The CPU only sets up the transfer and is interrupted when it is complete. This avoids the overhead of programmed I/O and interrupt-driven I/O and is suited to high-speed devices such as disks.
DMA controller. It contains:
- Address register: holds the memory address of the next word; it is incremented after every transfer.
- Word (data) count register: holds the number of words left; it is decremented after each transfer. A zero count shows the end of the block.
- Control register: specifies the mode (read or write, burst or cycle stealing).
- Address bus buffers and data bus buffers, and control logic with the DMA request, DMA acknowledge, BR (bus request), BG (bus grant) and interrupt lines.
Block diagram:
Address bus (to memory)
^
CPU <-- BR ---------+ +----+-------------------+
CPU --- BG -------->| | DMA controller | <-- DMA request --- I/O device
CPU <-- Interrupt --+ | [Address register] | --- DMA acknowledge -->
CPU ---- RD/WR ----> | [Word count register] |
CPU <--- Data bus ---> | [Control register] | <--> Data to/from device
+------------------------+
v
Main memory (RD/WR)
How the DMA interacts with an I/O device (steps):
- The CPU initialises the DMA controller by writing the starting memory address into the address register, the number of words into the word count register, and the direction (read or write) into the control register. Then it carries on with other work.
- The I/O device, when ready, sends a DMA request to the controller.
- The controller sends BR (bus request) to the CPU.
- The CPU completes its current bus cycle, disables its address, data and control buses (puts them in high-impedance state) and replies with BG (bus grant).
- The controller sends a DMA acknowledge to the device and puts the address from its address register on the address bus. For a write to memory (input from device), the data from the device is placed on the data bus and the write signal is given; for a read from memory (output), the word is read and passed to the device.
- The address register is incremented and the word count is decremented. Steps 2-5 repeat for each word.
- When the word count reaches zero, the controller releases the bus (BR ) and raises an interrupt to the CPU. The CPU gets control of the bus again.
Modes of transfer:
- Burst (block) mode: the controller holds the bus until the whole block has been transferred; the CPU is idle.
- Cycle stealing: the controller takes the bus for one memory cycle for each word and returns it, which slows the CPU only slightly.
Advantages: high speed data transfer and less CPU load. Disadvantage: extra hardware and the CPU may be delayed when the bus is stolen.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What is arithmetic overflow? How can it be detected?
Answer
Arithmetic overflow. When two numbers of bits are added (or subtracted) and the result needs more than bits to be represented correctly, the result is out of range and the sign bit of the answer is wrong. This is called an arithmetic overflow. It can happen only when two numbers of the same sign are added (or numbers of opposite sign are subtracted, since that is addition of the same sign). For -bit 2's complement numbers, the range is to .
Example (4 bits, range to ): :
The result is read as , which is wrong, since . Another example: : , drop the carry to get , wrong, since the true answer .
Detection.
- Sign-bit rule: Overflow occurs if two positive numbers give a negative sum, or two negative numbers give a positive sum. Adding numbers of opposite sign never overflows.
- Carry rule: Overflow occurs when the carry into the sign bit is different from the carry out of the sign bit: with an XOR gate on those two carries of the last stage of the adder. means overflow, and it is stored in an overflow flip-flop.
Check with : the carry into the sign bit is (from in bit 2), the carry out is , so : overflow. For : carry in , carry out , : no overflow.
For unsigned numbers, overflow is simply a carry out of the most significant bit.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What do you mean by error correction codes? Explain any one of error correction technique.
Answer
Error-correcting codes. When data is stored or transmitted, noise can change bits. An error-detecting code, such as a parity bit, only shows that an error exists. An error-correcting code (ECC) adds redundant check bits so that the receiver can detect the position of an erroneous bit and correct it by inverting it. They are used in memory systems and communication.
Hamming code (single-error correcting). For data bits, parity bits are added so that For 4 data bits, and the word has 7 bits. The bits are numbered 1 to 7; the parity bits are in positions that are powers of 2 and the data bits are in the other positions (3, 5, 6, 7).
Each parity bit checks the positions in which the corresponding bit of the position number is 1 (even parity):
- checks positions 1, 3, 5, 7.
- checks positions 2, 3, 6, 7.
- checks positions 4, 5, 6, 7.
Example. Data , i.e. positions 3, 5, 6, 7 hold .
- : bits 3, 5, 7 are (sum ), so .
- : bits 3, 6, 7 are (sum ), so .
- : bits 5, 6, 7 are (sum ), so .
Codeword (positions 1 to 7): .
Detecting and correcting. Suppose position 6 flips during transmission, so is received. The receiver recomputes the parity checks:
- (positions 1, 3, 5, 7): gives even, .
- (positions 2, 3, 6, 7): gives odd, .
- (positions 4, 5, 6, 7): gives odd, .
The check number gives the position of the erroneous bit. Position 6 is inverted to get back , and the data is . If , there is no error.
Adding an overall parity bit gives the SEC-DED code, which corrects one error and detects two errors.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Explain block diagram of microprogram sequencer in brief.
Answer
Microprogram sequencer. In a microprogrammed control unit, the sequencer is the circuit that generates the address of the next microinstruction for the control address register (CAR). It supports sequential execution, conditional and unconditional branches, subroutine call and return, and mapping from the opcode of the instruction.
Block diagram:
Instruction opcode --> [Mapping logic] ----+
Branch address (from microinstruction) ----+
SBR (subroutine register) -----------------+--> [MUX 1] --> [CAR] --> [Control memory]
CAR + 1 ([Incrementer]) -------------------+ ^ | \--> CAR+1 --> SBR (load by L)
| S1 S0 v
Status bits --> [MUX 2] -- T --> [Input logic] ----+ Microinstruction
^ ^ (fields: F, CD, BR, AD)
| CD field | BR field (I1 I0)
Parts and functions:
- MUX 1 selects the next address among four sources: (), branch address from the AD field (), the subroutine register SBR () and the mapping logic ().
- MUX 2 is controlled by the CD field and selects one of the status bits (or a constant for an unconditional branch); its output is the test bit .
- Input logic has inputs (from the BR field) and , and gives the MUX 1 select lines and the load signal for SBR.
- Incrementer adds 1 to CAR for sequential flow.
- SBR stores the return address () on a call and supplies it for the return.
- Mapping logic converts the opcode bits of the instruction to the start address of its microroutine.
Operation. The microinstruction read from control memory goes to the microinstruction register; its CD and BR fields give the test and the branch type. The sequencer then loads CAR with the chosen address: next sequential address, branch address, return address or mapped address.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What is cache memory? Explain the elements of cache design.
Answer
Cache memory. A small, fast memory between the CPU and main memory that keeps copies of the frequently used data and instructions. Because of locality of reference, most accesses are hits and the average access time comes close to the cache access time.
Elements of cache design.
-
Cache size. The cache should be large enough that the average access time is near that of the cache, and small enough that cost and the time to search stay low. Larger caches are slower and costlier.
-
Mapping function. Decides where a main-memory block is placed in the cache: direct (one fixed line, ), fully associative (any line) or set-associative (any line within a set).
-
Replacement algorithm. Chooses which block is removed when a new block must come in and no space is free: LRU (least recently used), FIFO, LFU (least frequently used) or random. Direct mapping needs none.
-
Write policy. Keeps main memory consistent with the cache: write-through (every write goes to both cache and memory; simple but generates memory traffic) or write-back (write only to the cache and mark the line dirty; the line is written to memory on replacement). In multiprocessors, cache coherence is also needed.
-
Line (block) size. A larger block brings more nearby data (spatial locality) and raises the hit ratio at first, but too large a block means fewer lines and more useless data, and the hit ratio falls. Sizes of 8 to 64 bytes are common.
-
Number of caches. Multi-level caches (L1, L2, L3), where L1 is small and fast and the next levels are larger and slower; and unified or split caches, where a split cache keeps instructions and data separate to avoid contention in pipelined processors.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What is micro operation? Explain different arithmetci microoperations.
Answer
Micro-operation. A micro-operation is an elementary operation performed on data stored in registers during one clock pulse. A machine instruction is executed as a sequence of micro-operations (for example ). Micro-operations are of four types: register transfer, arithmetic, logic and shift.
Arithmetic micro-operations. These perform arithmetic on numeric data held in registers.
| Symbolic notation | Description |
|---|---|
| Add contents of R1 and R2, store in R3 | |
| Subtract R2 from R1 | |
| Complement (1's complement) of R2 | |
| 2's complement (negate) of R2 | |
| Subtraction using 2's complement | |
| Increment | |
| Decrement |
1. Add. The contents of two registers are added by a parallel adder (a chain of full adders) and the sum is loaded into the destination register.
2. Subtract. Done by adding the 2's complement of the subtrahend: . The complement is obtained with inverters and the extra 1 is supplied as the input carry of the adder.
3. Increment and decrement. Add 1 to, or subtract 1 from, a register. An up/down counter or a half-adder chain with one input fixed to 1 does this.
4. Complement and negate. The 1's complement flips every bit; the 2's complement (negation) is the 1's complement plus 1.
Binary adder-subtractor. A single circuit does both add and subtract. Each bit of is XORed with a mode input and is also fed as the input carry of the -bit adder.
- : , , so the output is .
- : , , so the output is .
Overflow is detected as (carry into and out of the sign bit).
Binary incrementer. A chain of half adders, with the input carry of the first fixed to 1, gives .
Arithmetic circuit. By selecting the second operand of the adder through a multiplexer (B, , all 0s or all 1s) and the carry input, one circuit produces: , , , (), , , (adding all 1s), and transfer of .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What do you mean by pipelining concept? Discuss various pipeline hazards and their solutions in detail.
Answer
Pipelining. Pipelining is a technique in which the execution of an instruction (or arithmetic task) is divided into several sub-operations (segments or stages), each handled by a dedicated segment, so that different instructions are at different stages at the same time. Like an assembly line, a new instruction enters the pipeline every clock cycle, so after the pipeline fills one instruction completes per cycle.
For stages, instructions and clock time , the time is against without a pipeline, so the speedup is
Pipeline hazards. A hazard is a situation that stops the next instruction from executing in its designated clock cycle, producing a stall and lowering throughput. There are three kinds.
1. Structural hazard (resource conflict). Two instructions need the same hardware resource in the same cycle, for example one memory used for both instruction fetch and operand access.
Solutions: separate instruction and data memories/caches, duplicate or pipeline functional units, add more register-file ports, or stall one instruction.
2. Data hazard. An instruction depends on the result of an earlier instruction that has not yet finished.
- RAW (read after write):
ADD R1,R2,R3followed bySUB R4,R1,R5. The SUB reads R1 before it is written. - WAR (write after read) and WAW (write after write) occur when instructions are reordered or complete out of order.
Solutions:
- Operand forwarding (bypassing): feed the ALU output straight back to the ALU input of the next instruction.
- Pipeline interlock/stall (hardware): detect the dependency and insert bubbles until the data is ready.
- Compiler scheduling: reorder independent instructions or insert NOPs (delayed load).
- Register renaming removes WAR and WAW hazards.
3. Control (branch) hazard. A branch or jump changes the program counter, so instructions already fetched after it may be wrong and must be discarded.
Solutions:
- Pipeline flushing / stalling until the branch is resolved.
- Branch prediction (static or dynamic with a branch history table), with a branch target buffer.
- Prefetching both paths (the target and the next sequential instruction).
- Delayed branch: the compiler fills the slot after the branch with a useful instruction or a NOP.
- Resolving the branch earlier in the pipeline.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Differentiate between RISC and CISC architecture.
Answer
RISC (Reduced Instruction Set Computer) uses a small set of simple, fixed-length instructions, usually executed in one clock cycle. CISC (Complex Instruction Set Computer) uses a large set of complex instructions, many of which do multi-step work in one instruction.
| Basis | RISC | CISC |
|---|---|---|
| Instruction set | Small, simple (about 50-100) | Large, complex (200+) |
| Instruction length | Fixed | Variable |
| Execution time | Mostly one cycle per instruction | Many cycles, varies by instruction |
| Addressing modes | Few, simple | Many, complex |
| Memory access | Only LOAD and STORE access memory; all other work is register to register | Any instruction may access memory directly |
| Registers | Large register file | Fewer registers |
| Control unit | Hardwired, fast | Microprogrammed (control memory) |
| Pipelining | Easy and efficient | Difficult because of varying length and time |
| Code size | Larger programs (more instructions) | Smaller programs |
| Compiler | Complexity is in the compiler | Complexity is in the hardware |
| Hardware cost/chip area | Simple hardware, space for registers/cache | Complex, more transistors for control |
| Examples | ARM, MIPS, SPARC, PowerPC | Intel x86, VAX, IBM 360 |
Summary: RISC trades longer programs for fast, pipelined, simple hardware; CISC trades hardware complexity for compact programs and a smaller semantic gap with high-level languages.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Write short notes on (any two)
- Control ROM
- Common Bus System
- Flynn’s Classification
Answer
(a) Control ROM (control memory). In a microprogrammed control unit, the control information is stored as microinstructions in a read-only memory called the control ROM (control memory). Each machine instruction is interpreted by a small sequence of microinstructions, called a microprogram or routine.
Organisation:
- The control address register (CAR) holds the address of the next microinstruction.
- The control ROM returns the microinstruction, which goes to the control data register (pipeline register).
- The microinstruction fields (control bits for the datapath, condition select, branch address) drive the registers, ALU and bus.
- A next-address generator (sequencer) chooses the next CAR value: increment, branch address, a mapped address from the opcode of the instruction register, or a return address.
Advantages: simple to design and modify (changing the ROM changes the instruction set), systematic and flexible. Disadvantage: slower than a hardwired control unit because of the ROM access time.
(b) Common bus system. Several registers need to exchange data. Instead of separate lines between each pair, a single set of shared lines (the common bus) is used, and a selection mechanism decides which register places data on it.
- Multiplexers (or three-state buffers) with select lines choose which register output drives the bus. For example, selects AR, selects PC, selects DR, selects AC, selects IR, selects TR, and selects memory.
- Any register may load the bus value when its LD (load) input is enabled with a clock pulse; INR and CLR control increment and clear.
- Memory is read/written through the bus using the address in AR.
Benefit: far fewer wires and low cost; limitation: only one transfer can occur per clock cycle.
(c) Flynn's classification. Flynn classifies computers by the number of instruction streams and data streams that can be processed at one time.
| Class | Instruction stream | Data stream | Example |
|---|---|---|---|
| SISD | Single | Single | Conventional uniprocessor |
| SIMD | Single | Multiple | Array/vector processors, GPUs |
| MISD | Multiple | Single | Rare; fault-tolerant/systolic pipelines |
| MIMD | Multiple | Multiple | Multiprocessors, multicore, clusters |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
What is pipelining? Explain pipelining using 4-segment instruction cycle. What are its advantages?
Answer
Pipelining. Pipelining is a technique of decomposing a sequential process into sub-operations (segments), each executed in a dedicated segment that works concurrently with the others. Several tasks are therefore in different stages at the same time, and results flow from segment to segment like items on an assembly line. Registers between segments hold intermediate results so that each segment works independently.
Four-segment instruction pipeline. The instruction cycle is divided into four segments:
- FI (Fetch Instruction): fetch the instruction from memory.
- DA (Decode and calculate Address): decode the instruction and calculate the effective address of the operand.
- FO (Fetch Operand): fetch the operand from memory.
- EX (Execute): execute the operation and store the result.
Space-time diagram for four instructions (clock cycles 1 to 7):
| Instruction | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| I1 | FI | DA | FO | EX | |||
| I2 | FI | DA | FO | EX | |||
| I3 | FI | DA | FO | EX | |||
| I4 | FI | DA | FO | EX |
In a non-pipelined machine, four instructions need cycles. In the pipeline they need cycles.
As grows, the speedup approaches .
When a branch instruction is executed, the instructions already fetched after it must be discarded (control hazard), and data dependencies between instructions may cause stalls. The pipeline then delivers less than one instruction per cycle.
Advantages of pipelining.
- Higher instruction throughput: one instruction completes per clock cycle once the pipeline is full.
- Better utilisation of hardware units, since all segments are busy at once.
- Speedup of up to times without raising clock speed or duplicating the whole unit.
- Overall program execution time falls, while the CPU can run at the clock rate of its slowest stage.
Limitations are hazards (structural, data, control) and the extra cost of segment registers and control.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
What do you understand by priority interrupt? Explain polling, daisy-chaining and parallel priority interrupt.
Answer
Priority interrupt. In a system with many I/O devices, several devices may request an interrupt at the same time. A priority interrupt system establishes a priority among the sources, so that the device with the highest priority is serviced first, and a lower-priority device cannot interrupt a higher-priority service routine, while a higher-priority device can interrupt a lower-priority one. Priority can be set by software (polling) or hardware (daisy-chaining, parallel priority).
1. Polling (software method). On an interrupt, a common branch address starts a program that polls each device in order of priority, testing the interrupt flag (status) of each in turn. The first device found with its flag set is serviced. The order of polling is the order of priority.
- Advantage: simple, no special hardware, priority can be changed by changing the polling order.
- Disadvantage: slow, because time is spent polling devices before the interrupting device is identified.
2. Daisy chaining (serial hardware priority). The devices are connected in series. The interrupt request line is shared (wired-OR). The CPU's interrupt acknowledge (INTACK) signal enters the first device (highest priority) and passes through each device via a PI (priority in) to PO (priority out) path.
- If a device did not request an interrupt, it passes PI to PO (PO = 1 if PI = 1).
- If a device requested an interrupt and PI = 1, it blocks the signal (PO = 0) and places its vector address (VAD) on the data bus.
- Devices further down the chain therefore get lower priority.
Advantage: simple, cheap and expandable. Disadvantage: priority is fixed by position, and the acknowledge signal must ripple through the chain, so it is slow for long chains.
3. Parallel priority interrupt. Each device has its own interrupt line, connected to a bit of an interrupt register. Each bit can be masked by a bit of the mask register. A priority encoder takes the unmasked requests and produces a 2-bit code for the highest-priority requesting device, which is used as part of the vector address, and the interrupt status flag IST is set when any unmasked request exists.
- Masking lets the system disable low-priority devices selectively (for example, while a high-priority device is being served).
- The mask register can be programmed, so priority handling is flexible.
Advantage: the fastest, as the priority is decided by hardware in parallel, and flexible through masking. Disadvantage: more hardware and cost.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
Draw flowchart for addition and subtraction of signed 2’s complement numbers and perform the operation (90-43).
Answer
Addition and subtraction of signed 2's complement numbers. Negative numbers are stored in 2's complement form, and the sign bit is treated as part of the number. Addition is done by adding the two numbers, including their sign bits, and discarding the carry out of the sign bit. Subtraction is done by adding the 2's complement of to . Overflow is detected when the carry into the sign bit differs from the carry out of it.
Flowchart (algorithm).
START
|
AC <- multiplicand A, BR <- B
|
Add or subtract?
/ \
Add Subtract
| |
AC <- AC + BR AC <- AC + BR' + 1
V <- overflow V <- overflow
\ /
V = 1 ?
/ \
Yes No
| |
Overflow Result is in AC
\ /
END
Steps: load the first operand into AC and the second into BR. For addition, compute . For subtraction, complement every bit of BR, add 1 and then add it to AC, i.e. . Set the overflow flag . If the answer is out of range; otherwise AC holds the result.
Perform 90 - 43 (8-bit).
, .
1's complement of 43: . Add 1: , which is .
Now :
The carry out of the sign bit (the leftmost 1) is discarded, leaving .
Carry into the sign bit is 1 and the carry out of the sign bit is 1, so and there is no overflow.
, which equals .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
How parity bit is generated in even parity? Demonstrate with suitable table and circuit diagram.
Answer
Parity bit. A parity bit is an extra bit added to a group of data bits to detect single-bit errors in transmission or storage. In even parity the parity bit is chosen so that the total number of 1s in the data bits plus the parity bit is even. The parity bit is therefore the XOR of the data bits: .
Generation for a 3-bit message .
| x | y | z | No. of 1s in data | Even parity bit P |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 2 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 2 | 0 |
| 1 | 1 | 0 | 2 | 0 |
| 1 | 1 | 1 | 3 | 1 |
From the table, (P is 1 exactly when the number of 1s in the data is odd).
Circuit. The parity generator uses two XOR gates in cascade:
x ──┐
XOR ──┐
y ──┘ XOR ──── P (even parity bit)
z ────────┘
Gate 1 gives ; gate 2 gives . The transmitted word is .
Checking at the receiver. The parity checker is a 4-input XOR of (three XOR gates). The output is 0 when no error has occurred (even number of 1s) and 1 when a single-bit error has occurred. Parity cannot detect an even number of bit errors and cannot locate the error.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is instruction format? Explain instruction formats of basic computer and give two examples of each type of instructions.
Answer
Instruction format. An instruction format is the layout of the bits of an instruction, divided into fields: the operation code (opcode), which specifies the operation, the addressing-mode bit, and the address or operand fields. It tells the control unit how to interpret the instruction.
Instruction formats of the basic computer. The basic computer has 16-bit instructions and a 12-bit address. The three formats are:
1. Memory-reference instructions. Bits 12-14 hold the opcode (000 to 110), bit 15 is the addressing mode (0 = direct, 1 = indirect), and bits 0-11 hold the address.
| 15 | 14-12 | 11-0 |
|---|---|---|
| I | Opcode (000-110) | Address |
Examples: AND (opcode 000), ADD (opcode 001; ), LDA (010), STA (011), BUN (100), BSA (101), ISZ (110).
2. Register-reference instructions. Bits 12-15 are (opcode 111 with ), and bits 0-11 select one register operation (one bit set per instruction).
| 15-12 | 11-0 |
|---|---|
| 0111 | Register operation |
Examples: CLA (clear AC, 7800 hex), CMA (complement AC, 7200 hex), also INC, CIR, HLT.
3. Input-output instructions. Bits 12-15 are (opcode 111 with ), and bits 0-11 select an I/O operation.
| 15-12 | 11-0 |
|---|---|
| 1111 | I/O operation |
Examples: INP (input character to AC, F800 hex), OUT (output character from AC, F400 hex), also SKI, SKO, ION, IOF.
The control decides the type from bits 12-14 and 15: if the opcode is not 111 it is memory-reference; if it is 111 and register-reference; if input-output.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What microoperations are performed in fetch phase of instruction cycle of basic computer? Explain with suitable circuit diagram.
Answer
Fetch phase. The instruction cycle of the basic computer is fetch, decode, read the effective address (for indirect), and execute. The fetch phase reads the instruction from the memory address held in PC, puts it in IR and increments PC. It is controlled by the timing signals from a sequence counter SC (with meaning no interrupt pending).
Microoperations of fetch (when ).
- : the address of the next instruction is transferred from PC to the address register AR.
- : the instruction is read from memory at address AR into IR, and PC is incremented to point to the next instruction.
- : the opcode bits 12-14 are decoded into , the address part is copied to AR, and the mode bit goes to flip-flop .
Circuit (bus transfers).
SC --> 3x8 decoder --> T0, T1, T2 ...
T0: S2S1S0 = 010 (select PC on bus) ; LD(AR) = 1
T1: S2S1S0 = 111 (select memory) ; Read = 1 ; LD(IR) = 1 ; INR(PC) = 1
T2: LD(AR) <- IR(0-11) ; decoder 3x8 on IR(12-14) ; I <- IR(15)
In the common-bus circuit, puts PC on the bus and enables the load input of AR. At the memory output is selected on the bus, the read signal is on, IR loads the bus and PC receives an increment pulse. At the opcode in IR is decoded by a 3-to-8 decoder to give to and the address bits of IR load AR, while IR bit 15 is stored in flip-flop . After , the control goes on to the execute phase (or the indirect-address cycle at if ).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What do you understand by Flynn’s classification? Explain.
Answer
Flynn's classification. Michael Flynn (1966) classified computer architectures by the number of instruction streams (sequence of instructions executed) and data streams (sequence of data operated on) that can be processed simultaneously. This gives four classes.
1. SISD (Single Instruction, Single Data). One control unit fetches one instruction stream and executes it on one data stream. Instructions are executed sequentially (although they may overlap through pipelining). Example: a conventional uniprocessor, the classic von Neumann machine.
2. SIMD (Single Instruction, Multiple Data). One control unit broadcasts the same instruction to many processing elements, each operating on its own data. It suits data-parallel work such as array and matrix computation, image processing and graphics. Examples: array processors, vector processors, GPUs, SSE/AVX.
3. MISD (Multiple Instruction, Single Data). Several processing units execute different instructions on the same data stream. It is rarely built; examples are systolic arrays and some fault-tolerant systems where several units process the same data and vote.
4. MIMD (Multiple Instruction, Multiple Data). Multiple processors each execute their own instruction stream on their own data, asynchronously. This is the architecture of multiprocessors and multicomputers. Examples: multicore CPUs, SMP servers, clusters, distributed systems. It may be shared-memory (tightly coupled) or distributed-memory (loosely coupled).
| Class | Instruction streams | Data streams | Example |
|---|---|---|---|
| SISD | 1 | 1 | Single-core CPU |
| SIMD | 1 | Many | Vector processor, GPU |
| MISD | Many | 1 | Systolic array |
| MIMD | Many | Many | Multicore, cluster |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Why I/O interface is important? Discuss the concept of programmed I/O with suitable flowchart.
Answer
Importance of the I/O interface. Peripheral devices differ greatly from the CPU and memory, so a direct connection is not possible. An I/O interface is needed because:
- Peripherals are electromechanical devices whose speed is much lower than that of the CPU, so synchronisation is needed.
- Their data formats and word lengths differ from those of the CPU, so the data must be converted (serial/parallel).
- Their signal levels and operating modes are different, so the interface converts them to levels the CPU bus accepts.
- The CPU must be able to select one device out of many (address decoding) and to read device status and send control commands.
- The interface buffers data and, with interrupts or DMA, lets the CPU do other work.
Programmed I/O. In programmed I/O, the transfer of data between the CPU and an I/O device is controlled by instructions in the CPU program. The CPU executes a program that initiates the transfer, and then keeps checking the device's status flag in a loop (polling or busy waiting) until the device is ready. The CPU then transfers the data.
Procedure for input (device to CPU).
- The CPU reads the status register of the interface.
- If the flag shows the device is not ready, repeat step 1 (busy wait).
- If it is ready, read the data register of the interface into a CPU register (the accumulator).
- Write the data from the CPU register to memory.
- Check whether all words are transferred; if not, return to step 1.
Flowchart for input (data transfer from I/O device to CPU).
START
|
v
Read status register <-----------+
| |
Flag set (ready)? --No------------+
| Yes
v
Read data register -> CPU (AC)
|
Transfer data from AC to memory
|
More words? --Yes--> (back to Read status register)
| No
END
For output, the CPU waits for the device to be ready, writes the word to the data register, and the interface sets the flag to "busy" until the device has accepted it.
Drawback: the CPU wastes time in the polling loop because the device is much slower, so programmed I/O is suitable only for simple or small systems. Interrupt-driven I/O and DMA remove this waste.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is meant by cache mapping? Explain working of direct mapping with suitable block diagram.
Answer
Cache mapping. The cache is much smaller than main memory, so a rule is needed to decide where a block of main memory is placed in the cache and how it is found. This rule is the mapping function. The three techniques are direct mapping, associative mapping and set-associative mapping.
Direct mapping. Each block of main memory can go to only one specific cache line, given by
The CPU's address is divided into three fields:
| Tag | Index (line) | Word/offset |
|---|---|---|
| high-order bits | selects the cache line | selects the word in the block |
Example: with a main memory of 32K words (15-bit address) and a cache of 512 words, the address is split into a 6-bit tag, a 9-bit index. (Using one word per block.) The cache stores, with each line, the tag and the data.
Working (block diagram described).
CPU address: [ Tag | Index | Word ]
| |
| v
| Cache memory (index selects one line)
| [ valid | tag | data ]
v |
Comparator <------+ (stored tag)
|
match? -- Yes -> HIT : data to CPU
-- No -> MISS: read block from main memory,
store it with the new tag in that line,
send data to CPU
- The index field of the CPU address selects one line of the cache.
- The tag stored in that line is compared with the tag field of the address.
- If they match (and the valid bit is 1) it is a hit and the word is delivered from the cache.
- Otherwise it is a miss: the block is fetched from main memory, replaces whatever block was in the line and the tag is updated.
Advantages: simple and cheap, needs only one comparator, no replacement algorithm. Disadvantage: if two frequently used blocks map to the same line they keep replacing each other (conflict misses, thrashing), so the hit ratio can be low.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Explain different types of shift microoperations.
Answer
Shift microoperations. Shift microoperations move the bits of a register left or right, and are used for serial transfer, for multiplication/division by powers of 2 and for other data manipulation. The bit shifted in and out depends on the type. There are three types: logical, circular and arithmetic.
1. Logical shift. A logical shift moves the bits and inserts 0 at the vacated end. The bit shifted out is lost (or goes to a carry).
- Shift left:
shl R1means - Shift right:
shr R1means
Example: R1 = 1011; shl gives 0110 (the serial input is 0); shr gives 0101.
2. Circular shift (rotate). The bit shifted out at one end is fed back into the other end, so no data is lost.
- Circular left
cil R1: - Circular right
cir R1:
Example: R1 = 1011; cil gives 0111; cir gives 1101.
3. Arithmetic shift. This shifts a signed binary number while keeping its sign.
- Arithmetic shift right (ashr) keeps the sign bit and shifts the other bits right, copying the sign: . It divides the number by 2. Example: 1100 (-4) becomes 1110 (-2).
- Arithmetic shift left (ashl) shifts all bits left and inserts 0 at the right; it multiplies by 2. Overflow occurs if the sign bit changes: . Example: 0011 (3) becomes 0110 (6).
Hardware. A bidirectional shift register with parallel load can implement all shifts. A combinational shifter built with multiplexers has, for each bit position, a 4-to-1 multiplexer with inputs from the left neighbour, the right neighbour, and the register bit itself, and with the selection signals determining the shift direction. The serial inputs (I_L and I_R) supply 0, the circulated bit, or the sign bit depending on the type of shift.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Write short notes on:
a) CISC
b) Conditional branch
Answer
(a) CISC (Complex Instruction Set Computer). A CISC processor has a large instruction set of powerful, complex instructions, often with variable length and many addressing modes. A single instruction can do a multi-step job, for example loading from memory, performing arithmetic and storing back.
Features:
- Large number of instructions (typically over 200) and 5 to 20 addressing modes.
- Variable-length instruction formats and different execution times.
- Direct memory-to-memory operations are possible.
- Control unit is usually microprogrammed.
- Fewer registers.
- Compact programs, which reduces the semantic gap with high-level languages.
Advantages: small programs and less memory used; simple compiler design. Disadvantages: complex hardware, difficult to pipeline, slow clock cycle; many instructions are rarely used. Examples: Intel x86, VAX, IBM System/360.
(b) Conditional branch. A conditional branch instruction changes the flow of a program, i.e. loads the PC with the target address, only if a specified condition is true; otherwise execution continues with the next instruction. The condition is based on the status flags (condition codes) set by earlier instructions: carry C, sign S, zero Z, overflow V, and so on.
Examples:
| Instruction | Branch condition |
|---|---|
| BZ (branch if zero) | Z = 1 |
| BNZ (branch if not zero) | Z = 0 |
| BC (branch if carry) | C = 1 |
| BN (branch if minus) | S = 1 |
| BV (branch if overflow) | V = 1 |
| BP (branch if plus), BGT, BLT etc. | Based on signed or unsigned comparison |
Operation: if (condition) effective address, else . A comparison instruction such as CMP A, B sets flags first and then the branch tests them. Conditional branches are used to implement if, loops and decisions. In pipelined machines they cause control hazards, handled by branch prediction and delayed branching. An unconditional branch (jump) always changes the PC.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
Questions from TU BSc CSIT 2075 Third Semester Numerical Method (TU IOST board exam, 2075), TU BSc CSIT 2077 Third Semester Numerical Method (TU IOST board exam, 2077), TU BSc CSIT 2078 Third Semester Numerical Method (TU IOST board exam, 2078), TU BSc CSIT 2079 Third Semester Numerical Method (TU IOST board exam, 2079), TU BSc CSIT 2080 Third Semester Numerical Method (TU IOST board exam, 2080), TU BSc CSIT 2081 Third Semester Numerical Method (TU IOST board exam, 2081), TU BSc CSIT 2075 Third Semester Computer Architecture (TU IOST board exam, 2075), TU BSc CSIT 2077 Third Semester Computer Architecture (TU IOST board exam, 2077), TU BSc CSIT 2078 Third Semester Computer Architecture (TU IOST board exam, 2078), TU BSc CSIT 2079 Third Semester Computer Architecture (TU IOST board exam, 2079), TU BSc CSIT 2080 Third Semester Computer Architecture (TU IOST board exam, 2080), TU BSc CSIT 2081 Third Semester Computer Architecture (TU IOST board exam, 2081), TU BSc CSIT 2075 Third Semester Computer Graphics (TU IOST board exam, 2075), TU BSc CSIT 2077 Third Semester Computer Graphics (TU IOST board exam, 2077), TU BSc CSIT 2078 Third Semester Computer Graphics (TU IOST board exam, 2078), TU BSc CSIT 2079 Third Semester Computer Graphics (TU IOST board exam, 2079), TU BSc CSIT 2080 Third Semester Computer Graphics (TU IOST board exam, 2080), TU BSc CSIT 2081 Third Semester Computer Graphics (TU IOST board exam, 2081), TU BSc CSIT 2082 Third Semester Computer Graphics (TU IOST board exam, 2082), TU BSc CSIT 2074 Third Semester Data Structures and Algorithms (TU IOST board exam, 2074), TU BSc CSIT 2075 Third Semester Data Structures and Algorithms (TU IOST board exam, 2075), TU BSc CSIT 2077 Third Semester Data Structures and Algorithms (TU IOST board exam, 2077), TU BSc CSIT 2078 Third Semester Data Structures and Algorithms (TU IOST board exam, 2078), TU BSc CSIT 2079 Third Semester Data Structures and Algorithms (TU IOST board exam, 2079), TU BSc CSIT 2080 Third Semester Data Structures and Algorithms (TU IOST board exam, 2080), TU BSc CSIT 2081 Third Semester Data Structures and Algorithms (TU IOST board exam, 2081), TU BSc CSIT 2075 Third Semester Statistics II (TU IOST board exam, 2075), TU BSc CSIT 2077 Third Semester Statistics II (TU IOST board exam, 2077), TU BSc CSIT 2078 Third Semester Statistics II (TU IOST board exam, 2078), TU BSc CSIT 2079 Third Semester Statistics II (TU IOST board exam, 2079), TU BSc CSIT 2080 Third Semester Statistics II (TU IOST board exam, 2080), TU BSc CSIT 2081 Third Semester Statistics II (TU IOST board exam, 2081) and TU BSc CSIT 2082 Third Semester Statistics II (TU IOST board exam, 2082). Answers are written for this site; check them against your class notes.