From: gretzteam on 17 Nov 2009 19:12 Hi, In a very basic DDS, the first method used to reduce the ROM size is to only store one quarter of the sine-wave. Although this sounds very obvious, I cannot figure out how to do it without storing 1/4th + 1 location in the ROM. For example, say we start with a 10-bit address for the full table (1024 locations). Ideally, we want to use the top two bits to determine which quadrant we are into, and the bottom 8 bits as the address in a 256-location ROM (not a 257 location ROM!!). However, when implementing this, it really seems like I need to store the value at pi/4 (256 in the example above), which makes the ROM 257 location! Any idea? Thanks! Dave
From: glen herrmannsfeldt on 17 Nov 2009 20:07 gretzteam <gretzteam(a)yahoo.com> wrote: > In a very basic DDS, the first method used to reduce the ROM size is to > only store one quarter of the sine-wave. Although this sounds very obvious, > I cannot figure out how to do it without storing 1/4th + 1 location in the > ROM. > For example, say we start with a 10-bit address for the full table (1024 > locations). Ideally, we want to use the top two bits to determine which > quadrant we are into, and the bottom 8 bits as the address in a > 256-location ROM (not a 257 location ROM!!). Well, it is 1.0 which probably doesn't fit anyway. You know it is 1.0 (or 0.99999) so just put that in. > However, when implementing this, it really seems like I need to store the > value at pi/4 (256 in the example above), which makes the ROM 257 location! -- glen
From: Tim Wescott on 17 Nov 2009 20:18 On Tue, 17 Nov 2009 18:12:34 -0600, gretzteam wrote: > Hi, > In a very basic DDS, the first method used to reduce the ROM size is to > only store one quarter of the sine-wave. Although this sounds very > obvious, I cannot figure out how to do it without storing 1/4th + 1 > location in the ROM. > > For example, say we start with a 10-bit address for the full table (1024 > locations). Ideally, we want to use the top two bits to determine which > quadrant we are into, and the bottom 8 bits as the address in a > 256-location ROM (not a 257 location ROM!!). > > However, when implementing this, it really seems like I need to store > the value at pi/4 (256 in the example above), which makes the ROM 257 > location! > > > Any idea? > > Thanks! > > Dave Do like Glen said, and hard-code one location. Or store values at half-locations, i.e. pi * (1/2048, 3/2048 ... 2047/2048). Not only does this now wrap nicer, but you never have to deal with 1 -- just 0.9999997. -- www.wescottdesign.com
From: gretzteam on 17 Nov 2009 20:41 >Do like Glen said, and hard-code one location. > >Or store values at half-locations, i.e. pi * (1/2048, 3/2048 ... >2047/2048). Not only does this now wrap nicer, but you never have to >deal with 1 -- just 0.9999997. Got it! I guess this has a bunch of advantages! 1) Not storing 1.0 is a good one from the ROM width perspective. 2) The ROM address can be generated with a simple one-complement (inverse all bits) when we detect the 2nd and 4th quadrant! Which also save the extra address bit I needed! Now it all sounds obvious, but I litterally spent the whole day on this...should have posted earlier! Thanks a lot! Dave
From: Eric Jacobsen on 18 Nov 2009 01:10 On 11/17/2009 6:41 PM, gretzteam wrote: >> Do like Glen said, and hard-code one location. >> >> Or store values at half-locations, i.e. pi * (1/2048, 3/2048 ... >> 2047/2048). Not only does this now wrap nicer, but you never have to >> deal with 1 -- just 0.9999997. > > Got it! > I guess this has a bunch of advantages! > 1) Not storing 1.0 is a good one from the ROM width perspective. > 2) The ROM address can be generated with a simple one-complement (inverse > all bits) when we detect the 2nd and 4th quadrant! Which also save the > extra address bit I needed! > > Now it all sounds obvious, but I litterally spent the whole day on > this...should have posted earlier! > > Thanks a lot! > > Dave Sounds like a day well spent to me. Getting those insights into implementation issues can help a lot in building efficient systems. -- Eric Jacobsen Minister of Algorithms Abineau Communications http://www.abineau.com
|
Next
|
Last
Pages: 1 2 3 Prev: Discretization of nonlinear differential equation Next: Interpolation |