Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > newbie vhdl question on variable length of '1'

Reply
Thread Tools

newbie vhdl question on variable length of '1'

 
 
Carson
Guest
Posts: n/a
 
      10-02-2005
hi

is there a way (or function) in vhdl such that I can specify a
variable length of '1' easily?

Thanks,

Carson

 
Reply With Quote
 
 
 
 
john Doef
Guest
Posts: n/a
 
      10-03-2005

Carson a écrit :

> hi
>
> is there a way (or function) in vhdl such that I can specify a
> variable length of '1' easily?

Hello,

your question is really confusing.
What do you mean by 'specify a variable length' ?
What do you mean by '1' ? The number one or a bit '1' ?

In VHDL, you must declare variables with their type.
eg:
variable v1 : std_logic; -- a variable containing one bit
variable v8 : std_logic_vector (7 downto 0); -- a variable
containing 8 bits.

JD.

 
Reply With Quote
 
 
 
 
Mark McDougall
Guest
Posts: n/a
 
      10-04-2005
Carson wrote:

> is there a way (or function) in vhdl such that I can specify a
> variable length of '1' easily?


Do you mean "0000...00001" ?

std_logic_vector(conv_unsigned(1,N))

or "1111....1111"?

std_logic_vector(conv_signed(-1,N))

Regards,
Mark
 
Reply With Quote
 
Carson
Guest
Posts: n/a
 
      10-04-2005
Hi Mark,

it works! Thanks!

Carson

 
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
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
BPSK on VHDL (warning - VHDL newbie) pygmalion VHDL 6 06-23-2006 07:30 PM
Newbie Help: How do I deal with variable length vectors? roninn@gmail.com VHDL 5 03-28-2005 12:33 PM
newbie-question: container for a "string" of variable length merman C Programming 12 10-19-2004 08:21 AM
How to get length of string? length() problems Mitchua Perl 5 07-17-2003 12:08 AM



Advertisments