Re: TYPE CONVERSION

Discussion in 'VHDL' started by Yahoo, Aug 6, 2003.

  1. Yahoo

    Yahoo Guest

    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. ()
    >
    Yahoo, Aug 6, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. luna
    Replies:
    1
    Views:
    6,802
  2. ibiza
    Replies:
    2
    Views:
    5,326
    ibiza
    Jan 27, 2006
  3. Chris
    Replies:
    2
    Views:
    21,320
    Chris
    May 11, 2006
  4. Michal Nazarewicz

    conversion from const type* to type* allowed?

    Michal Nazarewicz, Jan 4, 2007, in forum: C Programming
    Replies:
    13
    Views:
    549
    Eric Sosman
    Jan 5, 2007
  5. Replies:
    1
    Views:
    441
    Sylvester Hesp
    May 16, 2007
Loading...

Share This Page