Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > What does this do ?

Reply
Thread Tools

What does this do ?

 
 
iqbalmuh@hotmail.co.uk
Guest
Posts: n/a
 
      01-04-2008
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.

Thanks
 
Reply With Quote
 
 
 
 
KJ
Guest
Posts: n/a
 
      01-04-2008

>
> -- **** 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.
>

conv_integer returns an integer value...that is the "number value is
being specified to key into the array."

KJ
 
Reply With Quote
 
 
 
 
iqbalmuh@hotmail.co.uk
Guest
Posts: n/a
 
      01-04-2008
On Jan 4, 2:05*pm, KJ <(E-Mail Removed)> wrote:
> > -- **** 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.

>
> conv_integer returns an integer value...that is the "number value is
> being specified to key into the array."
>
> KJ


Yes but what IS the number value ?

That's the bit I don't understand ie. what is the value of 'std' which
is being converted by 'conv_integer ?
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      01-04-2008
On Jan 4, 8:10 am, (E-Mail Removed) wrote:
> On Jan 4, 2:05 pm, KJ <(E-Mail Removed)> wrote:
>
> > > -- **** 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.

>
> > conv_integer returns an integer value...that is the "number value is
> > being specified to key into the array."

>
> > KJ

>
> Yes but what IS the number value ?
>
> That's the bit I don't understand ie. what is the value of 'std' which
> is being converted by 'conv_integer ?


From the context "std" is a std_logic_vector whose contents are being
transformed into an integer to index the array. Where does "std" come
from? It is not shown elsewhere in the code you posted, so how are we
to know?.

Andy
 
Reply With Quote
 
Xin Xiao
Guest
Posts: n/a
 
      01-04-2008
hi

you have not declared "std", that's the problem. it should be a
std_logic_vector and it will be converted to integer.

hth,

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On Jan 4, 2:05 pm, KJ <(E-Mail Removed)> wrote:
> > -- **** 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.

>
> conv_integer returns an integer value...that is the "number value is
> being specified to key into the array."
>
> KJ


Yes but what IS the number value ?

That's the bit I don't understand ie. what is the value of 'std' which
is being converted by 'conv_integer ?

 
Reply With Quote
 
Symon
Guest
Posts: n/a
 
      01-04-2008
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>Yes but what IS the number value ?


I guess 3. But you could simulate it and find out...

HTH, Syms.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET 2.0 ASPx Page does not load, but HTM does prabhupr@hotmail.com ASP .Net 1 02-08-2006 12:57 PM
Button OnClick does not fire on first postback, but does on second Janet Collins ASP .Net 0 01-13-2006 10:08 PM
Does the 2.0 Framework come out when Visual Studio .NET 2005 does? needin4mation@gmail.com ASP .Net 3 10-07-2005 12:55 AM
CS0234 Global does not exist ... but it genuinely does Bill Johnson ASP .Net 0 07-08-2005 06:34 PM
Does no one else think microsoft does a poor job? =?Utf-8?B?SmVyZW15IEx1bmRncmVu?= Wireless Networking 2 11-20-2004 12:17 AM



Advertisments