Computer Architecture Solve 2018-19
Computer Architecture Solve 2018-19
Q3.
The instruction execution cycle is the complete process of fetching, decoding, and
executing an instruction. It includes several machine cycles such as:
Timing Diagram:
Machine Cycle: | Opcode Fetch | Execution |
T-states (clock): | T1 T2 T3 T4| T1 T2 T3 |
Signals:
------------------------------------------------
Address Bus | MAR | - |
Data Bus | Opcode | - |
RD
̅ | LOW | - |
ALE | HIGH | - |
IO/M
̅ | LOW | - |
Q4.
Hazards are problems that arise in pipelined processors which prevent the next instruction
from executing in the next clock cycle.
1. Data Hazard
Example:
asm
CopyEdit
MOV R1, R2
ADD R3, R1 ; R1 is not ready yet
●
● Solution:
○ Forwarding (Bypassing)
○ Compiler scheduling
Occurs due to branch instructions (e.g., JMP, BEQ) where the next instruction is uncertain.
● Solution:
○ Branch prediction
○ Delayed branching
○ Speculative execution
3. Structural Hazard
Occurs when two instructions require the same hardware resource at the same time.
● Solution:
○ Pipeline scheduling
Q5.
Speed Faster (closest to CPU core) Slower than L1 but faster than RAM
Q6.
A bootstrap loader is a small program stored in ROM (Read-Only Memory) that starts
automatically when the computer is powered on or reset. It is responsible for loading the
operating system (OS) into memory.
● It locates the operating system kernel, usually from a hard disk or SSD.
● It then loads the OS into main memory (RAM) and transfers control to it.
● After that, the operating system takes over, completing the booting process.
Q7.
○ Example: MOV A, B
4. How many types of data transfer schemes are there? Describe any one.
(3 Marks)
● The CPU continuously checks (polls) the I/O device for data.
Q8.
Parallel processing is the simultaneous use of multiple processors (or cores) to execute
several instructions concurrently. It improves computational speed and efficiency, especially
in large or complex programs.
Example: A task is divided into subtasks, each processed simultaneously on
different processors.
Arithmetic pipelining is a technique where multiple arithmetic operations are divided into
stages. Each stage processes a different part of an operation, allowing overlapping execution
and increasing throughput.
Vector processing refers to the execution of operations on entire arrays (vectors) of data in a
single instruction, rather than processing each data element individually.
In vector processing:
● Each element of the resulting matrix is computed as the dot product of a row from the
first matrix and a column from the second matrix.
a)
i) Two-Address Mode
In two-address mode, each instruction specifies a destination and one source operand. The
destination is also one of the operands.
MOV R1, B ; R1 = B
DIV R1, C ; R1 = B / C
ADD R1, A ; R1 = A + (B / C)
MOV R2, D ; R2 = D
MUL R2, E ; R2 = D * E
SUB R2, F ; R2 = D * E - F
MUL R1, R2 ; R1 = (A + B / C) * (D * E - F)
MOV X, R1 ; Store result in X
Here, one operand is in memory and the other is implicitly in the accumulator (AC).
LOAD B ; AC = B
DIV C ; AC = B / C
ADD A ; AC = A + (B / C)
STORE TEMP1 ; Store intermediate result
LOAD D ; AC = D
MUL E ; AC = D * E
SUB F ; AC = D * E - F
MUL TEMP1 ; AC = (A + B / C) * (D * E - F)
STORE X ; Store result in X
Zero-address machines use an implicit stack for operations. Instructions operate on the top of
the stack.
PUSH A
PUSH B
PUSH C
DIV ; B / C
ADD ; A + (B / C) → Temp1
PUSH D
PUSH E
MUL ; D * E
PUSH F
SUB ; D * E - F → Temp2
1. Saves the return address (address of the next instruction after the call) on the stack.
Read from M Mano Memory chapter. Diagram should be from the mentioned book only. I am
giving a brief comparative study below.
Here is a comparison between Direct Mapping and Set Associative Mapping techniques, as
asked in the question:
Definition Each block of main memory maps to Each block can be placed in a set of
only one cache line. cache lines.
Flexibility Very rigid (fixed location for each More flexible (block can be placed in
block). multiple lines in a set).
Hit Rate Lower (more conflicts due to fixed Higher (reduced conflict misses).
mapping).
Q 10.
a) What is CAM?
Speed Enables very fast lookup, since all comparisons are done in
parallel.
Definition:
Virtual memory is a memory management technique that creates an illusion for users of having
a very large main memory. It enables a computer to compensate for physical memory shortages
by temporarily transferring data from RAM to disk storage.
Key Points:
Diagram:
Register Stack:
● Located in RAM and used for storing return addresses, local variables, and function
parameters.
Comparison Table:
Definition:
Asynchronous data transfer occurs when data is sent between devices that do not share a
common clock. Instead, they use control signals to coordinate timing.
Key Techniques:
Example:
CPU communicating with I/O devices like keyboards or printers.
Advantages:
Definition:
Memory interleaving is a technique used to increase the speed of memory access by
organizing memory into banks that can be accessed in parallel.
Working:
● While one bank is being accessed, others can be precharged or accessed in parallel.
Types:
Advantages:
Diagram:
Address: 0 → Bank 0
Address: 1 → Bank 1
Address: 2 → Bank 2
...
Q11.
a) M Morris Mano
b)
d)
User View Not visible to user; purely for Visible to user; corresponds to
memory management. logical units.
Example:
● Segmentation: A code segment of 8 KB, a data segment of 5 KB, and a stack segment
of 4 KB.