I'm writing a sha-256 hash function in VHDL
and it takes in a String
. I need to convert this string to a std_logic_vector
of bits. So, I must somehow extract the bits from the characters of the String
, but I'm not sure of the best way. As far as I can tell there does not exist a built in function to do this in any of the libraries.
Is my only option to loop through each index of the string and use a case
block to map the characters to their respective 8-bit ASCII counterparts? Or is there some way to convert a character to bits?