I'm writing a code for a triangular wave generator in vhdl, and I have a
little issue. I want a signal with Vmax =3.3V and I never reach this
value, the max is 3.2999...
There is not a really big difference but may will be damaging for what I
want to simulate with this signal (14 bits ADC).
Do you have any hint to get exactly the 3.3 value, if is it possible?
My code is below:
use ieee.std_logic_1164 .all;
entity test is
port(triangle: out real);
architecture archi of test is
signal tmp : real := 0.0;
constant delta : real := 1000.0e-12;
constant fin : time := 1000 ps;
variable t : real := 0.0;
variable Vmax : real := AMP/2.0;
t := t + delta;
tmp <= OFFSET+Vmax*(2.0/math_pi)*arcsin(sin(math_2_pi*FREQ*t));
wait for fin;
end process P1;
triangle <= tmp;