🎓 University Curriculum & Practical Lab Manuals

Computer Science Practical Labs Catalog

Explore 14 standardized computer science practical laboratory categories. Every experiment includes formal Aims, Learning Objectives, Algorithms, Verified Source Code, Sample Inputs/Outputs, Test Cases, and Viva Voce Q&As.

Categories: 14 Subjects (A to N)
Format: 18-Point Standard
Execution: Client-Side & 100% Free
Direct: 1-Click Open in IDE
Syllabus Completion 0 / 84
Avg Quiz Score -
Bookmarked Labs 0
⚡
Microprocessor & Microcontroller (MPMC) Simulator 8085 â€ĸ 8086 â€ĸ 8051
Simulate assembly code, input data into memory, inspect live registers, flags, and step-by-step outputs.
Launch MPMC Simulator →
How to Use Curriculum Labs: Select your department and semester below to filter matching syllabus experiments. Click any lab card to open interactive theory, algorithm flowchart, and runnable in-browser code.
Department:
6 Academic Tracks â€ĸ 84 Experiments
Semester:

đŸ”Ŧ University Practical Laboratory Curriculum & Viva Voce Manual

Standardized undergraduate computer science and engineering laboratory syllabus reference. Includes rigorous algorithms, complete runnable source implementations, expected outputs, time complexity bounds, viva questions, and the official 18-point university lab record documentation format.

📋 Official 18-Point University Lab Record Standardization Format

Academic Compliance â€ĸ AICTE & ABET Guidelines

To ensure strict adherence to university academic grading criteria and accreditation bodies, every engineering practical laboratory experiment on VAB-CODE follows the standardized 18-point documentation structure:

Points 1 to 9: Formulation & Design

1. Experiment Title & Date: Clear curricular identifier.
2. Aim / Problem Statement: Concise statement of technical objective.
3. Apparatus & Software Environment: Compiler versions (GCC, Java 17, Python 3.11, MySQL).
4. Learning Objectives: Specific skills and competencies acquired.
5. Theoretical Background: Underlying mathematical or algorithmic foundations.
6. Mathematical Equations: Formal equations, asymptotic bounds, and formulas.
7. Architectural Flowchart: Logic diagram depicting program execution flow.
8. Step-by-Step Algorithm: Language-agnostic pseudocode steps.
9. Input Data Specifications: Domain constraints and variable ranges.

Points 10 to 18: Implementation & Evaluation

10. Complete Source Code: Syntactically verified and fully indented code.
11. Comments & Error Handling: Boundary safety and explanatory annotations.
12. Compilation & Build Commands: Exact terminal CLI invocation.
13. Sample Test Case (Nominal): Standard expected input and output.
14. Boundary Test Case (Edge): Zero, null, negative, or max-scale inputs.
15. Expected Terminal Output: Exact stdout transcript.
16. Result & Conclusion: Verification that the stated aim was fulfilled.
17. Viva Voce Questions & Model Answers: Oral examination preparation.
18. Academic References: Standard textbooks (Cormen, Silberschatz, Tanenbaum).

đŸ’ģ Academic Track 1: Programming Fundamentals & Data Structures

Pointers â€ĸ Dynamic Memory (malloc/free) â€ĸ Linear & Non-Linear Lists

Data structures establish memory layout models and access patterns for algorithmic processing. Linear data structures (arrays, linked lists, stacks, queues) enforce sequential predecessor-successor relationships, whereas non-linear structures (trees, graphs) represent hierarchical and arbitrary network topologies.

Experiment 1: Implementation of Singly Linked List Operations

Aim: To write a modular C program to implement dynamic singly linked list operations: insertion at beginning/end, deletion by value, reversal of nodes, and display.
Algorithm:
1. Define struct Node containing integer data and pointer struct Node* next.
2. Insert at Beginning: Allocate memory via malloc(sizeof(struct Node)). Set newNode->next = head; update head = newNode.
3. Reverse: Initialize three pointers: prev = NULL, curr = head, next = NULL. In a loop while curr != NULL: save next = curr->next; reverse pointer curr->next = prev; advance prev = curr; advance curr = next. Set head = prev.

#include <stdio.h> #include <stdlib.h> struct Node { int data; struct Node* next; }; struct Node* insertBeginning(struct Node* head, int val) { struct Node* newNode = (struct Node*)malloc(sizeof(struct Node)); if (!newNode) { printf("Memory allocation failed!\n"); exit(1); } newNode->data = val; newNode->next = head; return newNode; } struct Node* reverseList(struct Node* head) { struct Node *prev = NULL, *curr = head, *next = NULL; while (curr != NULL) { next = curr->next; curr->next = prev; prev = curr; curr = next; } return prev; } void printList(struct Node* head) { struct Node* temp = head; while (temp) { printf("%d -> ", temp->data); temp = temp->next; } printf("NULL\n"); }
Viva Voce Questions:
â€ĸ Q: Why is pointer reversal performed in $O(1)$ auxiliary space?
â€ĸ Answer: Three temporary pointer variables (prev, curr, next) are reused across all loop iterations without allocating new heap memory, bounding space to $O(1)$.

☕ Academic Track 2: Object-Oriented Programming & Multi-Threading (Java)

Encapsulation â€ĸ Polymorphism â€ĸ Synchronized Monitors â€ĸ Thread Safety

Object-oriented design organizes code around self-contained entities (objects) encapsulating state (attributes) and behavior (methods). Java implements concurrency using monitors and intrinsic thread locks.

Experiment 2: Inter-Thread Communication (Producer-Consumer Problem)

Aim: To demonstrate thread synchronization and inter-thread signaling in Java using a bounded buffer with synchronized methods, wait(), and notify().
Theory: When multiple concurrent threads access shared mutable state, race conditions emerge. Using intrinsic object monitors, the Producer thread waits when the buffer is full, and the Consumer thread waits when the buffer is empty.

import java.util.LinkedList; import java.util.Queue; class BoundedBuffer { private final Queue<Integer> queue = new LinkedList<>(); private final int CAPACITY = 5; public synchronized void produce(int item) throws InterruptedException { while (queue.size() == CAPACITY) { wait(); // Buffer full: release monitor and sleep } queue.add(item); System.out.println("Produced: " + item + " | Buffer size: " + queue.size()); notifyAll(); // Wake up waiting consumer threads } public synchronized int consume() throws InterruptedException { while (queue.isEmpty()) { wait(); // Buffer empty: release monitor and sleep } int item = queue.poll(); System.out.println("Consumed: " + item + " | Buffer size: " + queue.size()); notifyAll(); // Wake up waiting producer threads return item; } }
Viva Voce Questions:
â€ĸ Q: Why must wait() always be called inside a while loop instead of an if statement?
â€ĸ Answer: To guard against spurious wakeups, where a thread resumes execution without an explicit signal. The while loop re-checks the condition predicate before proceeding.

đŸ—„ī¸ Academic Track 3: Database Management Systems & SQL Lab

Relational Algebra â€ĸ Multi-Table Joins â€ĸ Triggers & Stored Procedures

Relational databases store structured schemas governed by foreign keys and integrity constraints. SQL provides declarative data definition (DDL) and manipulation (DML).

Experiment 3: SQL Relational Queries, Grouping & Triggers

Aim: Create a University database schema (Department, Student, Course, Enrollment) and execute nested queries with GROUP BY, HAVING, and an automated audit trigger.

-- Schema Definition CREATE TABLE Student ( student_id INT PRIMARY KEY, name VARCHAR(50) NOT NULL, dept_id INT, gpa DECIMAL(3,2) ); CREATE TABLE CourseEnrollment ( enrollment_id INT PRIMARY KEY, student_id INT, course_name VARCHAR(50), grade VARCHAR(2), FOREIGN KEY (student_id) REFERENCES Student(student_id) ); -- Advanced Aggregation Query: Students with above-average GPA per Department SELECT s.student_id, s.name, s.gpa, s.dept_id FROM Student s WHERE s.gpa > ( SELECT AVG(s2.gpa) FROM Student s2 WHERE s2.dept_id = s.dept_id );
Viva Voce Questions:
â€ĸ Q: What is the semantic difference between WHERE and HAVING in SQL?
â€ĸ Answer: The WHERE clause filters individual records before aggregation occurs; the HAVING clause filters aggregated groups produced by GROUP BY.

âš™ī¸ Academic Track 4: Operating Systems & POSIX Systems Programming

Process Management (fork/exec) â€ĸ CPU Scheduling â€ĸ Pipes & IPC

System programming interfaces directly with the operating system kernel via system calls to manage processes, file descriptors, and virtual memory.

Experiment 4: Round Robin CPU Scheduling Simulation in C

Aim: Implement Round Robin scheduling with a given time quantum $Q$ to compute turnaround times, waiting times, and average response metrics.

#include <stdio.h> void roundRobin(int n, int burst[], int quantum) { int rem_burst[n]; for (int i = 0; i < n; i++) rem_burst[i] = burst[i]; int t = 0; // Current time int wait_time[n]; for (int i = 0; i < n; i++) wait_time[i] = 0; while (1) { int done = 1; for (int i = 0; i < n; i++) { if (rem_burst[i] > 0) { done = 0; if (rem_burst[i] > quantum) { t += quantum; rem_burst[i] -= quantum; } else { t += rem_burst[i]; wait_time[i] = t - burst[i]; rem_burst[i] = 0; } } } if (done == 1) break; } printf("PID\tBurst\tWaiting\tTurnaround\n"); for (int i = 0; i < n; i++) { printf("P%d\t%d\t%d\t%d\n", i+1, burst[i], wait_time[i], wait_time[i] + burst[i]); } }
Viva Voce Questions:
â€ĸ Q: How does time quantum size affect Round Robin performance?
â€ĸ Answer: An excessively large time quantum reduces Round Robin to FCFS; an excessively small quantum causes high context-switching overhead, degrading CPU throughput.

🌐 Academic Track 5: Computer Networks & Socket Programming

TCP/IP Sockets â€ĸ Client-Server Model â€ĸ Packet Sniffing & Routing

Socket programming enables inter-process network communication across distributed machines using IP addressing and port numbers.

Experiment 5: Client-Server TCP Echo Socket in Python

Aim: Implement an iterative TCP echo server and client using the standard Python socket library.

# Python 3: TCP Echo Server Implementation import socket def run_server(): server_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server_sock.bind(('127.0.0.1', 8080)) server_sock.listen(5) print("TCP Server listening on 127.0.0.1:8080...") while True: client_sock, client_addr = server_sock.accept() print(f"Connection established from {client_addr}") data = client_sock.recv(1024) if data: print(f"Received payload: {data.decode()}") client_sock.sendall(data) # Echo data back client_sock.close()
Viva Voce Questions:
â€ĸ Q: Why is SO_REUSEADDR recommended for TCP server sockets?
â€ĸ Answer: It allows the server to immediately re-bind to the port even if previously closed sockets remain in the kernel's TIME_WAIT state.

🤖 Academic Track 6: AI, Machine Learning & Computer Vision

Supervised Learning â€ĸ Feature Scaling â€ĸ Confusion Matrix â€ĸ Scikit-Learn

Machine learning builds predictive data-driven models by discovering functional mappings $f(X) \approx Y$ from empirical training sets.

Experiment 6: Supervised Classification with Decision Trees & Evaluation

Aim: Train a Decision Tree classifier, compute the Confusion Matrix, and calculate Accuracy, Precision, Recall, and F1-Score metrics.

from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import classification_report, confusion_matrix # Load dataset and partition 80/20 iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=42) # Train Decision Tree with Gini Impurity clf = DecisionTreeClassifier(criterion='gini', max_depth=3, random_state=42) clf.fit(X_train, y_train) # Evaluate model predictions y_pred = clf.predict(X_test) print("Confusion Matrix:\n", confusion_matrix(y_test, y_pred)) print("\nClassification Report:\n", classification_report(y_test, y_pred, target_names=iris.target_names))
Viva Voce Questions:
â€ĸ Q: Why is Precision preferred over Accuracy in imbalanced datasets?
â€ĸ Answer: Accuracy is deceptive when the majority class dominates (e.g. 99% negative cases); Precision ($TP / (TP + FP)$) measures exactness among positive predictions regardless of negative class volume.

đŸ”Ŧ Experiment 2: Analog-to-Digital Conversion (ADC): Sampling, Quantization & Resolution

Standardized university practical engineering curriculum manual across Computer Science and Information Technology degree programs.

📋 Experiment Overview & Curriculum Specifications

IoT & Embedded Systems â€ĸ Medium â€ĸ 30 mins

Aim / Objective: To formulate, implement, and analyze Analog-to-Digital Conversion (ADC) modeling Nyquist-Shannon sampling, uniform quantization, and Signal-to-Quantization-Noise Ratio (SQNR) from scratch.

Prerequisites & Domain Concepts

Analog voltage signals, binary quantization, signal-to-noise ratio, trigonometric wave functions.

Asymptotic Complexity Bounds

â€ĸ Time Complexity: O(1) conversion per sample
â€ĸ Space Complexity: O(1) memory overhead

Step-by-Step Algorithm

  1. Step 1: Define analog signal parameters: V_bias = 1.65V, Amplitude = 1.2V, frequency f = 5 Hz, duration = 0.4s.
  2. Step 2: Choose sampling frequency f_s = 50 Hz (satisfies Nyquist: f_s >= 2 * 5Hz = 10Hz).
  3. Step 3: Define 10-bit ADC specs: bits N = 10, max_code = 2^10 - 1 = 1023, V_ref = 3.3V. Step size Delta = 3.3 / 1023.
  4. Step 4: For each discrete time sample t_k = k / f_s:
  5. Step 5: Compute continuous voltage V(t_k). Clamp V within [0, V_ref].
  6. Step 6: Compute digital code: D_k = round(V(t_k) / Delta).
  7. Step 7: Compute reconstructed voltage: V_recon = D_k * Delta.
  8. Step 8: Calculate quantization error e_k = V_recon - V(t_k) and compute RMS SQNR.
  9. Step 9: Output ADC telemetry stream.

Verified Academic Source Code (PYTHON)

import math

class ADCSimulator:
    def __init__(self, resolution_bits=10, v_ref=3.3):
        self.bits = resolution_bits
        self.v_ref = v_ref
        self.max_code = (1 << resolution_bits) - 1 # 2^N - 1 (1023 for 10-bit)
        self.step_size = v_ref / self.max_code     # LSB Voltage

    def convert(self, analog_voltage):
        # Hardware clamping to reference rails [0.0, V_ref]
        clamped = max(0.0, min(self.v_ref, analog_voltage))
        # Quantization to discrete digital code
        digital_code = int(round(clamped / self.step_size))
        # Digital-to-Analog reconstruction
        reconstructed_voltage = digital_code * self.step_size
        quantization_error = reconstructed_voltage - clamped
        return digital_code, reconstructed_voltage, quantization_error

# Synthetic Analog Sensor Signal: Sine Wave representing temperature oscillation
f_signal = 5.0     # 5 Hz analog sensor frequency
f_sampling = 50.0  # 50 Hz sampling rate (Nyquist: 50Hz >= 2 * 5Hz = 10Hz)
v_bias = 1.65      # 1.65V DC offset
amplitude = 1.2    # 1.2V Peak amplitude -> Range [0.45V, 2.85V]

adc_10bit = ADCSimulator(resolution_bits=10, v_ref=3.3)
adc_12bit = ADCSimulator(resolution_bits=12, v_ref=3.3)

print("=== Analog-to-Digital Converter (ADC) Sampling & Quantization ===")
print(f"Signal Parameters : Frequency = {f_signal} Hz | Peak Range = [{v_bias - amplitude:.2f}V, {v_bias + amplitude:.2f}V]")
print(f"Sampling System   : Sample Rate = {f_sampling} Hz (Satisfies Nyquist condition: 50 Hz >= 10 Hz)")
print(f"10-Bit ADC Specs  : Max Code = {adc_10bit.max_code} | Step Size (LSB) = {adc_10bit.step_size * 1000:.3f} mV")
print(f"12-Bit ADC Specs  : Max Code = {adc_12bit.max_code} | Step Size (LSB) = {adc_12bit.step_size * 1000:.3f} mV\n")

print(f"{'Sample':>6} | {'Time (s)':>8} | {'Analog (V)':>10} | {'10-Bit Code':>11} | {'Recon (V)':>10} | {'Error (mV)':>10}")
print("-" * 65)

total_samples = 10
squared_errors = []

for k in range(total_samples):
    t = k / f_sampling
    v_analog = v_bias + amplitude * math.sin(2 * math.pi * f_signal * t)
    code, v_recon, err = adc_10bit.convert(v_analog)
    squared_errors.append(err ** 2)

    print(f"{k:>6} | {t:>8.3f} | {v_analog:>10.4f} | {code:>11d} | {v_recon:>10.4f} | {err * 1000:>10.3f}")

# Compute Signal-to-Quantization-Noise Ratio (SQNR)
theoretical_sqnr = 6.02 * adc_10bit.bits + 1.76
rms_noise_mv = math.sqrt(sum(squared_errors) / total_samples) * 1000

print(f"\n--- Quantization Noise Analysis ---")
print(f"Root Mean Square (RMS) Quantization Noise : {rms_noise_mv:.3f} mV")
print(f"Maximum Possible Quantization Error (+-0.5 LSB): +-{adc_10bit.step_size * 1000 / 2:.3f} mV")
print(f"Theoretical 10-Bit SQNR (6.02*N + 1.76)   : {theoretical_sqnr:.2f} dB")
print(f"Theoretical 12-Bit SQNR (6.02*12 + 1.76)  : {6.02 * 12 + 1.76:.2f} dB (12-bit reduces noise by 4x!)")
â–ļ Run in Online IDE

Sample Test Input

5 Hz analog sine wave sampled at 50 Hz by 10-bit and 12-bit ADCs (V_ref = 3.3V)

Expected Terminal Output

=== Analog-to-Digital Converter (ADC) Sampling & Quantization ===
Signal Parameters : Frequency = 5.0 Hz | Peak Range = [0.45V, 2.85V]
Sampling System   : Sample Rate = 50.0 Hz (Satisfies Nyquist condition: 50 Hz >= 10 Hz)
10-Bit ADC Specs  : Max Code = 1023 | Step Size (LSB) = 3.226 mV
12-Bit ADC Specs  : Max Code = 4095 | Step Size (LSB) = 0.806 mV

Sample | Time (s) | Analog (V) | 10-Bit Code |  Recon (V) | Error (mV)
-----------------------------------------------------------------
     0 |    0.000 |     1.6500 |         512 |     1.6517 |      1.670
     1 |    0.020 |     2.3553 |         730 |     2.3548 |     -0.457
     2 |    0.040 |     2.7912 |         865 |     2.7903 |     -0.892
     3 |    0.060 |     2.7912 |         865 |     2.7903 |     -0.892
     4 |    0.080 |     2.3553 |         730 |     2.3548 |     -0.457
     5 |    0.100 |     1.6500 |         512 |     1.6517 |      1.670
     6 |    0.120 |     0.9447 |         293 |     0.9452 |      0.457
     7 |    0.140 |     0.5088 |         158 |     0.5097 |      0.892
     8 |    0.160 |     0.5088 |         158 |     0.5097 |      0.892
     9 |    0.180 |     0.9447 |         293 |     0.9452 |      0.457

--- Quantization Noise Analysis ---
Root Mean Square (RMS) Quantization Noise : 1.009 mV
Maximum Possible Quantization Error (+-0.5 LSB): +-1.613 mV
Theoretical 10-Bit SQNR (6.02*N + 1.76)   : 61.96 dB
Theoretical 12-Bit SQNR (6.02*12 + 1.76)  : 74.00 dB (12-bit reduces noise by 4x!)
University Viva Voce Questions & Model Answers:

â€ĸ Q: What is the Nyquist-Shannon Sampling Theorem?
â€ĸ Answer: To reconstruct a continuous analog bandlimited signal without aliasing distortion, the sampling frequency f_s must be at least twice the maximum frequency component present in the signal: f_s >= 2 * f_max.

â€ĸ Q: What is Quantization Error and what is its maximum theoretical value?
â€ĸ Answer: Quantization error is the difference between the true continuous analog voltage and the reconstructed discrete digital value. For uniform quantization with step size Delta (1 LSB), the maximum rounding error is +-0.5 * Delta (+-0.5 LSB).

â€ĸ Q: What is an Anti-Aliasing Filter and where is it placed?
â€ĸ Answer: An Anti-Aliasing Filter is an analog low-pass filter placed physically before the ADC input pin to attenuate all frequency components above the Nyquist frequency (f_s / 2), preventing high frequencies from folding back into the audible/measured band.

â€ĸ Q: How does a Successive Approximation Register (SAR) ADC work?
â€ĸ Answer: A SAR ADC uses binary search: starting with the MSB, it uses an internal DAC and analog comparator to test whether the input voltage is greater or less than the candidate voltage, resolving 1 bit per clock cycle (N cycles for N bits).

â€ĸ Q: What is the "6 dB per bit" rule in digital signal processing?
â€ĸ Answer: The theoretical formula SQNR = 6.02 * N + 1.76 dB means that every additional bit of ADC resolution doubles the number of voltage levels, cutting quantization noise in half and increasing the Signal-to-Quantization-Noise Ratio by approximately 6 dB.