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

Reply

VHDL - Integer to std_logic_vector?

 
Thread Tools Search this Thread
Old 06-30-2005, 12:21 AM   #1
Default Integer to std_logic_vector?


Hi,

i have to count several values from 0 to 99, at the moment i do it in an
array of integer 0 to 99.

As output-port i use a std_logic_vector(6 downto 0), but i may change
this if necessary.

How can i convert the integer to the vector? i have no idea and not
found any solutions yet. Any hint would be helpful

thanks
Sebastian


Sebastian Eggers
  Reply With Quote
Old 06-30-2005, 05:40 AM   #2
Neo
 
Posts: n/a
Default Re: Integer to std_logic_vector?
use the conversion functions in the ieee numeric package or the
std_logic package



Neo
  Reply With Quote
Old 06-30-2005, 09:13 AM   #3
ALuPin@web.de
 
Posts: n/a
Default Re: Integer to std_logic_vector?
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

conv_std_logic_vector(7, 9);

converts integer 7 to a std_logic_vector with 9 bits.

Rgds
André



ALuPin@web.de
  Reply With Quote
Old 06-30-2005, 10:09 AM   #4
Nicolas Matringe
 
Posts: n/a
Default Re: Integer to std_logic_vector?
> use ieee.std_logic_1164.all;
> use ieee.std_logic_arith.all;
>
> conv_std_logic_vector(7, 9);
>
> converts integer 7 to a std_logic_vector with 9 bits.


Nope! Please stop using std_logic_arith package.

use ieee.numeric_std.all

std_logic_vector(to_unsigned(natural_number, nb_bits));

Nico



Nicolas Matringe
  Reply With Quote
Old 11-09-2006, 10:58 PM   #5
Galloth
Junior Member
 
Join Date: Nov 2006
Posts: 1
Default
Why we should stop using std_logic_arith package?


Galloth
Galloth is offline   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
How to convert string contain Hex data into integer asifjavaid Software 0 09-09-2008 08:50 AM
Fast Integer Division In Vhdl Vitrion Hardware 0 11-01-2007 07:33 AM
VHDL help needed TomboT Hardware 2 11-21-2006 05:01 PM
getting integer values from electronic weigh scale through serial port dotnet_smart Software 2 09-17-2006 05:24 AM
getting integer values from electrolnic weigh scale through serial port dotnet_smart Hardware 0 07-28-2006 11:54 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