I have written some code (or rather copied some from the internet) to drive a single 7-Segment LCD display. This can display numbers in the range; [0, 9], or if in base 16; [0, F].
I have 4 such displays and I wish to convert an integer into 4 integers, such that the expected numbers will appear on the display.
For example; the number 8765 requires conversion into the 4 integers: 8, 7, 6, 5.
If I was doing this in C or other similar programming language, then I would use divisions and truncations to complete the conversion. However I am less familiar with VHDL, and so I don't know how to proceed.
How would I go about writing VHDL code to do this?
EDIT:
Currently I have something like this:
variable number: integer; -- This is set to the 4 digit value to be displayed
variable d0: integer; -- Least significant digit (units)
variable d1: integer;
variable d2: integer;
variable d3: integer; -- Most significant digit (thousands)
All these are (should be) in base 10, not 16.