পরীক্ষা আর্কাইভ

৪৯তম বিসিএস ⎯ তথ্য ও যোগাযোগ প্রযুক্তি [২৮১]

পরীক্ষা৪৯তম বিসিএস ⎯ তথ্য ও যোগাযোগ প্রযুক্তি [২৮১]তারিখতারিখ অনির্ধারিতসময়27 minutes
মোট প্রশ্ন৪৮
সিলেবাস
Exam 13 Computer Architecture: Instructions and data access methods, Processor design, Memory organization. Communication Theory: Spectral analysis, Information theory, Analog communication system, Digital modulation, Pulse and digital signals, Multiplexing. [Source: Class-11 and relevant books]
ঘনত্ব
উত্তর
উত্তরিতবর্তমানপুনরায় দেখুনঅসম্পূর্ণ

৪৯তম বিসিএস ⎯ তথ্য ও যোগাযোগ প্রযুক্তি [২৮১]

৪৯তম বিসিএস ⎯ তথ্য ও যোগাযোগ প্রযুক্তি [২৮১] · তারিখ অনির্ধারিত · ৪৮ প্রশ্ন

.
For an 8-bit signed integer, what is the range of values?
  1. 0 to 255
  2. –128 to +127
  3. –255 to +255
  4. –127 to +128
ব্যাখ্যা

or an 8-bit signed integer, one bit is used for the sign (positive or negative) and the remaining 7 bits are used to represent the magnitude of the number.

• The most significant bit (MSB) is used as the sign bit:
-> 0 indicates a positive number.
-> 1 indicates a negative number.

• For positive numbers (when the MSB is 0), the remaining 7 bits can represent values from 0 to 127 (which is 27−1).

• For negative numbers (when the MSB is 1), the values are represented in two's complement. In two's complement, the most negative value is −27, or -128, and the most positive value is +127.

The range for an 8-bit signed integer is from -128 to +127.

Source:
 Digital Logic & Computer Design By M. Morris Mano

.
Which of the following is the hexadecimal equivalent of the binary number 101101011001?
  1. B95
  2. A9B
  3. 5D9
  4. C8B
ব্যাখ্যা

Step 1: Understand the Relationship Between Binary and Hexadecimal

• Binary (Base-2) uses digits 0 and 1.
• Hexadecimal (Base-16) uses digits 0-9 and letters A-F.
• 1 hex digit = 4 binary digits (bits).

So, every group of 4 bits in binary can be directly converted into one hex digit.

Step 2: Group Binary Digits into 4-Bit Blocks

• The given binary number is 101101011001
• Count the digits: 12 bits.
• Since hex groups are 4 bits, we can split this 12-bit number into 3 groups of 4 bits each.
• Start grouping from the right (least significant bit): 1011 0101 1001
1011 is Leftmost group, 0101 is Middle group, 1001 is Rightmost group

Step 3: Convert Each 4-Bit Group to Hexadecimal
We use this conversion table:

Now convert each group:
1011 is B
0101 is 5
1001 is 9

Step 4: Combine the Hex Digits
Combine the hex digits in the same order (left to right):
Binary 101101011001 is Hexadecimal B59

The answer is B59

Source:  Digital Logic & Computer Design By M. Morris Mano

.
Which of the following is a common measure of computer performance?
  1. Clock speed of the CPU
  2. Instruction execution time
  3. CPU utilization
  4. All of the above
ব্যাখ্যা

Computer performance can be evaluated using multiple metrics:
Clock speed: Measures how many cycles per second the CPU executes.
Instruction execution time: Measures the time taken to execute a program or instruction.
CPU utilization: Percentage of time the CPU is actively executing instructions.

All these factors together help determine overall system performance.

Example:
A CPU with a higher clock speed and lower instruction execution time will generally perform better.

Source:  Digital Logic & Computer Design By M. Morris Mano

.
Which factor does not affect the instruction count of a program?
  1. Program algorithm
  2. Compiler efficiency
  3. CPU architecture
  4. Processor clock rate
ব্যাখ্যা

Processor clock rate: It does not affect instruction count.
Clock rate (e.g., 2 GHz vs 3 GHz) only affects how fast instructions are executed, not how many instructions are required.

Instruction Count (IC) depends on:

Algorithm: Different algorithms perform different numbers of operations.
Example:
Searching in a list → Linear Search vs Binary Search.
Binary Search = fewer instructions.

Compiler efficiency: Different compilers may generate more or fewer instructions for the same high-level code.
Example:
Optimizing compiler removes redundant operations → fewer instructions.

CPU Architecture / Instruction Set: The ISA determines how high-level code translates into machine instructions.
Example:
A single C statement may compile into 2 instructions in CISC but 5 in RISC.

Source:  Digital Logic & Computer Design By M. Morris Mano

.
If a CPU has a clock frequency of 2 GHz, what is the clock cycle time?
  1. 0.25 ns
  2. 0.5 ns
  3. 2 ns
  4. 5 ns
ব্যাখ্যা

Given that,
Clock frequency = 2GHz = 2×109 Hz
Clock Cycle Time = ?

Now,
The Clock Cycle Time is the reciprocal of clock frequency,
∴ Clock Cycle Time = 1/ Clock frequency
= 1/ 2×109 
= 0.5 × 10-9
so, Clock Cycle Time = 0.5 × 10-9 s
∴ Clock Cycle Time = 0.5 ns  [1ns =10-9 s]
The answer is 0.5 ns

Source:  Digital Logic & Computer Design By M. Morris Mano.

.
Which formula is used to compare performance of two computers, A and B, executing the same program?
  1. Performance(A) / Performance(B) = Execution Time(B) / Execution Time(A)
  2. Performance(A) / Performance(B) = Execution Time(A) / Execution Time(B)
  3. Performance(A) / Performance(B) = Clock Rate(A) / Clock Rate(B)
  4. Performance(A) / Performance(B) = CPI(A) / CPI(B)
ব্যাখ্যা

Performance is defined as the inverse of execution time,
Performance = 1/ Execution Time

For two machines A and B running the same program,

Performance Ratio = Performance(A)/ Performance(B)
= { 1/Execution Time(A) } / { 1/Execution Time(B) }

∴ Performance(A)/ Performance(B) = Execution Time(B) / Execution Time(A)

Source:  Digital Logic & Computer Design By M. Morris Mano.

.
Which of the following best defines a computer instruction?
  1. A sequence of steps performed by the CPU to execute a program
  2. A set of electrical signals sent to memory
  3. A binary code that specifies an operation and the data to be operated on
  4. A method for transferring data between peripherals
ব্যাখ্যা

A computer instruction is a binary-encoded command that tells the CPU which operation to perform and what operands (data) to use. Instructions form the machine language of a computer.

Example:
The 8086 assembly instruction ADD AX, BX is translated into binary that the CPU understands, specifying an addition operation and the registers involved.

Source:  Digital Logic & Computer Design By M. Morris Mano

.
Which of the following is not a basic operation performed by computer hardware?
  1. Data transfer
  2. Arithmetic operations
  3. Control operations
  4. Program compilation
ব্যাখ্যা

Basic hardware operations include:
Data Transfer:
Moving data between memory, registers, or I/O devices
Arithmetic Operations: Addition, subtraction, multiplication, division
Logical Operations: AND, OR, NOT, XOR
Control Operations: Branch, jump, call, return

Program compilation is a software process, not a hardware operation.

Example:
The CPU ALU performs arithmetic and logic operations, while data moves between registers and memory during program execution.

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

.
Which of the following describes an operand in a computer instruction?
  1. The command to perform a particular operation
  2. The data or address on which the operation is performed
  3. The control signal used for execution
  4. The CPU clock frequency
ব্যাখ্যা

An operand is the data (immediate value, register, or memory address) that the CPU operates on using the instruction. Instructions can have zero, one, or multiple operands depending on the operation.

Example:
In the instruction MOV AX, 5, 5 is the operand.
In ADD AX, BX, AX and BX are operands.

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

১০.
Which of the following is an example of a direct addressing mode?
  1. MOV AX, [1234h]
  2. MOV AX, BX
  3. MOV AX, [BX+SI]
  4. MOV AX, 5
ব্যাখ্যা

In direct addressing mode, the address field of the instruction specifies the memory location of the operand directly.

Example:
MOV AX, [1234h]: The data from memory address 1234h is moved into register AX.

Other modes:
Register addressing (MOV AX, BX)
Register indirect (MOV AX, [BX+SI])
Immediate (MOV AX, 5)

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

১১.
Which of the following is the method of data access in computer architecture?
  1. Sequential access
  2. Direct access
  3. Both of Sequential access and Direct access
  4. None of the above 
ব্যাখ্যা

The method of accessing data depends on the storage device and the type of operation required, as stated in the table below,


Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

১২.
Which of the following correctly describes the instruction cycle of a CPU?
  1. Fetch → Decode → Execute → Store/Write back
  2. Read → Process → Write
  3. Fetch → Execute → Decode → Store
  4. Decode → Fetch → Execute
ব্যাখ্যা

The instruction cycle is the sequence of steps the CPU performs to execute an instruction.

Fetch: Retrieve the instruction from memory
Decode: Determine the operation and operands
Execute: Perform the operation
Store/Write back: Save the result back to memory or register

Example:
ADD AX, BX → Fetch instruction → Decode opcode → Add contents → Store result in AX

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

১৩.
Which components are commonly found in a computer instruction format?
  1. Opcode, Operand(s), Addressing mode
  2. Instruction size, Clock cycles, Register status
  3. Program counter, Stack pointer, Flag register
  4. Bus width, Cache size, Clock frequency
ব্যাখ্যা

A computer instruction typically consists of the following,
Opcode: Specifies the operation to be performed (e.g., ADD, MOV).
Operand(s): Specifies data or memory/register locations to be used.
Addressing mode: Specifies how to interpret the operand(s) (immediate, direct, indirect, etc.).

Example:
MOV AX, [2000h]

Opcode:
MOV
Operand: AX, [2000h]
Addressing mode: Direct addressing

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

১৪.
Which of the following factors determines the length of a computer instruction?
  1. Number of operands
  2. Size of opcode
  3. Addressing mode used
  4. All of the above
ব্যাখ্যা

The instruction length depends on several factors.
• More operands require more bits.
• Larger opcode requires more bits.
• Addressing modes (immediate, direct, indirect) may need additional bits for addresses.

Example:
A RISC CPU may have fixed-length instructions (e.g., 32 bits), whereas a CISC CPU may have variable-length instructions depending on operands and addressing mode.

Source:  Digital Logic & Computer Design By M. Morris Mano.

১৫.
Which addressing mode uses the program counter (PC) plus offset?
  1. Immediate
  2. Direct
  3. Relative
  4. Register indirect
ব্যাখ্যা

In relative addressing mode, the operand’s address is determined by adding an offset to the current program counter (PC). This is commonly used for branch and jump instructions.

Example:
JMP 05h → Jump to PC + 05h.

Source:  Digital Logic & Computer Design By M. Morris Mano

১৬.
Consider the instruction MOV AX, [BX+SI+05h]. Which addressing mode is used here?
  1. Register indirect
  2. Indexed with displacement
  3. Direct
  4. Immediate
ব্যাখ্যা

BX → Base register
SI → Index register
05h → Displacement
Effective Address = BX + SI + 05h, which is a classic indexed addressing mode with displacement.

Example:
Used to access array elements with a base address in BX, index in SI, and fixed offset for specific element.

Source:  Digital Logic & Computer Design By M. Morris Mano

১৭.
The instruction JMP LABEL uses relative addressing. If the instruction ADD AX, 5 precedes it, which addressing modes are used in these two instructions combined?
  1. Immediate and relative
  2. Direct and register indirect
  3. Register and indexed
  4. Immediate and direct
ব্যাখ্যা

ADD AX, 5
• Here, operand 5 is a constant value given in the instruction.
• This is Immediate Addressing Mode (the operand is specified directly in the instruction).
• Operand AX is a register, but the important addressing mode for the literal value is immediate.

JMP LABEL
• This transfers control to a LABEL, usually represented as an offset relative to the Program Counter (PC).
• This is Relative Addressing Mode (effective address = PC + displacement).

Now,
• First instruction uses Immediate addressing.
• Second instruction uses Relative addressing.

Source:  Digital Logic & Computer Design By M. Morris Mano

১৮.
Which instruction combines register, memory, and immediate addressing?
  1. ADD [2000h], AX
  2. SUB AX, [BX+05h]
  3. MOV [2000h], AX
  4. ADD [BX+SI+04h], 10
ব্যাখ্যা

Register addressing: Operand comes from a register. Example: ADD AX, BX.
Memory addressing: Operand comes from memory (direct or indirect). Example: MOV AX, [2000h].
Immediate addressing: Operand is a constant value in the instruction. Example: ADD AX, 5.

ADD [BX+SI+04h], 10
• [BX+SI+04h] = Memory operand (indexed with registers BX + SI + displacement).
• 10 = Immediate constant.
• This uses memory + immediate.
• The memory part itself already involves registers (BX, SI).
• Combines register (BX, SI), memory, and immediate

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

১৯.
In the instruction LOOP LABEL, which addressing modes are involved if the loop decrements CX and jumps?
  1. Relative (for jump) + implicit register (CX)
  2. Immediate + indexed
  3. Direct + immediate
  4. Register indirect + displacement
ব্যাখ্যা

The LOOP instruction in x86 does:
• Decrement CX (or ECX in 32-bit mode) → implicit use of a register.
• If CX ≠ 0, jump to LABEL.
i. The LABEL is encoded as a displacement relative to the Program Counter (PC).
ii. This is relative addressing.

Addressing modes involved:
• CX: used implicitly → Implicit Register Addressing.
• LABEL: encoded as an offset from PC → Relative Addressing.

So, the combined addressing modes are Relative (for jump) + Implicit register (CX)

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২০.
Shannon’s channel capacity formula is:
  1. C = B log2(1 + S/N)
  2. C = S/N × B
  3. C = B/S
  4. C = log2(B × N)
ব্যাখ্যা

Claude Shannon gave a formula for the maximum data rate (channel capacity) of a communication channel with bandwidth B Hz and signal-to-noise ratio (S/N).

C=Blog2(1+S/N)

Where:
C = channel capacity in bits/sec
B = channel bandwidth (Hz)
S/N = signal-to-noise ratio (power ratio, not dB)

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২১.
Which of the following status flags may be set by an ALU after an operation?
  1. Zero flag (Z)
  2. Carry flag (C)
  3. Overflow flag (O)
  4. All of the above
ব্যাখ্যা

ALU sets status flags based on the result of operations:
Zero (Z): Result is zero
Carry (C): An arithmetic carry/borrow occurred
Overflow (O): Signed arithmetic overflow occurred

Example:
ADD AX, BX resulting in 0 → Zero flag set
ADD AL, 0xFF → Carry flag set

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২২.
Which of the following is a digital modulation scheme?
  1. ASK (Amplitude Shift Keying)
  2. FSK (Frequency Shift Keying)
  3. PSK (Phase Shift Keying)
  4. All of the above
ব্যাখ্যা

ASK: Carrier amplitude varies with digital data
FSK: Carrier frequency varies
PSK: Carrier phase varies

Example:
Modems use PSK or FSK for transmitting binary data

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২৩.
Which of the following best defines a floating-point number?
  1. A number stored with a fixed number of decimal places
  2. A number that is always an integer
  3. A number that cannot be negative
  4. A number represented by a mantissa and exponent, allowing a wide range
ব্যাখ্যা

Floating-point numbers use a mantissa (significant) and exponent to represent numbers in scientific notation, which allows a wide dynamic range of values.

Example:
• 6.022 × 10 × 23 → Mantissa = 6.022, Exponent = 23
• In IEEE 754 single precision, this is stored in 32 bits (1 sign bit, 8 exponent bits, 23 mantissa bits).

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss.

২৪.
In floating-point addition, which step is performed first?
  1. Align exponents
  2. Add mantissas
  3. Normalize result
  4. Round the result
ব্যাখ্যা

Before adding floating-point numbers, their exponents must match. The smaller exponent is adjusted by shifting the mantissa. After alignment, mantissas are added, followed by normalization and rounding.

Example:
Add 1.23 × 103 + 4.56 × 102

• Align exponents: 1.23 × 103 + 0.456 × 103 = 1.686 × 103
• Normalize and round as needed.

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss.

২৫.
Which problem can occur during floating-point subtraction of nearly equal numbers?
  1. Overflow
  2. Underflow
  3. Cancellation error (loss of significance)
  4. None of the above
ব্যাখ্যা

When two nearly equal numbers are subtracted, most leading digits cancel, leaving only a few significant digits. This can lead to loss of precision, called cancellation error.

Example:
12345.67 – 12345.66 = 0.01 → only two digits of precision remain, potential accuracy loss in computation.

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২৬.
Which rounding mode is commonly used in IEEE 754 standard?
  1. Round toward zero
  2. Round to nearest even
  3. Round toward negative infinity
  4. Round toward positive infinity
ব্যাখ্যা

IEEE 754 specifies round to nearest even as the default to reduce bias in repeated rounding. If exactly halfway, round to the nearest even mantissa.

Example:
• 2.5 rounds to 2 (even)
• 3.5 rounds to 4 (even)

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২৭.
Which of the following is a typical floating-point exception?
  1. Overflow
  2. Underflow
  3. Invalid operation (NaN)
  4. All of the above
ব্যাখ্যা

Floating-point operations can trigger exceptions:
Overflow: Result too large to represent
Underflow: Result too small to represent
Invalid operation: e.g., 0/0, (-1), results in NaN

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২৮.
In FM, what happens when the message signal amplitude increases?
  1. Carrier frequency increases
  2. Frequency deviation increases
  3. Carrier amplitude increases
  4. Signal bandwidth decreases
ব্যাখ্যা

Frequency Modulation (FM):
s(t)=Ac ​cos [ 2π fc ​t + kf​ ∫m(t) dt ]

Where,

Ac = carrier amplitude (constant in FM).
fc = carrier frequency.
m(t) = message signal.
kf = frequency sensitivity.

In FM, message signal amplitude affects the frequency deviation (Δf):

Δf=kf⋅∣m(t)∣max
 ​

• FM varies carrier frequency proportionally to message amplitude
• Peak deviation = k × message amplitude

Example:
Audio signal with higher amplitude → wider frequency swing of FM carrier


Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

২৯.
Which of the following is a characteristic of a single-cycle processor?
  1. Each instruction takes multiple clock cycles
  2. All instructions complete in one clock cycle
  3. Uses multiple ALUs for parallel execution
  4. Requires instruction pipelining
ব্যাখ্যা

In a single-cycle processor, the clock period is long enough to accommodate the slowest instruction. Every instruction, regardless of complexity, completes in one clock cycle.

Example:
ADD and MUL instructions both execute in one cycle; therefore, the clock must be long enough for multiplication to complete.

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

৩০.
Which statement correctly describes a multi-cycle processor?
  1. Each instruction completes in exactly one clock cycle
  2. All instructions share the same datapath cycle time
  3. Memory access is eliminated
  4. Instructions take a varying number of cycles to execute
ব্যাখ্যা

In a multi-cycle processor, instructions are broken into stages (fetch, decode, execute, memory access, write-back), each taking one cycle. Different instructions may require different numbers of cycles.

Example:
ADD may take 4 cycles, MUL may take 6 cycles. Clock period is shorter than single-cycle processor.

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

৩১.
Which of the following is an advantage of a multi-cycle processor over a single-cycle processor?
  1. Simpler control
  2. Shorter clock period
  3. All instructions take the same time
  4. Requires no control unit
ব্যাখ্যা

Recall single-cycle processor:
• In a single-cycle processor, each instruction executes in exactly one clock cycle.
• The clock cycle must be long enough for the slowest instruction.
• Control is simpler (but that’s not efficiency).

Result: inefficient hardware usage because simpler instructions waste time waiting for the clock to finish.

Recall multi-cycle processor:
In a multi-cycle processor, instructions are divided into multiple steps (fetch, decode, execute, memory access, write-back).
• Each step is executed in one clock cycle.
• The clock period is determined by the longest step, not the longest instruction.
• Complex instructions take more cycles, simple instructions take fewer cycles.

Result: shorter clock period → faster execution on average.

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

৩২.
Which are the two main types of control units?
  1. Hardware and Software
  2. Hardwired and Microprogrammed
  3. Synchronous and Asynchronous
  4. Single-cycle and Multi-cycle
ব্যাখ্যা

Hardwired CU: Uses combinational logic circuits to generate control signals.
Microprogrammed CU: Uses a control memory storing microinstructions to generate control signals.

Example:
• Hardwired CU → Faster, less flexible
• Microprogrammed CU → Easier to modify for new instruction sets

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

৩৩.
Which fields are typically present in a microinstruction?
  1. Control field, Next-address field, Optional condition field
  2. Opcode, Operand, Address
  3. Instruction register, Program counter, Stack pointer
  4. ALU input, Clock, Flag
ব্যাখ্যা

A microinstruction is a low-level instruction that defines the control signals in a microprogrammed control unit of the CPU.
It typically contains fields to:
• Generate control signals for datapath elements (ALU, memory, I/O, registers).
• Specify next microinstruction (next-address field).
• Optional condition field for branching (e.g., check Zero flag, carry, etc.).

Example:
Microinstruction sequence:
Step 1: Activate ALU for addition
Step 2: Store result → jump to next microinstruction

Source: Data Structures and Algorithm Analysis in C by Mark Allen Weiss

৩৪.
Which control unit design is preferred for implementing a complex instruction set computer (CISC)?
  1. Hardwired
  2. Microprogrammed
  3. Register indirect
  4. Single-cycle
ব্যাখ্যা

• CISC instruction sets have complex instructions.
• CISC has a large number of instructions, some of which are complex and may take multiple cycles to execute.
• Instructions can perform multiple low-level operations (like memory access, arithmetic, branching) in a single instruction.
• Microprogrammed CU simplifies implementation because each instruction can be represented as a sequence of microinstructions.

Source:  Digital Logic & Computer Design By M. Morris Mano

৩৫.
Which of the following are types of pipeline hazards?
  1. Data hazard
  2. Control hazard
  3. Structural hazard
  4. All of the above
ব্যাখ্যা

Data hazard: Occurs when an instruction depends on the result of a previous instruction that has not yet completed.
Control hazard: Occurs due to branch or jump instructions affecting instruction fetch.
Structural hazard: Occurs when hardware resources are insufficient for all concurrent instructions.

Example:
Data hazard: ADD R1, R2, R3 followed by SUB R4, R1, R5
Control hazard: Conditional branch instruction
Structural hazard: Only one memory port but multiple instructions need access simultaneously

Source:  Digital Logic & Computer Design By M. Morris Mano

৩৬.
Which type of data hazard occurs when an instruction reads a register before a previous instruction writes to it?
  1. RAW (Read After Write)
  2. WAR (Write After Read)
  3. WAW (Write After Write)
  4. Structural hazard
ব্যাখ্যা

RAW hazard (true dependency): Instruction needs to read a value before it is updated by a previous instruction.
WAR hazard (anti-dependency): Instruction writes to a location before it is read by an earlier instruction
WAW hazard (output dependency): Instruction writes to a location before it is updated by a previous instruction

Example:
ADD R1, R2, R3
SUB R4, R1, R5  [ <- RAW hazard on R1 ]

Source:  Digital Logic & Computer Design By M. Morris Mano

৩৭.
Which technique helps reduce control hazards in a pipeline?
  1. Branch prediction
  2. Forwarding
  3. Stalling the pipeline indefinitely
  4. Increasing instruction memory
ব্যাখ্যা

Branch prediction guesses the outcome of a branch instruction to keep the pipeline filled.
Correct predictions avoid pipeline stalls caused by control hazards.

Example:
CPU predicts BEQ R1, R2 as not taken → continues fetching instructions
If prediction fails → flush pipeline and fetch correct instructions

Source:  Digital Logic & Computer Design By M. Morris Mano

৩৮.
Which of the following is a type of exception?
  1. Arithmetic overflow
  2. Divide-by-zero
  3. Invalid opcode
  4. All of the above
ব্যাখ্যা

Exceptions can arise due to hardware or software events, including:
• Arithmetic overflow: Result too large for CPU representation
• Divide-by-zero: Illegal arithmetic operation
• Invalid opcode: Attempt to execute a non-existent instruction

Example:
Instruction DIV R1, 0 → Divide-by-zero exception
Instruction ADD R1, 0xFFFF, 0xFFFF → Arithmetic overflow

Source:  Digital Logic & Computer Design By M. Morris Mano

৩৯.
What is the typical mechanism to handle exceptions in a CPU?
  1. Branch prediction
  2. Jump to exception service routine
  3. Re-execution of instruction by default
  4. Ignoring the exception
ব্যাখ্যা

CPU saves the program counter and processor state, then jumps to an exception handler (service routine) to resolve the exception.
After handling, control may return to the interrupted instruction or the next instruction.

Example:
Divide-by-zero → CPU jumps to routine that prints error message and stops program safely.

Source:  Digital Logic & Computer Design By M. Morris Mano

৪০.
Which of the following is a major advantage of a superscalar processor?
  1. Higher instruction throughput
  2. Complete elimination of pipeline hazards
  3. Simplified control unit design
  4. Fixed instruction execution order
ব্যাখ্যা

Multiple instructions per cycle increase throughput.
Superscalar processors do not eliminate hazards; hardware or dynamic scheduling handles them.
Control complexity increases, not decreases.

Example:
A 4-way superscalar CPU can ideally execute 4 instructions per clock cycle, depending on instruction independence.

Source:  Digital Logic & Computer Design By M. Morris Mano

৪১.
Which mechanism is commonly used in dynamic pipelining for hazard resolution?
  1. Branch prediction
  2. Scoreboarding
  3. Both of Branch prediction and Scoreboarding
  4. None of the above
ব্যাখ্যা

Scoreboarding: Tracks instruction status and functional unit availability to resolve hazards.
Tomasulo Algorithm: Uses register renaming and reservation stations to execute instructions out-of-order dynamically.

Example:
Instruction ADD R1, R2, R3 may wait if R2 is not ready; scoreboarding keeps track of availability.

Source:  Digital Logic & Computer Design By M. Morris Mano

৪২.
Out-of-order execution in dynamic pipelining primarily aims to:
  1. Reduce clock frequency
  2. Eliminate the need for an ALU
  3. Execute instructions in the original program order only
  4. Increase instruction throughput by executing independent instructions ahead of stalled ones
ব্যাখ্যা

In a pipelined processor, hazards (like data hazards, structural hazards) may stall the pipeline.
Out-of-order execution (dynamic scheduling using Tomasulo’s algorithm or reservation stations) allows the CPU to:
• Execute instructions as soon as operands are ready, even if earlier instructions are waiting.
• Independent instructions can “overtake” stalled ones.
• This improves instruction throughput and keeps pipeline units busy.
At the end, results are committed in program order (to maintain correctness).

Dynamic scheduling allows independent instructions to be executed out-of-order while waiting for operands of stalled instructions.
This minimizes pipeline stalls and increases overall performance.

Source:  Digital Logic & Computer Design By M. Morris Mano.

৪৩.
What is the primary purpose of cache memory in a computer system?
  1. Store all program instructions permanently
  2. Replace main memory entirely
  3. Reduce average memory access time by storing frequently used data
  4. Control input/output devices
ব্যাখ্যা

Cache memory is a small, fast memory placed between CPU and main memory.
It stores frequently accessed instructions and data to reduce latency and improve performance.
Cache is much faster than main memory but smaller in size.

Example:
CPU frequently accesses variable X → X is kept in cache → next access is faster.

Source:  Digital Logic & Computer Design By M. Morris Mano.

৪৪.
What is a cache hit?
  1. When CPU finds the required data in main memory
  2. When CPU finds the required data in cache memory
  3. When CPU misses both cache and main memory
  4. When data is not yet computed
ব্যাখ্যা

A cache hit occurs in a computer system when the CPU requests data and that data is found in the cache memory.
Cache Memory:
Cache is a small, high-speed memory located close to the CPU.
It stores frequently accessed instructions or data from the main memory (RAM) to reduce access time.

CPU Data Request:
When the CPU needs data, it first checks the cache memory.
If the requested data is present in the cache, it can be accessed much faster than fetching it from main memory.

Source:  Digital Logic & Computer Design By M. Morris Mano

৪৫.
Which of the following are common cache write policies?
  1. Write-through
  2. Write-back
  3. Both of Write-through and Write-back
  4. None of the above 
ব্যাখ্যা

Write-through: Data is written to both cache and main memory simultaneously.
Write-back: Data is written to cache only; main memory updated later when cache block is replaced.

Each policy has trade-offs in speed and memory consistency.

Example:
MOV [X], R1 → in write-through, memory updated immediately; in write-back, updated later.

Source:  Digital Logic & Computer Design By M. Morris Mano

৪৬.
Which statement correctly describes cache levels (L1, L2, L3)?
  1. L1 is largest and slowest; L3 is smallest and fastest
  2. L1 is smallest and fastest; L3 is largest and slowest
  3. All levels have same size and speed
  4. Cache levels are unrelated to performance
ব্যাখ্যা

L1: Closest to CPU, small (16–64 KB), fastest
L2: Larger (256 KB–1 MB), slightly slower
L3: Shared, largest (2–32 MB), slowest among caches but faster than main memory

Example:
CPU frequently accesses L1 → immediate execution
L3 serves as backup if L1/L2 miss

Source:  Digital Logic & Computer Design By M. Morris Mano

৪৭.
Which of the following is a common cache replacement policy?
  1. Least Recently Used (LRU)
  2. First-In First-Out (FIFO)
  3. Random replacement
  4. All of the above
ব্যাখ্যা

LRU: Evict block that has not been used for the longest time
FIFO: Evict block that came in first
Random: Evict a random block
Policies help decide which block to replace on a cache miss

Example:
LRU → Frequently accessed data remains in cache
Random → Simplest hardware implementation

Source:  Digital Logic & Computer Design By M. Morris Mano

৪৮.
What is the primary purpose of virtual memory?
  1. Increase the size of physical memory
  2. Provide an abstraction of a large, continuous memory space to programs
  3. Reduce CPU clock cycles
  4. Replace cache memory
ব্যাখ্যা

Virtual memory allows programs to use a logical address space that may be larger than physical memory.
The operating system maps virtual addresses to physical memory and secondary storage (disk) as needed.

Example:
A 32-bit program can address 4 GB of memory, even if physical RAM is only 1 GB.

Source: Structured Computer Organization by Andrew S. Tanenbaum