regarding look up table

Guest
hi im krishna kishore im a student ,

i want to design a digital phase locked loop , in that first step is
the generation of reference sine wave. So that can be generated by look
up table. i couldnot able write look up table perfectly , if any body
can help me with an exampl plz i will be very much great full to them
thank u
regards
krishna
 
onkarkk@gmail.com wrote:
hi im krishna kishore im a student ,

i want to design a digital phase locked loop , in that first step is
the generation of reference sine wave. So that can be generated by look
up table. i couldnot able write look up table perfectly , if any body
can help me with an exampl plz i will be very much great full to them
thank u
regards
krishna
One way of coding a lookup table is as an array. The elements of the
array are the table contents. In your case the array index could be
degrees or radians and the elements would be corresponding values of
the sine function.

Charles
 
onkarkk@gmail.com wrote:
hi im krishna kishore im a student ,

i want to design a digital phase locked loop , in that first step is
the generation of reference sine wave. So that can be generated by look
up table. i couldnot able write look up table perfectly , if any body
can help me with an exampl plz i will be very much great full to them
In a similar situations, I write a C program that generates the lookup
table. Of course, that assumes you are comfortable with C. Is that a
route you are interested in? I write the C to directly generate a VHDL
package file. It is quite a bit of effort up front for the first one,
but it eliminates errors from hand entry of tables, and is very easy to
modify. For example, this snippet:

for (i=0; i<16; i++) {
printf("\n constant GFM_INIT_%02x : bit_vector(255
downto 0)\n := X\"", i);
for (j=31; j>=0; j--) {
gfaddr = i*16 + j/2;
gfresult = 0;
for (k=0; k<8; k++) {
gfbit = 0x80 >> k;
if (j%2 == 1)
gfxor = gfaddr & malpha[7-k];
else
gfxor = gfaddr & malpha6[7-k];
for (l=0; l<8; l++) {
if (gfxor & 1)
gfresult ^= gfbit;
gfxor = gfxor >> 1;
}
}
printf("%02X", gfresult);
}
printf("\";");
}
printf("\n");
}


outputs this:

constant GFM_INIT_00 : bit_vector(255 downto 0)
:= X"1BCE9B8E9C4E1C0E9249120915C995898E470E0709C7898707C0878080400000";
constant GFM_INIT_01 : bit_vector(255 downto 0)
:= X"B65B361B31DBB19B3FDCBF9CB85C381C23D2A392A4522412AA552A152DD5AD95";
....

Then that can be used to initialize a block ROM:

rom_d: RAMB4_S16
generic map(
INIT_00 => GFM_INIT_00,
INIT_01 => GFM_INIT_01,
 

Welcome to EDABoard.com

Sponsor

Back
Top