Advertisement
Guest User

ultima chestie cu moore

a guest
Nov 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. ---------------------------------------------------------------------------------------------------
  2. --
  3. -- Title : abcd
  4. -- Design : one
  5. -- Author : student
  6. -- Company : Upt
  7. --
  8. ---------------------------------------------------------------------------------------------------
  9. --
  10. -- File : abcd.vhd
  11. -- Generated : Mon Nov 20 18:41:57 2017
  12. -- From : interface description file
  13. -- By : Itf2Vhdl ver. 1.20
  14. --
  15. ---------------------------------------------------------------------------------------------------
  16. --
  17. -- Description :
  18. --
  19. ---------------------------------------------------------------------------------------------------
  20.  
  21. --{{ Section below this comment is automatically maintained
  22. -- and may be overwritten
  23. --{entity {abcd} architecture {abcd}}
  24.  
  25. library IEEE;
  26. use IEEE.STD_LOGIC_1164.all;
  27.  
  28. entity abcd is
  29. PORT(
  30. a, b, c, d: in bit;
  31. clock, reset: in bit;
  32. x: out bit
  33. );
  34. end abcd;
  35.  
  36. --}} End of automatically maintained section
  37.  
  38. architecture abcd of abcd is
  39. type state is (Sa, Sb, Sc);
  40. signal pr_state, nx_state: state;
  41. begin
  42. process (reset, clock)
  43. begin
  44. if (reset='1') then
  45. pr_state <= Sa;
  46. elsif (clock'EVENT AND clock='1') then
  47. pr_state <= nx_state;
  48. end if;
  49. end process;
  50. process(d, pr_state)
  51. begin
  52. case pr_state is
  53. when Sa => x <= a;
  54. if(d = '1') then
  55. nx_state <= Sb;
  56. end if;
  57. when Sb => x <= b;
  58. if(d = '0') then
  59. nx_state <= Sc;
  60. end if;
  61. when Sc => x <= c;
  62. if(d = '1') then
  63. nx_state <= Sa;
  64. end if;
  65. end case;
  66. end process;
  67. end abcd;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement