Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

341 total results found

4. Array Input and Output Operations

Algorithm Programming - EE Module 3 : Array (Static)

4.1 Reading Array Elements 4.1.1 Reading with Known Size #include <stdio.h> int main() { int numbers[5]; printf("Enter 5 integers:\n"); for (int i = 0; i < 5; i++) { printf("Element %d: ", i + 1); scanf("%d", &numbers[i]); ...

5. Common Array Operations

Algorithm Programming - EE Module 3 : Array (Static)

5.1 Array Traversal 5.1.1 Forward Traversal // Python equivalent: for item in list: for (int i = 0; i < size; i++) { printf("%d ", arr[i]); } 5.1.2 Reverse Traversal // Python equivalent: for item in reversed(list): for (int i = size - 1; i >= 0; i--) { ...

6. Mathematical Operations on Arrays

Algorithm Programming - EE Module 3 : Array (Static)

6.1 Statistical Operations 6.1.1 Sum and Average #include <stdio.h> int sum_array(int arr[], int size) { int sum = 0; for (int i = 0; i < size; i++) { sum += arr[i]; } return sum; } double average_array(int arr[], int size) { if (...

7. Character Arrays and Strings

Algorithm Programming - EE Module 3 : Array (Static)

7.1 Character Arrays vs Strings Understanding C Strings: In C, strings are arrays of characters terminated by a null character ('\0'). // Character array (not necessarily a string) char letters[5] = {'H', 'e', 'l', 'l', 'o'}; // String (null-terminated charac...

8. Multi-dimensional Arrays

Algorithm Programming - EE Module 3 : Array (Static)

8.1 Two-Dimensional Arrays 8.1.1 Declaration and Initialization // Declaration int matrix[3][4]; // 3 rows, 4 columns // Initialization methods int grid[2][3] = { {1, 2, 3}, {4, 5, 6} }; // Alternative initialization int numbers[2][3] = {{1, 2, 3}, ...

1. Understanding Testbench in VHDL

Digital Sistem Design (PSD/DSG) Module 4 - Testbench

A VHDL testbench is a non-synthesizable VHDL entity used to simulate and verify the functionality of another VHDL entity, often referred to as the Unit Under Test (UUT). Think of it as a virtual lab environment where you can apply a sequence of inputs (stimulu...

2. Components of a Testbench

Digital Sistem Design (PSD/DSG) Module 4 - Testbench

2.1 Entity Declaration The testbench entity is declared without any ports. It's a self-contained module because it doesn't connect to any higher-level design; it is the top-level entity for the simulation. entity project_tb is -- Empty because testbench do...

3. Testbench Architecture Models

Digital Sistem Design (PSD/DSG) Module 4 - Testbench

3.1 Testbench for Combinational Circuit There are three architectural models for changing the value of inputs in a testbench. For example, if we want to make a testbench for a half adder entity below, we could use three methods: library IEEE; use IEEE.STD_LOGI...

4. Assert and Report Statement

Digital Sistem Design (PSD/DSG) Module 4 - Testbench

4.1 Assert Statement The assert statement is used for creating self-checking testbenches. It acts like an automated check that constantly monitors a condition. If the condition is false, it "asserts" a message, alerting us to a problem without requiring us to ...

5. File I/O in VHDL

Digital Sistem Design (PSD/DSG) Module 4 - Testbench

In VHDL, we can perform file handling using the TextIO library. This feature is very useful for documenting the results of a program that has been created. To use the TextIO library, we need to add it at the beginning of our program as follows: use std.textio....

Extra: Array in VHDL

Digital Sistem Design (PSD/DSG) Module 4 - Testbench

6.1 Array In VHDL, an array is a collection of elements that share the same data type. You can think of an array as a variable that holds many elements of the same type, and these elements are indexed to be accessed. The index can be a number or another indexa...

1. Understanding Merge Sort

Algorithm Programming - CE Module 4 - Merge Sort and Quick Sort

What is Merge Sort? Merge Sort is an efficient, comparison-based sorting algorithm that uses a "divide and conquer" strategy. In simple terms, it repeatedly breaks down a list into several sub-lists until each sub-list contains only one item (which is consider...

2. Merge Sort in C++

Algorithm Programming - CE Module 4 - Merge Sort and Quick Sort

This section explains how the "divide and conquer" strategy of Merge Sort is implemented in C++. The logic is split into two primary functions: mergeSort() which handles the recursive division, and merge() which handles the conquering and sorting. The C++ Code...

3. Understanding Quick Sort

Algorithm Programming - CE Module 4 - Merge Sort and Quick Sort

What is Quick Sort? Quick Sort is a highly efficient, comparison-based sorting algorithm that also uses a "divide and conquer" strategy. It is one of the most widely used sorting algorithms due to its fast average-case performance. The core idea is to select a...

4. Lomuto Quick Sort in C++

Algorithm Programming - CE Module 4 - Merge Sort and Quick Sort

This section explains how the "divide and conquer" strategy of Quick Sort is implemented in C++. The logic is split into two primary functions: quickSort() which handles the recursive division, and partition() which rearranges the array using the popular Lomut...

5. Hoare Quick Sort in C++

Algorithm Programming - CE Module 4 - Merge Sort and Quick Sort

This section explains how the "divide and conquer" strategy of Quick Sort is implemented in C++. The logic is split into two primary functions: quickSort() which handles the recursive division, and partition() which rearranges the array using the classic Hoare...

Objective

Fundamentals Digital Systems (DSD/FDS) Module 3 - Karnaugh Map

By the end of this module, you will be able to: Understand the purpose of a Karnaugh Map (K-Map) as a visual tool for simplifying digital logic. Correctly create a K-Map for functions with 2, 3, or 4 input variables. Translate a Boolean function or a truth ta...

What is a Karnaugh Map and Why Do We Use It?

Fundamentals Digital Systems (DSD/FDS) Module 3 - Karnaugh Map

In digital electronics, we often start with complex Boolean functions that describe how a circuit should behave. A complex function requires many logic gates (like AND, OR, NOT) to build. More gates mean the circuit is more expensive, consumes more power, and ...