Home / Learn Verilog / Recursion for Constants
Recursion for Constants
Compute at elaboration.
The gistCompute at elaboration.
The idea, explained simply
Definition
Recursive constant functions compute parameter values.
Why you need this
Tree structures and widths.
How it works
Keep depth bounded.
Where you'll see this
- Everyday RTL design
- FPGA and ASIC projects
- Testbenches and debugging
Try it
Fibonacci constantVerilog: edit and run
Computed before simulation starts.
Test what you just read
1. fib(10)?
0 1 1 2 3 5 8 13 21 34 55.