From 7de76c6696bec1af676f2e913563e0dee65d1b2b Mon Sep 17 00:00:00 2001 From: Joris van Rantwijk Date: Mon, 11 Apr 2016 21:28:17 +0200 Subject: [PATCH] Reduce amplitude to avoid numeric overflow. --- rtl/sincos_gen.vhdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/sincos_gen.vhdl b/rtl/sincos_gen.vhdl index 1234a76..0457b46 100644 --- a/rtl/sincos_gen.vhdl +++ b/rtl/sincos_gen.vhdl @@ -79,7 +79,7 @@ architecture rtl of sincos_gen is begin for i in 0 to table_size-1 loop sin_flt := sin(real(2*i + 1) / real(2 * table_size) * MATH_PI / 2.0); - sin_int := integer(sin_flt * real(2**table_width - 1)); + sin_int := integer(sin_flt * real(2**table_width - 2)); tbl(i) := std_logic_vector(to_unsigned(sin_int, table_width)); end loop; return tbl;