LookUp table with more than 5 input?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
        Hi, How to create LookUp table with more than 5 input. For example 16 inputs and 16 outputs? Maybe with varilog? Because standart LookUp table companent has max 5 input.   
0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You cannot access memory through UDB, neither sram nor flash.

   

 

   

Bob

View solution in original post

0 Likes
10 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum.

   

Principally a Verilog solution would work, but a 16 input logic would require a switch statement with 65000 cases which with 16 outputs would result in a 130 kB memory requirement. This will even not fit into a C-language programmed LUT  in a PSoC.

   

What is exactly your problem, what do you want to perform, what frequency is required?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thank you very much Bob. 

   

I have binary words generated by Pseudo random sequence (PRS) generator. I'd like to create table where each PRS word will be equivalent to decimal numbers. And then to search decimal number by PRS binary word or vice versa by decimal number to search PRS binary word. PRS words will come by SPI and decimal number(of course in binary ) will return by SPI.

   

For example: 12-bit PRS table, in total 4095 binary word. First PRS binary word 000000000001 = 1, ..., 101000100000 = 123,... etc. 

   

I have thought that if to create table PRS word = decimal number (of course, decimal means binary) and will write verilog code. it must work faster at UDB than and Cortex-M3 CPU. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You cannot access memory through UDB, neither sram nor flash.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Sorry, i'm just started to deal with UDB. I didn't think about sram or flash.   I thought to create some array or range with PRS binary words in Verilog, up to 15 bit. I thought that once it created with Verilog it must be inside UDB. Then need to write function that get PRS word received by SPI and return array index of this PRS word. Or to create lookup table 15 x 15. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

"to create some array " This array will need a place to store it, ram or rom. Not possible for a UDB.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Ok. Could you advice the fastest way for  PSoC 5LP, where need to place array of constants (32768 constants) that then get array index of constant? Array of constants must be created once while compiling. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Use

   

const uint16 YourArray[] = { your 32k values go here, comma separated};

   

hoping the compiler doesn't get a hiccup 😉

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Dear Bob, i know how to create array. My question about where to place array? Or it is mean that i can't control where it will be placed, can't to point for compiler where to place array? For example, how to place in RAM?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You cannot place your array in ram. Max sram for PSoC5 is 64k.

   

Better use a raspberry pi. PSoCs are really good for embedded applications as controllers etc, not for larger data.

   

For placing data at defined addresses consult the GCC manuals.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks. And last question. 🙂 For example I take 14-bit array and will place it in 32 KB SRAM in SRAM region ( Data Address Map)

   

What do you think, how many time need to search  array index by 14bit word. I understand that it will be simple sorting, one by one. Or how to count it? How many MCU cycle need to search in SRAM? 

0 Likes