symlet
Member level 1
- Joined
- Oct 12, 2012
- Messages
- 41
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,616
address | data |
00 | 0 |
01 | h0 |
10 | h2 |
11 | h0+h2 |
address | data |
00 | 0 |
01 | h1 |
10 | h3 |
11 | h1+h3 |
your input vector is too wide to address the tables. You only need 3 bits. 2 bits to address the LUTs and 1 bit to select which LUT. The other 5 bits are just wasted.
So if you have an input of 8 bits, why havent you built a 256 entry LUT?
Hai andre_teprom,symet,
You can build easily a LUT throught comands switch...case, just working with desired data.
+++
Hai TickyDicky,
If I design 256 entry LUT, the address should be from 00000000 until 11111111. However, how to build the 256 entry LUT with only two constant value (00,01,10,11)?
One more thing, if I build a 256 entry LUT with 8 constant values (h0-h3,g0-g3) the input data of 8 bits will used as an address to access the LUT contents. What I confuse is, is it this way is correct? :|Because in the LUT will have value of h0+g0+g1,h2+g3,h2+g0+g3,etc..instead my equation will multiply the input with the h0-h3 and g0-g3 only. Sorry if I ask basic question,I really stuck here. I try to hand-write the LUT many times, but still not get the right one. Thanks in advance
Hai andre_teprom,
Can you give example how to build LUT using switch,case function? Thanks in advance
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 process(clk) begin if rising_edge(clk) then case addr is when "000" => op <= 0; when "001" => op <= 1; when "010" => op <= 2; --etc end case; end if; end process;
You say you have an 8 bit input. So, with your new table, do you want a repeating pattern, so that that tha values 0-7 on X get the LUT values for the multiply, and then the next values 8-15 would have the same set of constants again repeated, or would you want 0-31 all having the same constant, with 32-63 having the next constant etc?
for the first case, you would use the LSBs (2 downto 0) as the address, or the 2nd case you would use the MSBs (7 downto 5). You cannot use all 8 bits to address into your LUT, because you have 8 entries, not 256.
- - - Updated - - -
Hai TrickyDicky,
I want a repeating pattern, so that that tha values 0-7 on X get the LUT values for the multiply, and then the next values 8-15 would have the same set of constants again repeated. Why you said I cannot use all 8 bits to address the LUT? What I undertsand is 8 entries means 8 LUT data with 8 address?.:|
yes, it has 8 addresses, but 8 addresses means the address bus is only 3 bits wide. a 8 bit address bus would have 256 entries.
From what you've said, you just need to connect the 3 LSBs of X to the table you already have. That will repeat the pattern.
I would use bit 2:1 for the address and bit 0 as the odd/even select. I still dont understand why you've split it into two tables though. why not just have 1 table?
you get the right results if you put the right values into the right parts of the table.
You use bits (2 downto 1) for address and 0 for odd/even.
Using bits (4 downto 1) would mean you have a 16 entry table, which you dont - you have 4.
Address | Data |
0000 | 0 |
0001 | h0 |
0010 | h2 |
0011 | h0+h2 |
0100 | 0 |
0101 | g0 |
0110 | g2 |
0111 | g0+g2 |
1000 | 0 |
1001 | h1 |
1010 | h3 |
1011 | h1+h3 |
1100 | 0 |
1101 | g1 |
1110 | g3 |
1111 | g1+g3 |
Using the 4 LSBs will give a repeating pattern, so an input of 16 will give the same LUT value as an input of 0.
For an 256 entry table, you just need 256 entries. You need to build the table yourself. ANd then just connect all 8 bits of the X input as the address.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?