cao lab manual
cao lab manual
Lalbandi, Sarlahi,
Bachelor OF EDUCATION
In
(BICTE) …… Semester
Subject: ……
Submitted By:
Name: ..............
Lalbandi, Sarlahi,
Nepal.
Baishak,2082
APPROVAL SHEET
Mr…………………………….. ……………………………
(HOD)
Mr…………………………………………. ............................................
(Internal Examiner)
(External Examiner)
Algorithm:
HLT ; Halt
OVERFLOW:
MVI A, FFH ; Indicate overflow
HLT ; Halt
; Memory:
```
Output:
Conclusion:
The program successfully demonstrates 2’s complement representation and detects overflow when
adding two 8-bit integers (e.g., 5 + 250 exceeds 255). Floating-point and character representation can be
visualized manually from binary outputs.
Design a basic computer circuit using a simulator to understand its components (e.g., ALU, registers,
control unit).
Algorithm:
1. Define components: PC, IR, ALU, Accumulator, Memory.
Components:
- PC (Program Counter): 4-bit register.
Connections:
- PC → Memory Address Input.
Output:
- Simulated ADD operation: Input (5 + 3) → ALU → Accumulator = 8.
Conclusion:
The basic computer design illustrates how registers, ALU, and control signals interact to execute
instructions. Logisim effectively simulates this process.
Lab Report 3: Illustrate Fetch, Decode, and Execute Instructions
Objective:
Write a program to simulate the fetch, decode, and execute phases of an instruction cycle.
Algorithm:
1. Fetch instruction from memory using PC.
Program Code:
.MODEL TINY
.CODE
ORG 100H
START:
INT 21H
END START
; Memory:
; 2050H: 04H
; 2051H: 06H
Output:
Input: 2050H = 04H, 2051H = 06H
Conclusion:
The program simulates the instruction cycle, showing how fetch (SI), decode (implicit in ADD), and
execute (ALU operation) work in 8086.
Algorithm:
1. Use immediate mode to load a constant.
Program Code:
.MODEL TINY
.CODE
ORG 100H
START:
INT 21H
END START
; Memory:
; 2050H: 03H
Output:
- Input: AX = 05H, 2050H = 03H
Conclusion:
The program demonstrates four addressing modes in 8086, showing their practical use in data
manipulation.
Content:
- Array Processors: Multiple ALUs process data in parallel (e.g., SIMD). Example: GPUs like NVIDIA CUDA.
- Applications:
- Array: Image processing, machine learning.
- Comparison: Array processors excel in massive parallelism; vector processors handle large data sets
efficiently.
Output:
Conclusion:
Array and vector processors enhance performance in data-intensive tasks, with distinct use cases in
modern computing.
Objective:
Write a program to simulate instruction and arithmetic pipelines.
Algorithm:
1. Define stages: Fetch, Decode, Execute.
Program Code:
#include <stdio.h>
int main() {
return 0;
Output:
Cycle 1: F:5 D:0 E:0
Conclusion:
The program simulates a 3-stage pipeline, showing how instructions overlap to improve throughput.
Objective:
Implement algorithms (e.g., Booth’s multiplication) in a high-level language.
Algorithm:
1. Input multiplicand and multiplier.
int n = 4, A = 0, Q = q, M = m, Q_1 = 0;
A = A >> 1;
int main() {
return 0;
Output:
- Result: 6
Conclusion:
Content:
- Versions: USB 1.0 (1.5 Mbps), USB 2.0 (480 Mbps), USB 3.0 (5 Gbps).
- Applications: Data transfer, power delivery (e.g., USB-C).
Output:
Conclusion:
Objective:
Write a program to simulate associative memory (key-value pair mapping).
Algorithm:
1. Define an array for keys and values.
3. Display result.
Program Code:
#include <stdio.h>
int main() {
if (keys[i] == key) {
return 0;
return 0;
}
Output:
Conclusion:
Objective:
Simulate the cache coherence problem and implement a solution (e.g., MESI protocol).
Algorithm:
1. Simulate two caches with shared memory.
Program Code:
#include <stdio.h>
int main() {
Output:
Conclusion:
The program simulates cache incoherence and resolves it by updating all caches and memory, mimicking
a simple coherence protocol.
- Diagrams: Draw block diagrams (e.g., for circuit design, USB topology) manually or using tools like
Paint.
- Customization: Adjust memory addresses or input values as per your lab setup.
- Tools: Specify the exact simulator version (e.g., “8085 Simulator v2.0”) in your report.