newbie vhdl question on variable length of '1'

C

Carson

hi

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

Thanks,

Carson
 
J

john Doef

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

Mark McDougall

Carson said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top