Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- ok now i understand how the 7 segment display work. I try some test like sum HEX0 <= "0000000" + "1" and i saw that the result is not 1 :) --- Quote End --- Right, because the 7-segment display is just a bunch of LEDs. If you want those LEDs to "mean" numbers, then you have to decode the number, i.e., HEX0 <= decode(number); You could have your code written like this using a function call, or using a hex_display component as shown in the example you downloaded. --- Quote Start --- For sum two number into 7 segment display, i must use also clock? --- Quote End --- No, but its generally useful to use a clock. In the case of your "tests" just output to the hex display the switch settings or the key settings
u4: hex_display
port map(
hex => hex_data_d,
display => hex_d
);
-- Drive with the switches
hex_data_d <= sw(3 downto 0);
-- Drive with the push buttons
-- hex_data_d <= key(3 downto 0);
Cheers, Dave