What does this do ?

Jan 04, 2008 2 Replies

Hi,



Can anyone tell me what this bit of code is doing ?


-- declarations



------------------------------------------------------------------------------------------- signal phase : std_logic_vector(6 downto 0);



type INTEGER_ARRAY is array ( natural range ) of integer;



constant NUMERATOR : INTEGER_ARRAY(7 downto 0) := (7,30,7,7, 30, 30,



30,30);

variable phase_next : std_logic_vector(6 downto 0);



--------------------------------------------------------------------------------------------


-- **** problem code **********



phase_next := phase + NUMERATOR(conv_integer(std));



Obviously the conv_integer(std) part of the code is being used to access the array NUMERATOR but I don't understand exactly how since no number value is being specified to key into the array ie. what is the value of 'std' that is being converted to an integer by the function 'conv_integer' ?



Thanks


snipped-for-privacy@hotmail.co.uk schrieb:

-------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

Hi, just two guesses:

1.) there's a port named std in the entity. 2.) your code snippet is just wrong in that line (copy & paste error or uncompleted template)

Have a nice synthesis Eilert

Hi,

The "std" can also be a constant defined somewhere in the design file or in "a package", also be careful about it too.

Regards,

Enes

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required