|
|
How to create an efficient two dimensional VHDL arrays table
Hi,
Does anybody advise how to create a efficient vhdl 2 dimensional array
table? For example for the below vhdl code:-
library ieee;
use ieee.std_logic_1164.all;
entity NewLUT is
port
(
clk : in std_logic;
--encoder_a : in std_logic;
data_in : in integer range 3185 to 4215 ; --std_logic_vector(12 downto
0);
data_out : out std_logic_vector (30 downto 0);
out_ready : out std_logic
);
end;
architecture arc_NewLUT of NewLUT is
signal temp : std_logic;
begin
process
begin
if CLK'EVENT and CLK = '1' then
temp <= '1';
if temp = '1' then
case data_in is
when 3185=> data_out <= ("1010101101110111011101110111100");
when 3186=> data_out <= ("1010101101101001110100000011011");
when 3187=> data_out <= ("1010101101011100001010001111011");
when 3188=> data_out <= ("1010101101001110100000011011010");
when 3189=> data_out <= ("1010101101000000110110100111010");
when 3190=> data_out <= ("1010101100110011001100110011001");
when 3191=> data_out <= ("1010101100100101100010111111001");
when 3192=> data_out <= ("1010101100010111111001001011001");
when 3193=> data_out <= ("1010101100001010001111010111000");
when 3194=> data_out <= ("1010101011111100100101100011000");
when 3195=> data_out <= ("1010101011101110111011101110111");
when 3196=> data_out <= ("1010101011100001010001111010111");
when 3197=> data_out <= ("1010101011010011101000000110110");
when 3198=> data_out <= ("1010101011000101111110010010110");
when 3199=> data_out <= ("1010101010111000010100011110110");
when 3200=> data_out <= ("1010101010101010101010101010101");
when 3201=> data_out <= ("1010101010011101000000110110101");
when 3202=> data_out <= ("1010101010001111010111000010100");
when 3203=> data_out <= ("1010101010000001101101001110100");
when 3204=> data_out <= ("1010101001110100000011011010011");
when 3205=> data_out <= ("1010101001100110011001100110011");
when 3206=> data_out <= ("1010101001011000101111110010011");
when 3207=> data_out <= ("1010101001001011000101111110010");
when 3208=> data_out <= ("1010101000111101011100001010010");
when 3209=> data_out <= ("1010101000101111110010010110001");
when 3210=> data_out <= ("1010101000100010001000100010001");
when 3211=> data_out <= ("1010101000010100011110101110000");
when 3212=> data_out <= ("1010101000000110110100111010000");
when 3213=> data_out <= ("1010100111111001001011000110000");
when 3214=> data_out <= ("1010100111101011100001010001111");
when 3215=> data_out <= ("1010100111011101110111011101111");
when others => data_out <= ("1111111111111111111111111111111");
end case;
else
data_out <= ("0000000000000000000000000000000");
end if;
out_ready <= '1';
out_ready <= '0';
end if;
--
-- Add a flag to be used as a clk to the register
--
end process;
end arc_NewLUT ;
For each case statement, I have key in the data_in constants. If I
have hundreds or thousands of data_in constants, does anybody know how
to create more effciently(eg. without actual writing in constants for
the data_in?
WM
|
|
0
|
|
|
|
Reply
|
tan_whee_min (2)
|
1/18/2010 6:23:57 AM |
|
On Jan 18, 1:23=A0am, tanwm <tan_whee_...@yahoo.com.sg> wrote:
> Hi,
>
> For each case statement, I have key in the data_in constants. If I
> have hundreds or thousands of data_in constants, does anybody know how
> to create more effciently(eg. without actual writing in constants for
> the data_in?
>
What was the original source of each case condition? Did you type
them in? Copied from an Excel spreadsheet? The output of a compiler
that generates code?
Based on the name of the entity, I suspect that the data for 'NewLut'
is from a computation of some function. If that's the case, then the
way to do that is with a function that computes the entire lookup
table contents as a constant...then use that table.
For an example that computes a video gamma correction table
http://groups.google.com/group/comp.lang.vhdl/browse_frm/thread/c75497afc79=
8a696/5f4abd6b792578ea?hl=3Den&lnk=3Dgst&q=3DRGB+Kevin+Jennings#5f4abd6b792=
578ea
For an sRGB<-->RGB conversion lookup table example
http://groups.google.com/group/comp.lang.vhdl/browse_frm/thread/b2e4be64800=
69641?hl=3Den#
Once you have the constant lookup table computed, you use it like
this...
data_out <=3D My_LUT(data_in);
Kevin Jennings
|
|
0
|
|
|
|
Reply
|
KJ
|
1/18/2010 3:06:17 PM
|
|
|
1 Replies
443 Views
(page loaded in 0.052 seconds)
Similiar Articles: How to create an efficient two dimensional VHDL arrays table ...Hi, Does anybody advise how to create a efficient vhdl 2 dimensional array table? For example for the below vhdl code:- library ieee; use ieee... How to write a VHDL code for 1Hz signal? - comp.lang.vhdl ...How to create an efficient two dimensional VHDL arrays table ... How to write a VHDL code for 1Hz signal? - comp.lang.vhdl ... How to create an efficient two dimensional ... Histogram calculation - comp.graphics.api.openglHow to create an efficient two dimensional VHDL arrays table ... Hi, Does anybody advise how to create a efficient vhdl 2 dimensional array table? how we plot two dimensional dirac delta function - comp.soft-sys ...How to create an efficient two dimensional VHDL arrays table ... If that's the case, then the way to do that is with a function that ... matrix, alternatively, > compute ... grouping medical procedure codes using ranges of codes - comp.soft ...How to create an efficient two dimensional VHDL arrays table ... Hi, Does anybody advise how to create a efficient vhdl 2 dimensional array table? Help rapresenting multidimensional array ( pivot table ) - comp ...Signed multiplication - comp.lang.vhdl... number of bits ... Tables GIS, business ... tables.The simplest single flat table is a two-dimensional array ... can create ... how to transpose large matrix? - comp.unix.shell... could probably save the names in an array ... Janis Papanagnou wrote: [To make sure; I didn't write the subsequent two lines ... matrix transpose code - comp.lang.vhdl how ... Some text processing questions - comp.lang.vhdl... but ultimately probably are the most time efficient ... LINE type from this thread, I tried to make the array of ... Create a set of VHDL procedures Create your command file ... syntax for creating array of cell arrays - comp.soft-sys.matlab ...... 1,12) numeric array. I create the ... I have two cell arrays obtained from a ... need to convert cell array to matrix ... database table of the following schema, > > CREATE ... Help needed: read 3-dimensional array from a MAT-file in Fortran ...For large arrays, the mexFunction approach is the most efficient ... into 2D array - comp.lang.vhdl ... Help needed: read 3-dimensional ... Reading a two-dimensional array How to create a more efficient two dimensional vhdl arrays table ...Shared Material ... Hi, Does anybody advise how to create a efficient vhdl 2 dimensional array table? For ... I have a few questions first: 1. What is temp doing - it ... How to create an efficient two dimensional VHDL arrays table ...Hi, Does anybody advise how to create a efficient vhdl 2 dimensional array table? For example for the below vhdl code:- library ieee; use ieee... 7/26/2012 1:17:52 AM
|
|
|
|
|
|
|
|
|