Sete Sgementos

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity SETE_SEGMENTOS is
Port (
i_NUMERO0 : in
STD_LOGIC_VECTOR(3 DOWNTO 0);
i_NUMERO1 : in
STD_LOGIC_VECTOR(3 DOWNTO 0);
i_RST : in STD_LOGIC;
o_DISPLAY0 : out STD_LOGIC_VECTOR(6 DOWNTO 0);
o_DISPLAY1 : out STD_LOGIC_VECTOR(6 DOWNTO 0)
);
end SETE_SEGMENTOS;

architecture Behavioral of SETE_SEGMENTOS is

signal w_ON : std_logic := '0';


--constant w_ON : std_logic := '0';
signal w_OFF : std_logic := '1';

begin

process(i_RST, w_ON, w_OFF)


begin
if (i_RST = '1') then
o_DISPLAY0 <= (others => w_OFF);
o_DISPLAY1 <= (others => w_OFF);
else
case i_NUMERO0 is
when X"0" =>
o_DISPLAY0(0) <= w_ON;
o_DISPLAY0(1) <= w_ON;
o_DISPLAY0(2) <= w_ON;
o_DISPLAY0(3) <= w_ON;
o_DISPLAY0(4) <= w_ON;
o_DISPLAY0(5) <= w_ON;
o_DISPLAY0(6) <= w_OFF;
when X"1" =>
o_DISPLAY0(0) <= w_OFF;
o_DISPLAY0(1) <= w_ON;
o_DISPLAY0(2) <= w_ON;
o_DISPLAY0(3) <= w_OFF;
o_DISPLAY0(4) <= w_OFF;
o_DISPLAY0(5) <= w_OFF;
o_DISPLAY0(6) <= w_OFF;
when X"2" =>
o_DISPLAY0(0) <= w_ON;
o_DISPLAY0(1) <= w_ON;
o_DISPLAY0(2) <= w_OFF;
o_DISPLAY0(3) <= w_ON;
o_DISPLAY0(4) <= w_ON;
o_DISPLAY0(5) <= w_OFF;
o_DISPLAY0(6) <= w_ON;
when X"3" =>
o_DISPLAY0(0) <= w_ON;
o_DISPLAY0(1) <= w_ON;
o_DISPLAY0(2) <= w_ON;
o_DISPLAY0(3) <= w_ON;
o_DISPLAY0(4) <= w_OFF;
o_DISPLAY0(5) <= w_OFF;
o_DISPLAY0(6) <= w_ON;
when X"4" =>
o_DISPLAY0(0) <= w_OFF;
o_DISPLAY0(1) <= w_ON;
o_DISPLAY0(2) <= w_ON;
o_DISPLAY0(3) <= w_OFF;
o_DISPLAY0(4) <= w_OFF;
o_DISPLAY0(5) <= w_ON;
o_DISPLAY0(6) <= w_ON;
when others => null;
end case;
case i_NUMERO1 is
when X"0" =>
o_DISPLAY1(0) <= w_ON;
o_DISPLAY1(1) <= w_ON;
o_DISPLAY1(2) <= w_ON;
o_DISPLAY1(3) <= w_ON;
o_DISPLAY1(4) <= w_ON;
o_DISPLAY1(5) <= w_ON;
o_DISPLAY1(6) <= w_OFF;
when X"1" =>
o_DISPLAY1(0) <= w_OFF;
o_DISPLAY1(1) <= w_ON;
o_DISPLAY1(2) <= w_ON;
o_DISPLAY1(3) <= w_OFF;
o_DISPLAY1(4) <= w_OFF;
o_DISPLAY1(5) <= w_OFF;
o_DISPLAY1(6) <= w_OFF;
when X"2" =>
o_DISPLAY1(0) <= w_ON;
o_DISPLAY1(1) <= w_ON;
o_DISPLAY1(2) <= w_OFF;
o_DISPLAY1(3) <= w_ON;
o_DISPLAY1(4) <= w_ON;
o_DISPLAY1(5) <= w_OFF;
o_DISPLAY1(6) <= w_ON;
when X"3" =>
o_DISPLAY1(0) <= w_ON;
o_DISPLAY1(1) <= w_ON;
o_DISPLAY1(2) <= w_ON;
o_DISPLAY1(3) <= w_ON;
o_DISPLAY1(4) <= w_OFF;
o_DISPLAY1(5) <= w_OFF;
o_DISPLAY1(6) <= w_ON;
when X"4" =>
o_DISPLAY1(0) <= w_OFF;
o_DISPLAY1(1) <= w_ON;
o_DISPLAY1(2) <= w_ON;
o_DISPLAY1(3) <= w_OFF;
o_DISPLAY1(4) <= w_OFF;
o_DISPLAY1(5) <= w_ON;
o_DISPLAY1(6) <= w_ON;
when others => null;
end case;
end if;
end process;

end Behavioral;

You might also like