Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.06 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.std_logic_arith.all;
  4.  
  5. entity secuencia is
  6. port (clk: in std_logic;
  7.      Q2, Q1, Q0: inout std_logic);
  8. end secuencia;
  9.  
  10. architecture secuencia_dig of secuencia is
  11. type estados is (d0, d1, d2, d3, d4, d5, d6);
  12. signal e_pst, e_fto: estados;
  13.     begin
  14.     procece1: process (e_pst, Q2, Q1, Q0) begin
  15.         case e_pst is
  16.             when d0 =>  Q2<='0';
  17.                             Q1<='1';
  18.                             Q0<='0';
  19.                             e_fto <= d1;
  20.             when d1=>   Q2<='0';
  21.                             Q1<='0';
  22.                             Q0<='0';
  23.                             e_fto <= d2;
  24.             when d2=>   Q2<='0';
  25.                             Q1<='0';
  26.                             Q0<='1';
  27.                             e_fto <= d3;
  28.             when d3=>   Q2<='0';
  29.                             Q1<='1';
  30.                             Q0<='1';
  31.                             e_fto <= d4;
  32.             when d4=>   Q2<='1';
  33.                             Q1<='1';
  34.                             Q0<='0';
  35.                             e_fto <= d5;
  36.             when d5=>   Q2<='1';
  37.                             Q1<='0';
  38.                             Q0<='0';
  39.                             e_fto <= d6;
  40.             when d6=>   Q2<='1';
  41.                             Q1<='1';
  42.                             Q0<='1';
  43.                             e_fto <= d0;
  44.         end case;
  45.     end process procece1;
  46.    
  47.     proceso2: process(clk) begin
  48.     if(clk'event and clk ='1') then
  49.     e_pst <= e_fto;
  50.     end if;
  51.     end process;
  52.     end secuencia_dig;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement