Help Please

Discussion in 'VHDL' started by jpaulobenevides, Jun 25, 2009.

  1. jpaulobenevides

    jpaulobenevides

    Joined:
    Jun 25, 2009
    Messages:
    2
    Hi, i'm working on a algorithm that will do Run-Length data compression. This is what i'm doing: i initialize a matrix and tranform it in a vector and, while doing that, i discover what will be the size of the compressed new vector. Then i try to declare another vector with that size.

    Look a small abstract of the algorithm:
    PROCESS

    TYPE line IS ARRAY (0 TO 3) OF INTEGER;
    TYPE matrix IS ARRAY (0 TO 3) OF linha;
    variable mat : matrix;

    BEGIN

    mat := ( (100, 99, 95, 94),
    ( 98, 96, 93, 0),
    ( 97, 92, 0, 0),
    ( 91, 0, 0, 0));

    -- THIS IS WHERE THE VECTOR (100, 99,98,97,96,95,94,93,92,91,0,0,0,0,0,0) IS CREATED AND VECTOR_SIZE IS FOUND OUT.


    PROCESS
    TYPE comp IS ARRAY (0 TO VECTOR_SIZE) OF INTEGER;

    variable COMPRESSED_VECTOR : comp;

    -- THIS IS WHERE THE VECTOR IS USED TO CREATE THE COMPRESSED VECTOR. THE PROBLEM IS QUARTUS WON'T LET ME CREATE AN ARRAY USING A VARIABLE (0 TO VECTOR_SIZE), IT NEED TO BE A CONSTANT.

    VECTOR_SIZE IS A SHARED VARIABLE AND I WAS THINKING ABOUT CONVERTING IT TO A CONSTANT, IF THAT'S POSSIBLE
     
    jpaulobenevides, Jun 25, 2009
    #1
    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. JC
    Replies:
    4
    Views:
    7,978
    Jeff C
    Jul 8, 2004
  2. casioculture@gmail.com
    Replies:
    4
    Views:
    521
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    595
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Replies:
    7
    Views:
    1,766
    Mike Hewson
    Jan 7, 2005
  5. mera
    Replies:
    7
    Views:
    1,113
Loading...

Share This Page