regarding look up table

Discussion in 'VHDL' started by onkarkk@gmail.com, Jan 8, 2006.

  1. 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
     
    , Jan 8, 2006
    #1
    1. Advertising

  2. Guest

    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
     
    , Jan 10, 2006
    #2
    1. Advertising

  3. Duane Clark Guest

    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,
     
    Duane Clark, Jan 10, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Serial # 19781010
    Replies:
    1
    Views:
    512
    William Tasso
    Aug 10, 2003
  2. Replies:
    10
    Views:
    794
    dorayme
    Nov 19, 2005
  3. inhahe
    Replies:
    3
    Views:
    2,369
    Diez B. Roggisch
    Jan 28, 2005
  4. vitay
    Replies:
    8
    Views:
    551
    Stan McCann
    Nov 9, 2006
  5. Replies:
    4
    Views:
    176
Loading...

Share This Page