Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

7 bit in 2 seven segments

$
0
0
hi guys i'm having a bit of a problem trying to figure out how to represent binary numbers up to 99 in 2 seven segments.

i have my decoder code

Code:

library ieee;
use ieee.std_logic_1164.all;
entity Decodificador is
        port(
                bcd: in  std_logic_vector(3 downto 0);
                led: out std_logic_vector(6 downto 0)
                );
        end Decodificador;


architecture rtl of Decodificador is
        begin
process (bcd)
begin
case bcd is
                when "0000" => LED <= "1111110";
                when "0001" => LED <= "1100000";
                when "0010" => LED <= "1011011";
                when "0011" => LED <= "1110011";
                when "0100" => LED <= "1100101";
                when "0101" => LED <= "0110111";
                when "0110" => LED <= "0111111";
                when "0111" => LED <= "1100010";       
                when "1000" => LED <= "1111111";
                when "1001" => LED <= "1110111";
                when others => LED <= "0000000";
                end case;
        end process;
end rtl;

still it will get up to 9, is there any form to represent the numbers up to 99 without having to declare 99 cases?

thank you.

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>