ΣSigmaStudio Ask AI Русский Log in

Lookup table working logic.

SigmaDSP & SigmaStudio Skfir Feb 5, 2014 00:00 4 replies Original on forum ↗
Subscribe
Skfir Question
Feb 5, 2014 00:00

Hello guyz, I am playing with the lookup table, looking at its description etc. it is written, that "This algorithm checks if the index at the input is greater than the maximum index and, if so, indexes the last value in the table." Could you please clarify, does it mean that if my last cell has index 10 and value 1 and if the input is greater, then one the output of the table will constantly produce 1? I misunderstand something probably...

Thank you!

KJBob Reply
Feb 5, 2014 00:00

Hello Skfir,

Actually the documented behavior applies only to the IndexLimitProtection LUT. When indexed within its table limits it outputs the appropriate indexed value. It outputs the first table entry when its input is one or below. It outputs the entry in the highest available position for that position's index or higher. Thus its output is well-defined for any index, whether within its table or outside.

For example, an IndexLimitProtection LUT with the table shown, outputs 0 for zero or negative inputs. An input of 1 to 16 (integer format) outputs the indexed value from 1.0 to 15.0 (in 5.23 format). Indexes exceeding 16 also output 15.0. We can demonstrate this behavior with a circuit like the one shown here:

The sawtooth oscillator causes a slow sweep from integer -32 to integer +32. Because the LUT only has entries for indexes 1 to 16, the rest of the sweep saturates at the table edges. The Real-Time Display shows this result:

The other LUT in this circuit is a Standard LUT, without Index Limit Protection. With the same table and input sweep, its output is a mess:

Thus, choose a Standard LUT when you're certain its input remains within range. Use the IndexLimitProtection LUT when you can't guarantee within-range operation.

4142b189c82751c075f75057a86eb8bc.jpg
4142b189c82751c075f75057a86eb8bc.jpg
4142b189c82751c075f75057a86eb8bc.jpg-199x361.jpg
4142b189c82751c075f75057a86eb8bc.jpg-199x361.jpg
221997ea28ba3695f3b74fdd33e629ab.jpg
221997ea28ba3695f3b74fdd33e629ab.jpg
221997ea28ba3695f3b74fdd33e629ab.jpg-496x235.jpg
221997ea28ba3695f3b74fdd33e629ab.jpg-496x235.jpg
e5e8de52a1e738c948371ee5f8bdae6d.jpg
e5e8de52a1e738c948371ee5f8bdae6d.jpg
e5e8de52a1e738c948371ee5f8bdae6d.jpg-450x308.jpg
e5e8de52a1e738c948371ee5f8bdae6d.jpg-450x308.jpg
0368804bb9dfc7868b475b54b39282dd.jpg
0368804bb9dfc7868b475b54b39282dd.jpg
0368804bb9dfc7868b475b54b39282dd.jpg-450x307.jpg
0368804bb9dfc7868b475b54b39282dd.jpg-450x307.jpg
Skfir Reply
Feb 5, 2014 00:00

Great! Now I understand finally! Thank you Bob!

KJBob Reply
Feb 5, 2014 00:00

Hi Skfir,

Thank you for your kind reply. As it turns out, there's a goof above I need to fix. A zero input into a LUT references the first table entry, a one advances to the next entry (labeled "2"). An input n references the (n+1)th entry if it exists. The table's input logic going into the table appears as shown. I'd fix my answer above except it appears that posts cannot be edited once they have been replied to. Also it's hard to type anything with a cat sleeping on my lap.

I had to insert a DC Source at the LUT input to figure out the LUT logic. This is the old, "Is it 0 to whatever, or 1 to whatever+1?" difficulty that has followed me in all my attempts to do anything that even smells like digital (hardware or software). That's why SigmaStudio rocks -- it makes (almost) everything look like analog.

Best regards,

Bob

de1836f684e70c906cca863a2475bd41.jpg
de1836f684e70c906cca863a2475bd41.jpg
de1836f684e70c906cca863a2475bd41.jpg-199x361.jpg
de1836f684e70c906cca863a2475bd41.jpg-199x361.jpg
Skfir Reply
Feb 5, 2014 00:00

Yeah Thank you Bob. Regards to the kitty.