I'm having some trouble assigning constant hex values to vectors of a smaller size. In my current project, I am using a FPGA to receive 7-bit ASCII characters from a terminal emulator application on a PC. I need to compare and assign 7-bit logic vectors with hard coded values that are most easily read as two digit hex, e.g. 0x0D.
In VHDL, I want to make this sort of assignment or compare:
signal AsciiChar : std_logic_vector(6 downto 0) := x"0D";
....
if (AsciiChar = x"0D") then ...
But assigning or comparing an 8-bit value with a 7-bit vector gives me mis-match errors.
For anyone familiar with Verilog, this operation is trivial,
CR = 7'h0D;
but VHDL doesn't seem to easily offer the same sort of function for the case of assigning a truncated hex value. Does anyone know of some easy way to do this?
By the way, I found the function named "align_size" in the "std_logic_arith" package that seems like should work, but Quartus keeps giving me an error that the function isn't defined, even though I have the std_logic_arith package declared.
