1
\$\begingroup\$

I have an 8-bit std_logic_vector and I would like to print its value (during simulation) as a 2-digit hexadecimal value.

Current code:

report "Entity: data_in=" & integer'image(to_integer(unsigned(data_in)));

Current output:

Entity: data_in=16

Desired output:

Entity: data_in=10h

What would be the most painless way to achieve this?

asked Oct 18, 2017 at 13:34
\$\endgroup\$
2

1 Answer 1

7
\$\begingroup\$

In VHDL-2008, one can use:

report "Entity: data_in=" & to_hstring(data_in) & "h";
answered Nov 9, 2017 at 16:26
\$\endgroup\$

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.