Basic Hardware Modeling
R2026bYou can write MATLAB code to model state machines and implement hardware elements such as counters and RAM for HDL code generation.
Topics
- Model a Counter for HDL and High-Level Synthesis Code Generation
To write MATLAB® code that models hardware and is suitable for HDL and High-Level Synthesis (HLS) code generation, use this design pattern.
- Model a State Machine for HDL and High-Level Synthesis Code Generation
The following design pattern shows MATLAB examples of Mealy and Moore state machines which are suitable for HDL and High-Level Synthesis (HLS) code generation.
- Generate HDL and HLS Code from Transmit and Receive FIFO Algorithms
This example shows how to generate HDL and HLS code from MATLAB designs that implement transmit and receive first-in, first-out (FIFO) buffers.
- Implement RAM Using MATLAB Code
You can write MATLAB code that maps to RAM during HDL code generation by using:
- Load constants from a MAT-File
Use the
coder.loadfunction to load constants from a MAT-file.

