Вы находитесь на странице: 1из 3

--CLOCK_MAIN: in std_logic;

--SEL: out std_logic_vector(2 downto 0);


--signal cent,dec,uni: std_logic_vector(3 downto 0);
--variable tmp: std_logic_vector(11 downto 0);
--variable entero: integer;

--MUPLEX: process(CLOCK_MAIN)
--begin
--if (CLOCK_MAIN'event and CLOCK_MAIN='1') then
-case display is
-when 0 =>F<=cent;SEL<="011";
-when 1 =>F<=dec; SEL<="101";
-when 2 =>F<=uni; SEL<="110";
-when others =>F<="0000";SEL<="111";
-end case;
--if (display<2) then
-display<=display+1;
-else
-display<=0;
-end if;
--end if;
---end process MUPLEX;

--------------------------------------------entero:=conv_integer(DX);
if (entero<10) then
tmp:=DX+"000000000000";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=DX(3 downto 0);
elsif ((entero>9)and(entero<20)) then
tmp:=DX+"000000000110";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=20)and(entero<30)) then
tmp:=DX+"000000001100";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=30)and(entero<40)) then
tmp:=DX+"000000010010";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=40)and(entero<50)) then
tmp:=DX+"000000011000";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);

uni<=tmp(3 downto 0);


((entero>=50)and(entero<60)) then
tmp:=DX+"000000011110";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=60)and(entero<70)) then
tmp:=DX+"000000100100";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=70)and(entero<80)) then
tmp:=DX+"000000101010";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=80)and(entero<90)) then
tmp:=DX+"000000110000";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=90)and(entero<100)) then
tmp:=DX+"000000110110";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
-----------------------------------------------------------elsif ((entero>=100)and(entero<110)) then
tmp:=DX+"000010011100";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=110)and(entero<120)) then
tmp:=DX+"000010100010";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=120)and(entero<130)) then
tmp:=DX+"000010101000";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=130)and(entero<140)) then
tmp:=DX+"000010101110";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=140)and(entero<150)) then
tmp:=DX+"000010110100";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=150)and(entero<160)) then
tmp:=DX+"000010111010";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=160)and(entero<170)) then
tmp:=DX+"000011000000";
cent<=tmp(11 downto 8);
elsif

dec<=tmp(7 downto 4);


uni<=tmp(3 downto 0);
elsif ((entero>=170)and(entero<180)) then
tmp:=DX+"000011000110";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=180)and(entero<190)) then
tmp:=DX+"000011001100";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=190)and(entero<200)) then
tmp:=DX+"000011010010";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
-----------------------------------------------------elsif ((entero>=200)and(entero<210)) then
tmp:=DX+"000100111000";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=210)and(entero<220)) then
tmp:=DX+"000100111110";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
elsif ((entero>=220)and(entero<230)) then
tmp:=DX+"000101000100";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
else
tmp:="000000000000";
cent<=tmp(11 downto 8);
dec<=tmp(7 downto 4);
uni<=tmp(3 downto 0);
end if;

Вам также может понравиться