Advanced Search
Search Results
297 total results found
Referensi Lebih Lanjut
“The FreeRTOSTM Reference Manual.” Available: https://www.freertos.org/media/2018/FreeRTOS_Reference_Manual_V10.0.0.pdf “FreeRTOS Memory Management,” Digikey.com, 2021. https://www.digikey.com/en/maker/projects/introduction-to-rtos-solution-to-part-4-memory-m...
1. Introduction: From Python Lists to C Arrays
1.1 Key Differences Overview Aspect Python Lists C Arrays Size Dynamic (can grow/shrink) Fixed size (static) Type Can store mixed types Single type only Memory Automatic management Manual bounds checking Declaration list = [1, 2, 3] int arr[5] = {...
2. Array Declaration and Initialization
2.1 Basic Array Declaration Python vs C Comparison: Python C numbers = [1, 2, 3, 4, 5] int numbers[5] = {1, 2, 3, 4, 5}; grades = [] float grades[100]; name = "Alice" char name[10] = "Alice"; C Array Declaration Syntax: data_type array_name[size]...
3. Array Indexing and Access
3.1 Basic Indexing Python vs C Indexing: Operation Python C First element list[0] array[0] Last element list[-1] array[size-1] Nth element list[n] array[n] Modify element list[0] = 10 array[0] = 10; 3.1.1 Valid Indexing Example int numbers[5] =...
4. Array Input and Output Operations
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
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
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
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
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
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
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
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
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
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
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
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++
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
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++
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++
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...