H
hssig
Guest
Hi,
I have the following integer declaration:
signal test_num : integer := 0555;
Now I want to make a string out of it:
signal test_string : string (1 to 4);
begin
test_string <= integer'image(test_num);
Modelsim complains "Array lengths do not match. Left is 4 (1 to 4).
Right is 3 (1 to 3)."
How can I convert test_num (ranging from 0001 to 9999) to a string
correctly taking into account the leading zeros?
Cheers,
hssig
I have the following integer declaration:
signal test_num : integer := 0555;
Now I want to make a string out of it:
signal test_string : string (1 to 4);
begin
test_string <= integer'image(test_num);
Modelsim complains "Array lengths do not match. Left is 4 (1 to 4).
Right is 3 (1 to 3)."
How can I convert test_num (ranging from 0001 to 9999) to a string
correctly taking into account the leading zeros?
Cheers,
hssig