Google Groups Home
Help | Sign in
quick question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
FPGA  
View profile
 More options Mar 28, 2:14 pm
Newsgroups: comp.arch.fpga, comp.lang.vhdl
From: FPGA <FPGA.unkn...@gmail.com>
Date: Fri, 28 Mar 2008 11:14:23 -0700 (PDT)
Local: Fri, Mar 28 2008 2:14 pm
Subject: quick question
what does the following code do
output <= input[x*(y)-1 -: y];

I dont understand -: . What is this. I have seen [x:y], never came
across[x -: y]

Please help


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mk  
View profile
 More options Mar 28, 2:33 pm
Newsgroups: comp.arch.fpga, comp.lang.vhdl
From: mk <kal*@dspia.*comdelete>
Date: Fri, 28 Mar 2008 18:33:10 GMT
Local: Fri, Mar 28 2008 2:33 pm
Subject: Re: quick question
On Fri, 28 Mar 2008 11:14:23 -0700 (PDT), FPGA

<FPGA.unkn...@gmail.com> wrote:
>what does the following code do
>output <= input[x*(y)-1 -: y];

That's called an indexed part select. The first expression signifies
base and the second expression signifies width. It the sign is + it's
an ascending select if it's negative it's a descending select. Your
example is equivalent to input[x*(y)-1: x*(y)-y] ie you need to
subtract (y-1) from the base to get the lower index.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin Neilson  
View profile
 More options Mar 28, 4:24 pm
Newsgroups: comp.arch.fpga, comp.lang.vhdl
From: Kevin Neilson <kevin_neil...@removethiscomcast.net>
Date: Fri, 28 Mar 2008 14:24:24 -0600
Local: Fri, Mar 28 2008 4:24 pm
Subject: Re: quick question

mk wrote:
> On Fri, 28 Mar 2008 11:14:23 -0700 (PDT), FPGA
> <FPGA.unkn...@gmail.com> wrote:

>> what does the following code do
>> output <= input[x*(y)-1 -: y];

> That's called an indexed part select. The first expression signifies
> base and the second expression signifies width. It the sign is + it's
> an ascending select if it's negative it's a descending select. Your
> example is equivalent to input[x*(y)-1: x*(y)-y] ie you need to
> subtract (y-1) from the base to get the lower index.

I think your equivalent should be:  input[x*(y)-1: x*(y)-y+1]

If I remember correctly, the width has to be a constant.  In this case
that would mean y could be a parameter, but not an integer or register.
-Kevin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John_H  
View profile
 More options Mar 29, 12:18 am
Newsgroups: comp.arch.fpga
From: John_H <newsgr...@johnhandwork.com>
Date: Fri, 28 Mar 2008 21:18:44 -0700
Local: Sat, Mar 29 2008 12:18 am
Subject: Re: quick question

The y that follows the indexed part select operator is the width.  The
vector mk showed has a width of y bits which is accurate.  The vector
Kevin showed has a width of y-1 bits which is inaccurate.  Use mk's
suggestion.

Oh, and invest in a Verilog-2001 reference.

Also - I removed the cross-post to comp.lang.vhdl because this is
VERILOG!  The VHDL abbreviations doesn't mean "Verilog Hardware
Description Language."  You can go to comp.lang.verilog for Verilog issues.

- John_H


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FPGA  
View profile
 More options Mar 31, 12:23 pm
Newsgroups: comp.arch.fpga
From: FPGA <FPGA.unkn...@gmail.com>
Date: Mon, 31 Mar 2008 09:23:00 -0700 (PDT)
Subject: Re: quick question
On Mar 29, 12:18 am, John_H <newsgr...@johnhandwork.com> wrote:

Thanks always for your valuable help.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google