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. ()
>
|