Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. process(clock)
  2. variable aux,stare,rezultat:integer;
  3. begin
  4. if clock='1' and clock'event then
  5. aux:=aux+1;
  6. if aux<50000 then
  7. semnal<='0';
  8. elsif aux=50000 then
  9. semnal<='1';
  10. aux:=0;
  11. end if;
  12. stare:=stare+1;
  13. if stare>3 then stare:=0; end if;
  14. if stare=0 then
  15. anod0<='1'; anod1<='1'; anod2<='1'; anod3<='0';
  16. rezultat:=primacifra;
  17. if rezultat=0 then ex<="0000001"; elsif
  18. rezultat=1 then ex<="1001111"; elsif
  19. rezultat=2 then ex<="0010010"; elsif
  20. rezultat=3 then ex<="0000110"; elsif
  21. rezultat=4 then ex<="1001100"; elsif
  22. rezultat=5 then ex<="0100100"; elsif
  23. rezultat=6 then ex<="0100000"; elsif
  24. rezultat=7 then ex<="0001111"; elsif
  25. rezultat=8 then ex<="0000000"; elsif
  26. rezultat=9 then ex<="0000100";
  27. end if;
  28. elsif stare=1 then
  29. anod0<='1'; anod1<='1'; anod2<='0'; anod3<='1';
  30. rezultat:=douacifra;
  31. if rezultat=0 then ex<="0000001"; elsif
  32. rezultat=1 then ex<="1001111"; elsif
  33. rezultat=2 then ex<="0010010"; elsif
  34. rezultat=3 then ex<="0000110"; elsif
  35. rezultat=4 then ex<="1001100"; elsif
  36. rezultat=5 then ex<="0100100"; elsif
  37. rezultat=6 then ex<="0100000"; elsif
  38. rezultat=7 then ex<="0001111"; elsif
  39. rezultat=8 then ex<="0000000"; elsif
  40. rezultat=9 then ex<="0000100";
  41. end if;
  42. elsif stare=2 then
  43. anod0<='1'; anod1<='0'; anod2<='1'; anod3<='1';
  44. rezultat:=treiacifra;
  45. if rezultat=0 then ex<="0000001"; elsif
  46. rezultat=1 then ex<="1001111"; elsif
  47. rezultat=2 then ex<="0010010"; elsif
  48. rezultat=3 then ex<="0000110"; elsif
  49. rezultat=4 then ex<="1001100"; elsif
  50. rezultat=5 then ex<="0100100"; elsif
  51. rezultat=6 then ex<="0100000"; elsif
  52. rezultat=7 then ex<="0001111"; elsif
  53. rezultat=8 then ex<="0000000"; elsif
  54. rezultat=9 then ex<="0000100";
  55. end if;
  56.  
  57. elsif stare=3 then
  58. anod0<='0'; anod1<='1'; anod2<='1'; anod3<='1';
  59. rezultat:=patracifra;
  60. if rezultat=0 then ex<="0000001"; elsif
  61. rezultat=1 then ex<="1001111"; elsif
  62. rezultat=2 then ex<="0010010"; elsif
  63. rezultat=3 then ex<="0000110"; elsif
  64. rezultat=4 then ex<="1001100"; elsif
  65. rezultat=5 then ex<="0100100"; elsif
  66. rezultat=6 then ex<="0100000"; elsif
  67. rezultat=7 then ex<="0001111"; elsif
  68. rezultat=8 then ex<="0000000"; elsif
  69. rezultat=9 then ex<="0000100";
  70. end if;
  71. end if;
  72.  
  73. end if;
  74. end process;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement