Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- process(clock)
- variable aux,stare,rezultat:integer;
- begin
- if clock='1' and clock'event then
- aux:=aux+1;
- if aux<50000 then
- semnal<='0';
- elsif aux=50000 then
- semnal<='1';
- aux:=0;
- end if;
- stare:=stare+1;
- if stare>3 then stare:=0; end if;
- if stare=0 then
- anod0<='1'; anod1<='1'; anod2<='1'; anod3<='0';
- rezultat:=primacifra;
- if rezultat=0 then ex<="0000001"; elsif
- rezultat=1 then ex<="1001111"; elsif
- rezultat=2 then ex<="0010010"; elsif
- rezultat=3 then ex<="0000110"; elsif
- rezultat=4 then ex<="1001100"; elsif
- rezultat=5 then ex<="0100100"; elsif
- rezultat=6 then ex<="0100000"; elsif
- rezultat=7 then ex<="0001111"; elsif
- rezultat=8 then ex<="0000000"; elsif
- rezultat=9 then ex<="0000100";
- end if;
- elsif stare=1 then
- anod0<='1'; anod1<='1'; anod2<='0'; anod3<='1';
- rezultat:=douacifra;
- if rezultat=0 then ex<="0000001"; elsif
- rezultat=1 then ex<="1001111"; elsif
- rezultat=2 then ex<="0010010"; elsif
- rezultat=3 then ex<="0000110"; elsif
- rezultat=4 then ex<="1001100"; elsif
- rezultat=5 then ex<="0100100"; elsif
- rezultat=6 then ex<="0100000"; elsif
- rezultat=7 then ex<="0001111"; elsif
- rezultat=8 then ex<="0000000"; elsif
- rezultat=9 then ex<="0000100";
- end if;
- elsif stare=2 then
- anod0<='1'; anod1<='0'; anod2<='1'; anod3<='1';
- rezultat:=treiacifra;
- if rezultat=0 then ex<="0000001"; elsif
- rezultat=1 then ex<="1001111"; elsif
- rezultat=2 then ex<="0010010"; elsif
- rezultat=3 then ex<="0000110"; elsif
- rezultat=4 then ex<="1001100"; elsif
- rezultat=5 then ex<="0100100"; elsif
- rezultat=6 then ex<="0100000"; elsif
- rezultat=7 then ex<="0001111"; elsif
- rezultat=8 then ex<="0000000"; elsif
- rezultat=9 then ex<="0000100";
- end if;
- elsif stare=3 then
- anod0<='0'; anod1<='1'; anod2<='1'; anod3<='1';
- rezultat:=patracifra;
- if rezultat=0 then ex<="0000001"; elsif
- rezultat=1 then ex<="1001111"; elsif
- rezultat=2 then ex<="0010010"; elsif
- rezultat=3 then ex<="0000110"; elsif
- rezultat=4 then ex<="1001100"; elsif
- rezultat=5 then ex<="0100100"; elsif
- rezultat=6 then ex<="0100000"; elsif
- rezultat=7 then ex<="0001111"; elsif
- rezultat=8 then ex<="0000000"; elsif
- rezultat=9 then ex<="0000100";
- end if;
- end if;
- end if;
- end process;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement