Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - RANGE attribute use

 
Thread Tools Search this Thread
Old 09-01-2007, 11:22 PM   #1
Default RANGE attribute use


The newbie is back!

Why can't I do this:

type table_array IS ARRAY (0 to 16) of STD_LOGIC_VECTOR(11 downto 0);
signal table: table_array;
....

FOR i in 1 to table'RANGE loop
....


Shannon



Shannon
  Reply With Quote
Old 09-02-2007, 01:15 AM   #2
KJ
 
Posts: n/a
Default Re: RANGE attribute use

"Shannon" <> wrote in message
news: ups.com...
> The newbie is back!
>
> Why can't I do this:
>
> type table_array IS ARRAY (0 to 16) of STD_LOGIC_VECTOR(11 downto 0);
> signal table: table_array;
> ...
>
> FOR i in 1 to table'RANGE loop
> ...

Because the correct syntax is...
FOR i in table'RANGE loop
KJ




KJ
  Reply With Quote
Old 09-02-2007, 03:36 AM   #3
Shannon
 
Posts: n/a
Default Re: RANGE attribute use
On Sep 1, 5:15 pm, "KJ" <kkjenni...@sbcglobal.net> wrote:
> "Shannon" <sgo...@sbcglobal.net> wrote in message
>
> news: ups.com...> The newbie is back!
>
> > Why can't I do this:

>
> > type table_array IS ARRAY (0 to 16) of STD_LOGIC_VECTOR(11 downto 0);
> > signal table: table_array;
> > ...

>
> > FOR i in 1 to table'RANGE loop
> > ...

>
> Because the correct syntax is...
> FOR i in table'RANGE loop
> KJ


Almost.

An allowed syntax is:

FOR i in 1 to 10 Loop

Correct?

if table'range = 10 then why couldn't I say

FOR i in 1 to table'range Loop

?



Shannon
  Reply With Quote
Old 09-02-2007, 05:05 AM   #4
Allan Herriman
 
Posts: n/a
Default Re: RANGE attribute use
On Sun, 02 Sep 2007 02:36:33 -0000, Shannon <>
wrote:

>On Sep 1, 5:15 pm, "KJ" <kkjenni...@sbcglobal.net> wrote:
>> "Shannon" <sgo...@sbcglobal.net> wrote in message
>>
>> news: ups.com...> The newbie is back!
>>
>> > Why can't I do this:

>>
>> > type table_array IS ARRAY (0 to 16) of STD_LOGIC_VECTOR(11 downto 0);
>> > signal table: table_array;
>> > ...

>>
>> > FOR i in 1 to table'RANGE loop
>> > ...

>>
>> Because the correct syntax is...
>> FOR i in table'RANGE loop
>> KJ

>
>Almost.
>
>An allowed syntax is:
>
>FOR i in 1 to 10 Loop
>
>Correct?


Good so far.

>if table'range = 10 then why couldn't I say


No. table'range isn't "10". It is a range 1 to 10. It includes both
the left and right limits, and the direction (to or downto).

Regards,
Allan


Allan Herriman
  Reply With Quote
Old 09-02-2007, 05:18 AM   #5
Shannon
 
Posts: n/a
Default Re: RANGE attribute use
On Sep 1, 9:05 pm, Allan Herriman <allanherri...@hotmail.com> wrote:
> On Sun, 02 Sep 2007 02:36:33 -0000, Shannon <sgo...@sbcglobal.net>
> wrote:
>
>
>
> >On Sep 1, 5:15 pm, "KJ" <kkjenni...@sbcglobal.net> wrote:
> >> "Shannon" <sgo...@sbcglobal.net> wrote in message

>
> >>news: roups.com...> The newbie is back!

>
> >> > Why can't I do this:

>
> >> > type table_array IS ARRAY (0 to 16) of STD_LOGIC_VECTOR(11 downto 0);
> >> > signal table: table_array;
> >> > ...

>
> >> > FOR i in 1 to table'RANGE loop
> >> > ...

>
> >> Because the correct syntax is...
> >> FOR i in table'RANGE loop
> >> KJ

>
> >Almost.

>
> >An allowed syntax is:

>
> >FOR i in 1 to 10 Loop

>
> >Correct?

>
> Good so far.
>
> >if table'range = 10 then why couldn't I say

>
> No. table'range isn't "10". It is a range 1 to 10. It includes both
> the left and right limits, and the direction (to or downto).
>
> Regards,
> Allan


Darn! You were too fast for me Allan. I feel so dumb. I thought
RANGE meant "max". I'll just use 'right or 'high. duh...I feel
silly. In my defense I'm trying to code and take care of my two year
old and 11 month old kids at the same time...It has an effect on your
concentration.

Shannon



Shannon
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using session attribute in tomcat rg_yazdani Software 2 11-11-2008 12:39 PM
Dynamically added TreeNode Control not render my custom attribute venkyzealous Software 0 05-10-2008 03:46 PM
<customErrors> tag should have its "mode" attribute set to "Off". jasari Software 4 04-04-2007 08:31 AM
Open Range DVD Review @ GENRE ONLINE.NET! Writer R5 DVD Video 0 02-07-2004 03:55 AM
TheDigitalReview: OPEN RANGE - DVD REVIEW Mike McGee DVD Video 0 02-07-2004 12:30 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46