Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Re: TYPE CONVERSION

Reply
Thread Tools

Re: TYPE CONVERSION

 
 
Yahoo
Guest
Posts: n/a
 
      08-06-2003
I copied these lines from some other postings. Search this group for
" Type conversion with characters "

int_x <= CHARACTER'POS(char_a);
char_a <= CHARACTER'VAL(int_x);


use ieee.numeric_std.all;
....
slv_vec <= STD_LOGIC_VECTOR(TO_UNSIGNED(CHARACTER'POS(char_a) , Nbits));

where Nbits is the number of bits slv_vec'LENGTH.

Good luck,
Troy


Sunday wrote:
>
> Hi all,
>
> I've some problems with type conversion :
>
> How convert a character into a std_logic_vector (7 downto 0) ? (I've
> tried std_logic_vector(value) and to_stdlogicvector(value) but these are
> not clodely related types and it's don't work ...)
>
> And ... how to do the inverse, a std_logic_vector (7 downto 0) into a
> character ?
>
>
> Thanks for your help.
>
> Stéphane. ((E-Mail Removed))
>


 
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
Type conversion function for user defined type... zaeminkr@gmail.com C++ 1 05-16-2007 09:00 AM
conversion from const type* to type* allowed? Michal Nazarewicz C Programming 13 01-05-2007 01:54 PM
Conversion from type 'DBNull' to type 'String' is not valid Chris ASP .Net 2 05-11-2006 08:20 AM
conversion from type 'DBNull' to type 'float' is not valid ibiza ASP .Net 2 01-27-2006 09:57 PM
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. luna ASP .Net 1 02-13-2004 01:15 PM



Advertisments