From 12b896c2dff597e30a9597b97a7b4e0375ff3220 Mon Sep 17 00:00:00 2001 From: Joris van Rantwijk Date: Mon, 11 Apr 2016 23:21:25 +0200 Subject: [PATCH] Fix mistake in Taylor correction. This improves accuracy, but there is probably room for further improvement by avoiding accumulation of rounding errors. --- rtl/sincos_gen.vhdl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtl/sincos_gen.vhdl b/rtl/sincos_gen.vhdl index 0457b46..ad98aa2 100644 --- a/rtl/sincos_gen.vhdl +++ b/rtl/sincos_gen.vhdl @@ -192,8 +192,8 @@ begin -- Keep phase remainder and work on multiplication by Pi/2. r2_rphase <= r1_rphase; r2_dphase <= r1_dphase + - resize(r1_dphase(dphase_bits-1 downto 6), dphase_bits) + - signed("0" & r1_dphase(5 downto 5)); + resize(r1_dphase(dphase_bits-1 downto 7), dphase_bits) + + signed("0" & r1_dphase(6 downto 6)); -- Table lookup. r2_sin_data <= unsigned(lookup_table(to_integer(r1_sin_addr)));