Asssignment - 2024 - 2025 - Solution
Asssignment - 2024 - 2025 - Solution
Assignment
Date:24/10 /2024 Max. Marks: 20
Q. 1 ) Design a relatively simple computer which incorporates 8KRAM, 8K ROM, IO interfacing modules
along with processor.
Ans : Designing a simple computer system incorporating 8K RAM, 8K ROM, I/O interfacing
modules, and a processor involves outlining the architecture, key components, and the
interaction between these components. Here's a high-level design:
The CPU is the heart of the system. It fetches instructions from memory (RAM/ROM), decodes
them, and executes them. In this system, we'll assume a basic 16-bit processor for simplicity.
The system uses two types of memory: RAM (Random Access Memory) for read/write
operations and ROM (Read-Only Memory) for permanent data storage.
RAM: 8K RAM (8192 bytes) located in a specific address range, say from 0x2000 to 0x3FFF.
ROM: 8K ROM (8192 bytes) for storing bootloader, firmware, or initial instructions, located from
0x0000 to 0x1FFF.
1
3. I/O Interfacing Modules:
The system needs Input/Output modules for communication with external peripherals such as
keyboards, displays, or other devices.
I/O Mapped Ports: Allocate specific address ranges for I/O devices, say 0x4000 to 0x40FF.
Memory Mapped I/O: Use part of the memory address space to control I/O modules.
Interrupt Mechanism: Provide interrupt handling for I/O devices to allow efficient data
exchange.
4. System Bus:
The bus connects the CPU, memory, and I/O devices to transfer data, addresses, and control
signals.
Address Bus: 16-bit wide, carrying memory addresses from CPU to RAM, ROM, and I/O.
Data Bus: 16-bit wide, carrying data between CPU, memory, and I/O.
Control Bus: Carries control signals such as Read/Write, Interrupt, Reset, etc.
5. Clock Generator:
Generates a clock signal to synchronize all operations of the system, including CPU cycles and
data transfers.
6. Power Supply:
Flow of Operations:
1. Power On: Upon startup, the CPU fetches the first instruction from ROM at address 0x0000
(usually a bootloader or firmware).
2. Instruction Fetch-Decode-Execute: The CPU continuously fetches instructions from memory,
decodes them, and executes them.
3. RAM Interaction: For any data read/write operations, the CPU accesses RAM.
4. I/O Interaction: The CPU accesses I/O devices by either directly reading/writing to specific
memory-mapped I/O addresses or using interrupts.
2
Memory and I/O Address Mapping:
+----------------------+
| Processor |
| +------------------+ |
| | Control Unit | |
| | Arithmetic Logic | |
| | Unit (ALU) | |
| +------------------+ |
+----------------------+
| | |
| | |
+----+----+----+------+
| Bus | |
+----------+-----------+
| |
| Address: 0x4000-0x40FF
+------------------------------------------------+
This design is a basic representation of a simple computer that integrates 8K RAM, 8K ROM, and basic
I/O interfacing with a processor.
Q. 2) Elaborate how DMA bypasses CPU and speeds up the memory operation?
Ans : Direct Memory Access (DMA) is a technique used to transfer data directly between
memory and peripherals (or between two memory locations) without the direct intervention of
the CPU. It significantly improves data transfer speeds and efficiency by allowing peripheral
devices to directly read from or write to memory, bypassing the CPU for most of the data
movement. Here's how it works and how it speeds up memory operations:
In a typical system without DMA, the CPU plays a central role in moving data between I/O
devices and memory. For example, when data needs to be transferred between a disk and RAM:
1. The I/O device (e.g., a hard disk) sends an interrupt to the CPU indicating that data is ready to be
transferred.
2. The CPU responds to the interrupt and executes a series of instructions to read data from the I/O
device.
3. The CPU then temporarily stores the data in one of its registers.
4. Afterward, the CPU writes the data from the register to the memory.
5. The process repeats for each block of data being transferred.
This CPU-driven transfer process is relatively slow because the CPU is involved in every step
of the transfer. For large amounts of data, the CPU must repeatedly issue read and write
commands, which consumes significant processing time.
4
2. How DMA Works:
With DMA, the CPU is almost entirely bypassed during the data transfer process, except for
initiating and concluding the transfer. Here’s how it works:
There are different modes of DMA operation, which impact how the CPU is involved during the
data transfer:
5
Transparent Mode:
o DMA transfers data only when the CPU is not using the bus, making it the least intrusive
but also slower, as it waits for idle CPU time.
4. Advantages of DMA: