Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
VHDL
String to std_logic_vector
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="KJ, post: 3556114"] Since your input string has some non-numeric characters in it that you presumably want to keep in the string, then the best approach would be to simply write a function that parses the string however you'd like. Below is an example that simply adds the 'value' of each input character to produce an integer output. You should be able to easily modify this to select out whichever characters you want and perform whatever calculations you'd like. function Version_String_To_integer(Some_String: STRING) return integer is variable Return_Value: integer := 0; begin for i in Some_String'range loop Some_Char := Some_String(i) case Some_Char is when "0" => Return_Value := Return_Value + 0; when "1" => Return_Value := Return_Value + 1; ... when others => null; end case; end loop; return(Return_Value); end function Version_String_To_integer; KJ [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
VHDL
String to std_logic_vector
Top