Forum Discussion
Altera_Forum
Honored Contributor
11 years agoIt allows you to define new data types that allow you to write code that is easier to understand.
For example, lets say I am writing some DSP code using the VHDL data type "signed", but I have an array of signals, eg., the inputs to a parallel FFT, and I want to write a loop ... Since VHDL does not have an array of signed data type, I can define one ...
type signed_vector is array(natural range <>) of signed;
-- An Array of 8 16-bit signed values
signal fft_input : signed_vector(0 to 7)(15 downto 0);
signal fft_output : signed_vector(0 to 7)(15 downto 0);
-- Some DSP logic ... perhaps involving loops, eg.,
for i in 0 to 7 loop
fft_output(i) <= fft_input(i);
end loop;
Cheers, Dave