Cao Solved Paper 2023
Cao Solved Paper 2023
Organisation
RTU SOLVED PAPER
2023
ER SAHIL KA GYAN
PART A 10 QUESTIONS= 20 MARKS
ER SAHIL KA GYAN
Q.1 Is there any difference between microprocessor and microcontroller? Explain
with example.
● Microprocessor: It handles more diverse communication technologies and is designed for high-speed processing tasks.
For example, microprocessors can handle USB 3.0 or Gigabit Ethernet without requiring a secondary processor.
● Microcontroller: It is a compact integrated circuit designed for specific tasks and includes a processor, memory, and
input/output peripherals. Microcontrollers often require additional processors for tasks like high-speed data connectivity.
Example: A microprocessor might be used in a desktop computer, while a microcontroller is commonly used in embedded
systems like washing machines or microwave ovens.
ER SAHIL KA GYAN
Q.2 Define (r-1)'s complement and r's complement using an example.
Ans.
● (r-1)'s Complement: The (r-1)'s complement of a number is obtained by subtracting each digit of the number from r-1.
Example: For binary, r = 2. The (r-1)'s complement (1's complement) of 001 is 110.
● r's Complement: The r's complement is obtained by adding 1 to the least significant bit (LSB) of the (r-1)'s complement.
Example: For binary, the 2's complement of 001 is 111 (by adding 1 to the LSB of the 1's complement).
ER SAHIL KA GYAN
Q.3 Distinguish among computer organization and computer architecture.
2. Deals with functional behavior of computer Deals with structural relationships and implementation.
systems.
4. Indicates the overall hardware design. Indicates performance and efficiency of hardware
components.
ER SAHIL KA GYAN
Q.4 Explain RISC.
ER SAHIL KA GYAN
Q.5 Explain the use of cache memory.
Cache memory is a small, high-speed memory located close to the CPU that stores frequently accessed data and instructions to speed
up processing. The primary role of cache memory is to reduce the time taken to access data from the main memory, thereby increasing
the overall performance of the computer. Cache memory is faster but more expensive and has less capacity than main memory.
Use:
● Improved Performance: By reducing the time the CPU takes to access data.
● Optimized Memory Access: It stores a copy of frequently used data and instructions, making retrieval quicker.
ER SAHIL KA GYAN
Q.6 What are the different conflicts that arise in pipeline? How do you remove the
conflicts? Describe.
1. Structural Hazards: Arise when resources like registers or functional units are insufficient to handle multiple instructions
simultaneously.
Solution: Use additional hardware units or functional units.
2. Data Hazards: Occur when one instruction depends on the data of a previous instruction that has not yet completed.
Solution: Forwarding (bypassing) or instruction reordering.
3. Control Hazards: Arise from branch instructions that affect the flow of execution.
Solution: Use branch prediction techniques and delay slots.
ER SAHIL KA GYAN
Q.7 Describe subroutine.
A subroutine (also known as a function or procedure) is a block of code that is designed to perform a specific task. It is a modular piece
of code that can be called and executed from various places within a program. Subroutines are used to promote code reuse, reduce
redundancy, and make programs easier to manage and debug.
1. Encapsulation of Code:
A subroutine encapsulates a set of operations into a single unit. This unit can then be executed whenever needed, without
repeating the same code multiple times. It helps in breaking down complex programs into smaller, manageable pieces.
2. Modularity:
Subroutines help in breaking large programs into smaller, self-contained modules, making it easier to update or debug a specific
section of the program without affecting the entire system.
3. Reusability:
Once written, subroutines can be reused multiple times within the program, or even in other programs, without needing to rewrite
the same code. This is especially helpful in reducing the overall program size and avoiding code duplication.
4. Control Flow:
A subroutine allows control to be transferred to it from the main program or from another subroutine. Once the subroutine
completes its task, control is returned to the point where the subroutine was called. ER SAHIL KA GYAN
Q.8 Draw and explain the memory hierarchy in a digital computer.
Memory hierarchy in a computer system is designed to balance cost, speed, and size. The hierarchy consists of different levels, each with
varying access speeds, costs, and sizes.
ER SAHIL KA GYAN
Q.9 Perform the 2's complement subtraction of smaller number (101011) from
large number (111001).
ER SAHIL KA GYAN
Q.10 What are the basic differences among a branch instruction, a call subroutine
instruction, and a program interrupt?
Branch Instruction: Alters the flow of control unconditionally or conditionally, based on the
program’s logic.
Call Subroutine Instruction: Transfers control to a specific subroutine, storing the return address
so the program can continue after the subroutine finishes.
Program Interrupt: Temporarily halts the program to handle external events like I/O operations or
exceptions and returns control once the event is processed.
ER SAHIL KA GYAN
PART B 5/7 QUESTIONS= 20 MARKS
ER SAHIL KA GYAN
Q.11: Explain the Fetch Cycle with Diagram
✅ Definition:
The Fetch Cycle is the first phase of the instruction cycle where the CPU retrieves the next instruction to be executed from main
memory. This instruction is fetched using the address stored in the Program Counter (PC)
🧠 Purpose:
To load the instruction into the Instruction Register (IR) for decoding and execution.
At the start, the Program Counter (PC) holds the memory address of the next instruction.
ER SAHIL KA GYAN
🔹 Step-by-Step Process:
🔸 Step 1 (t1):
● The address in the Program Counter (PC) is copied to the Memory Address Register (MAR).
● This step prepares the memory to locate the instruction.
Micro-operation:
t1: MAR ← (PC)
🔸 Step 2 (t2):
Micro-operations:
t2: MBR ← Memory[MAR]
t2: PC ← PC + 1
🔸 Step 3 (t3):
Micro-operation:
t3: IR ← MBR
ER SAHIL KA GYAN
Time Unit Operation
Booth’s algorithm is used for signed binary multiplication using 2’s complement representation. It reduces the number of arithmetic
operations by encoding the multiplier.
🔹 Given:
ER SAHIL KA GYAN
Let:
● A = M (Multiplicand) = 11011011
● Q = Multiplier = 00010101
● Q(-1) = 0
● Initial Product = [A] [Q] [Q(-1)] = 0 00000000 00010101 0
● Accumulator (A) = 8 bits
● Multiplier (Q) = 8 bits
● Q(-1) = 1 bit
● Total Bits = 17 bits
● 10 → Subtract M (A = A - M)
● 01 → Add M (A = A + M)
● 00 or 11 → No arithmetic
● Then Arithmetic Right Shift (ARS) of [A, Q, Q(-1)]
ER SAHIL KA GYAN
Cycle A (Accumulator) Q (Multiplier) Q₋₁ Operation Performed
ER SAHIL KA GYAN
Cycle A (Accumulator) Q (Multiplier) Q₋₁ Operation Performed
🧾 Final Result
● Final A = 11111100
● Final Q = 11111111
ER SAHIL KA GYAN
Q.13 Describe the Flynn Model and Explain the
Components
Flynn’s Classification is a model to categorize computer architectures based on the number of instruction and data streams they
handle. It classifies into four major types:
MIM Multiple Instruction Multiple Data Many Many Multi-core CPUs, Clusters
D
ER SAHIL KA GYAN
🔍 Detailed Explanation:
✅ 1. SISD:
+----------------+ +----------------+
● Traditional sequential systems SISD → | Instruction | →→→→→ | Data |
● One instruction on one data at a time +----------------+ +----------------+
ER SAHIL KA GYAN
Q.14: Write Short Notes On –
🧠 The Memory Address Register (MAR) is a CPU register that stores the address in memory from which data is to be fetched or to
which data is to be stored. It plays a critical role in memory operations during program execution.
● ✅ Data Fetching:
MAR holds the address of the memory location from which data or instruction is to be fetched by the CPU.
● ✅ Instruction Execution:
During execution, MAR helps locate the required instruction or data from memory.
● ✅ Data Storing:
When writing data, MAR stores the destination memory address.
ER SAHIL KA GYAN
🔐 Role in Cybersecurity:
● 🔒 Memory Isolation: Prevents unauthorized access by ensuring that processes access only their allocated memory space.
● 🔄 Data Wiping: Used in secure data overwrite operations for permanent deletion.
● 🔐 Data Encryption: Helps retrieve the address of keys, ciphertext, etc., securely during encryption/decryption.
📌 Summary: MAR ensures correct addressing during memory operations and contributes to secure and efficient CPU-memory
communication.
🧠 The Program Counter (PC) is a special-purpose register that holds the address of the next instruction to be fetched from memory for
execution. It is also known as the Instruction Pointer (IP) or Instruction Address Register (IAR).
ER SAHIL KA GYAN
🧭 Working Example:
Address Instruction
Program Memory Layout:
Program Memory
0x00 Instruction 0
+----------------------+
| Addr: 0x04 | ← PC points here
0x01 Instruction 1 | Inst: Example Inst | → Sent to Instruction Register
+----------------------+
0x02 Instruction 2
0x03 Instruction 3
As each instruction is fetched and executed, the PC updates to the address of the next instruction, ensuring smooth sequential
flow.
📌 Summary:
The Program Counter controls the execution flow by pointing to the next instruction and is essential for
instruction sequencing and control in the CPU.
ER SAHIL KA GYAN
Q.15: Explain Paging and Segmentation with
Examples
✅ A. Paging
Definition:
Paging is a memory management technique where logical memory is divided into
fixed-size blocks called pages and physical memory into fixed-size blocks called
frames. The size of pages and frames is kept equal to avoid external fragmentation.
Frame Contains
🔹 Example of Paging:
F0 P1
● Process Size: 4 Bytes
● Page Size: 1 Byte F1 P0
● Pages: P0, P1, P2, P3
● Main Memory Frames Allocation: F2 P2
F3 P3
ER SAHIL KA GYAN
🔹 Logical to Physical Address Translation:
Page No Frame No
● Logical Address = Page Number + Page Offset
0 1
● Physical Address = Frame Number + Page Offset
1 0
🛠 This translation is done by the MMU (Memory Management Unit) using a Page
Table.
2 2
✅ Advantages of Paging: 3 3
● No external fragmentation
● Enables non-contiguous memory allocation
● Efficient swapping
❌ Disadvantages of Paging:
ER SAHIL KA GYAN
✅ B. Segmentation
Definition:
Segmentation is a memory management scheme where a program is divided into logical segments based on its functional components such
as code, data, stack, etc.
Unlike paging, segments are of variable size and represent logical divisions in the program. EXAMPLES -
1 Data 3 KB 3000
2 Stack 1 KB 6000
🧠 Segment Table:
Segment No Base Limit
This translation is Logical View Physical View
performed by MMU using a +---------+ +------------+
Segment Table and STBR 0 1000 2048
(Segment Table Base | Code | → Base 1000 → | Code |
Register). | Data | → Base 3000 → | Data |
1 3000 3072 | Stack | → Base 6000 → | Stack |
+---------+ +------------+
2 6000 1024
ER SAHIL KA GYAN
Feature Paging Segmentation
✅ Conclusion:
Both paging and segmentation are essential memory management schemes. Paging improves
memory utilization, while segmentation enhances logical organization. Many modern systems
use a combined approach (segmented paging) for efficiency.
ER SAHIL KA GYAN
Q.16: Procedure for Addition and Subtraction of
Fixed-Point Numbers
✅ Fixed-Point Representation Overview:
Fixed-point numbers have a fixed number of digits before and after the radix (decimal) point. In computer systems, they are
commonly stored in binary form, using sign-magnitude, 1's complement, or 2's complement representation (commonly 2's
complement for arithmetic).
ER SAHIL KA GYAN
B. Fixed-Point Subtraction Procedure:
Step-by-step Process:
Segmentation is a memory management technique in which logical memory is divided into variable-sized segments such as code,
data, and stack. Each segment is referenced by a segment number and an offset (also called displacement).
Virtual Address:
ER SAHIL KA GYAN
Translation Process:
To translate a virtual address into a real (physical) address, the system uses a Segment Table. Each process has its own segment
table maintained by the operating system.
Steps of Translation:
ER SAHIL KA GYAN
Diagram: Virtual to Physical Address Translation Example:
Let’s say:
Virtual Address
---------------------
● Virtual Address = (Segment = 2, Offset = 120)
| Segment | Offset | ● Segment Table Entry for Segment 2:
| No. | d |
--------------------- ○ Base = 4000
↓ ○ Limit = 256
Segment Table
-----------------------
| Segment | Base | Limit | ✅ Since Offset (120) < Limit (256), it is valid.
-----------------------
| s | 1000 | 500 | 🔁 Physical Address = 4000 + 120 = 4120
-----------------------
↓ Advantages of Segmentation:
Check: Is d < 500? ✔
↓ ● Supports modular programming (code,
Physical Address = 1000 + d
data, stack)
ER SAHIL KA GYAN
PART C 3/5 QUESTIONS= 30 MARKS
ER SAHIL KA GYAN
Q.18 Describe role of addressing modes used in computer architecture. Illustrate
direct and indirect addressing mode with suitable example. Demonstrate arithmetic
micro operation and draw diagram of 4-bit full adder.
Addressing modes define how the effective address of the operand is calculated. They are crucial in instruction execution because
they determine where and how to access operands in memory or registers.
ER SAHIL KA GYAN
Types of Addressing Modes (with examples):
Example:
● Definition: The instruction specifies a memory location that contains the effective address.
Example:
ER SAHIL KA GYAN
Arithmetic Micro-operations:
These operations deal with basic arithmetic tasks executed at the register level within the CPU.
● Sum (Sᵢ): Sᵢ = Aᵢ ⊕ Bᵢ ⊕ Cᵢ
ER SAHIL KA GYAN
Q.19 (a) Explain arithmetic pipeline with a suitable
example. Draw diagram also.
Arithmetic Pipeline:
An arithmetic pipeline is used to perform arithmetic operations like addition, multiplication, and division in a sequential segmented
manner. Instead of completing one arithmetic operation before starting the next, pipelining allows multiple operations to overlap in
execution, thus improving the overall throughput.
Arithmetic pipelines are divided into segments (stages). Each stage performs a part of the total computation. Once a stage finishes its
part, it passes the result to the next stage and begins processing the next input.
Consider a floating-point addition operation that is divided into the following stages:
1. Exponent Comparison
2. Mantissa Alignment
3. Addition
4. Normalization
5. Rounding
ER SAHIL KA GYAN
Pipeline Diagram:
sql
CopyEdit
Time → Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Cycle 6 Cycle 7 Cycle 8
------------------------------------------------------------------------------------------
Task 1 → Stage 1 → Stage 2 → Stage 3 → Stage 4 → Stage 5 → - → - → -
Task 2 → - → Stage 1 → Stage 2 → Stage 3 → Stage 4 → Stage 5 → - → -
Task 3 → - → - → Stage 1 → Stage 2 → Stage 3 → Stage 4 → Stage 5 → -
Task 4 → - → - → - → Stage 1 → Stage 2 → Stage 3 → Stage 4 → Stage 5
Not all stages in the pipeline take the same time to execute. Variations cause stalling or bubbling, reducing the efficiency.
2. Data Hazards:
Occur when instructions that are close in the pipeline access the same data. For example, if instruction I2 needs the result of instruction I1, it must wait
until I1 completes.
3. Branching:
Branch or jump instructions cause uncertainty in the flow of instructions. The processor might fetch the wrong instruction and waste cycles.
ER SAHIL KA GYAN
4. Interrupts:
External events (like I/O or exceptions) can interrupt the pipeline flow and force it to flush partially executed instructions.
5. Data Dependency:
When an instruction depends on the result of a previous instruction that is still in the pipeline, it creates read-after-write (RAW) hazards,
causing pipeline stalls.
Numerical Problem:
Given:
ER SAHIL KA GYAN
ER SAHIL KA GYAN
Q.20 (a) Explain cache coherency and why it's
necessary? Explain different approaches for cache
coherency.
Cache Coherency:
In modern computer systems, cache memory is used to temporarily store frequently accessed data to speed up processing. However, in
multiprocessor systems, where multiple CPUs have their own local caches, the same memory location might be cached in more than
one processor's cache.
Cache Coherency ensures that all the processors in the system have a consistent view of memory. If one processor updates a memory
location, that update must be visible to other processors. Without cache coherence, a processor might work on outdated data, leading to
data inconsistency and unpredictable program behavior.
ER SAHIL KA GYAN
Approaches for Cache Coherency:
1. Directory-Based Protocols:
● A central directory keeps track of which caches have copies of each memory block.
● When a processor wants to read/write data, it queries the directory to check the status.
● Suitable for large-scale multiprocessors.
2. Snooping-Based Protocols:
● When a processor writes to a cache block, it sends an invalidate message to all other caches.
● Other processors then invalidate their copy of that block.
● Reduces the number of writes across the system.
● Instead of invalidating, the writing processor broadcasts the new value to all caches that have a copy.
● All caches update their copy with the new value.
● Ensures faster propagation of updated data.
● A single 1K × 4 RAM chip means it can store 1024 words, with each word being 4 bits wide.
● To build a memory bank of size 1K × 4, we already meet the required specification with just one chip.
✅ Required chips = 1
These 4 chips are connected in such a way that they handle different address ranges (using additional address lines like A10 and A11 for
chip selection).
ER SAHIL KA GYAN
Memory Bank Size RAM Chip Size Total Chips Required
1K × 4 1K × 4 1
4K × 4 1K × 4 4
ER SAHIL KA GYAN
Q.21 Differentiate between Hardwired Control Unit
and Micro-programmed Control Unit with their
Diagram
Introduction:
In computer architecture, the Control Unit (CU) is responsible for directing the operation of the processor by generating control signals.
There are two primary types of control units: Hardwired Control Unit (HCU) and Micro-programmed Control Unit (MCU). These units
differ in their design, operation, and complexity.
The Hardwired Control Unit uses fixed logic circuits to generate control signals. The operation of the control unit is determined by the
hardware, and the instructions are decoded into control signals directly through combinational logic circuits like PLAs (Programmable
Logic Arrays) or state machines.
ER SAHIL KA GYAN
Diagram of Hardwired Control Unit: Explanation of Hardwired Control Unit:
ER SAHIL KA GYAN
2. Micro-programmed Control Unit (MCU):
The Micro-programmed Control Unit uses a control memory to store microprograms, which are sequences of microinstructions. Each
microinstruction corresponds to a specific control signal. The microprogrammed control unit decodes the instruction and generates control signals
through these stored microinstructions.
ER SAHIL KA GYAN
Feature Hardwired Control Unit Micro-programmed Control Unit
Design Complexity Simple, uses combinational logic Complex, uses microinstructions and memory
Best Used For Fixed instruction sets and simpler Complex instruction sets and general-purpose
designs processors
Conclusion:
● Hardwired Control Units are faster and simpler, suitable for fixed and simpler systems. However, they are less flexible and
difficult to modify.
● Micro-programmed Control Units are more flexible, capable of handling complex instruction sets, and easier to modify,
but they are generally slower due to the additional layer of microprogramming.
ER SAHIL KA GYAN
Q.22 (a) Draw and Explain the Diagram of a DMA
Controller. Why are the Read/Write Lines of DMA
Bidirectional?
📌 Block Diagram of DMA Controller
🔷 DMA (Direct Memory Access)
+-------------------------------+
Controller | DMA Controller |
+-------------------------------+
A DMA controller is a dedicated | Address Register | --> Memory Address
hardware component used to transfer |-------------------------------|
data between memory and I/O devices | Count Register | --> Word Count
without involving the CPU. It improves |-------------------------------|
overall system performance by freeing | Control Register | --> Mode, Direction, Status
|-------------------------------|
the CPU from managing data transfer
| Data Buffer | <--> Data Bus
tasks.
|-------------------------------|
| DMA Request Lines (DRQ) | <-- From I/O Devices
|-------------------------------|
| DMA Acknowledge (DACK) | --> To I/O Devices
|-------------------------------|
| Read/Write Control Logic | <--> Read/Write Signals
ER SAHIL KA GYAN
🧠 Function of Key Components:
Component Function
Control Register Sets the direction (read/write), mode (block, burst), and enables interrupts.
DMA Acknowledge (DACK) Sent by DMA controller to confirm the transfer to the I/O device.
Control Logic Manages timing and control signals, including bidirectional R/W lines.
ER SAHIL KA GYAN
🔄 Why Are DMA Read/Write Lines Bidirectional?
The read and write lines of a DMA controller are bidirectional because the controller must both read from and write to memory
and I/O devices, depending on the transfer direction.
✅ Reasons:
1. Flexibility:
2. Efficiency:
3. Resource Optimization:
4. Synchronization:
An Input/Output Processor (IOP) is a special-purpose processor designed to handle input and output operations. It works
independently from the CPU, reducing CPU load and managing I/O devices efficiently.
🧠 Functions of IOP:
ER SAHIL KA GYAN
📊 Block Diagram of IOP System
+-----------------------+
| CPU | Component Function
+-----------------------+
| CPU Issues I/O commands to the IOP.
| Control/Command
v
IOP Receives commands, controls I/O devices,
+-----------------------+
| IOP | and manages data transfers.
+-----------------------+
| I/O Command Decoder | I/O Devices like disk, printer, keyboard, etc.
| Channel Control | Devices
| Buffer |
+-----------------------+ Main Stores data being read from or written to I/O.
| Memory
-----------------------
| DMA Bus | DMA Bus
-----------------------
Used by IOP to transfer data directly to
| memory.
+-----------------------+
| Main Memory | ✅ Benefits of IOP:
+-----------------------+
| ● Reduces CPU load.
+-----------+------------+ ● Allows parallel execution of I/O and processing
| |
tasks.
+------------------+ +------------------+
| I/O Device 1 | | I/O Device 2 | ● Efficient and scalable for complex systems.
+------------------+ +------------------+ ● Improves overall system throughput. ER SAHIL KA GYAN
✅ Conclusion
● (a) A DMA controller facilitates high-speed data transfer by bypassing the CPU, and its bidirectional read/write lines
ensure efficient and flexible communication.
● (b) An IOP enhances system performance by independently managing I/O operations, allowing the CPU to focus on
computation.
ER SAHIL KA GYAN
THANK YOU
ER SAHIL KA GYAN
ER SAHIL KA GYAN