4
\$\begingroup\$

I want to move data from a "Bit_vector" to "Std_logic_Vector". For that, I want to convert Bit_Vector into Std_Logic_Vector. Please help me for the same.

asked Jan 20, 2015 at 5:25
\$\endgroup\$
4
  • \$\begingroup\$ Is Electrical Engineering the right place to ask simple type conversion questions, which could be answered by a beginners text book or e-book on VHDL? \$\endgroup\$ Commented Jan 20, 2015 at 7:33
  • \$\begingroup\$ I tried text book, then Google. then only I tried here. May be for you it will be simple. But for me its big. May be my IQ is below average. @Paebbels \$\endgroup\$ Commented Jan 20, 2015 at 16:20
  • \$\begingroup\$ Every basic VHDL book should cover the topic of type conversions. Thats no question of programing skills or 'IQ'. \$\endgroup\$ Commented Jan 20, 2015 at 20:13
  • 1
    \$\begingroup\$ The Supplemental Material download contains the source for all the standard packages. In package std_logic_1164 you'll find the declaration function To_StdLogicVector (b : BIT_VECTOR) return STD_LOGIC_VECTOR;. Searching these package sources make a great authoritative alternative to a second hand answer when trying to learn how things work. Interogative google searches (how to convert bit_vector to std_logic_vector in vhdl) usually point you to an answer, likely where Sarrk found it in this case. \$\endgroup\$ Commented Jan 20, 2015 at 21:37

1 Answer 1

9
\$\begingroup\$

Try Srinivasan Venkataramanan's solution

Use IEEE.STD_LOGIC_1164 package's function To_StdLogicVector to do this:

FUNCTION To_StdLogicVector ( b : BIT_VECTOR ) RETURN std_logic_vector;

answered Jan 20, 2015 at 5:37
\$\endgroup\$
2
  • 1
    \$\begingroup\$ I tried its working... To make it simple S<=to_stdlogicvector(b); \$\endgroup\$ Commented Jan 20, 2015 at 5:58
  • \$\begingroup\$ It's not so much Srini's solution as it is knowledge of the package std_logic_1164. See the Supplemental Material download for IEEE Std 1076-2008. The package sources can be searched and you can learn how things work in VHDL from them. \$\endgroup\$ Commented Jan 20, 2015 at 21:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.