Overview - Pure vs impure functions
What is it?
In VHDL, pure and impure functions are ways to write reusable blocks of code that return values. A pure function always produces the same output for the same inputs and does not change any signals or variables outside itself. An impure function may depend on or change things outside its inputs, so its output can vary even with the same inputs.
Why it matters
Using pure functions helps make VHDL designs predictable and easier to understand because their behavior is consistent and side-effect free. Without distinguishing pure and impure functions, designs could become unreliable or hard to debug, as functions might change signals unexpectedly or depend on hidden states.
Where it fits
Before learning pure vs impure functions, you should understand basic VHDL syntax, signals, variables, and how functions work in general. After this, you can learn about procedures, processes, and how to write synthesizable VHDL code.
