1 | entity IDG is
|
2 | port( CLK, RESET, ENABLE : in bit; -- sekundäre Eingangssignale
|
3 | PHI :in bit_vector(1 downto 0); -- Eingangsvektor
|
4 | A :out bit_vector(1 downto 0) ); -- Ausgangsvektor
|
5 | end IDG;
|
6 |
|
7 | architecture SEQUENZ of IDG is
|
8 | type ZUSTAENDE is (V00, V00I, V10, V10I, V11, V11I, V01, V01I, R01, R01I, R00, R00I, R10, R10I, R11, R11I, Fehler); -- Aufzählungstyp
|
9 | signal ZUSTAND,FOLGE_Z: ZUSTAENDE ; -- Prozess-Kommunikation
|
10 | begin
|
11 |
|
12 | Z_SPEICHER: process(CLK, RESET) -- Zustandsaktualisierung
|
13 | begin
|
14 | if RESET = '1' then ZUSTAND <= V10 after 20 ns;
|
15 | elsif CLK = '1' and CLK'event then
|
16 | if ENABLE = '1' then ZUSTAND <= FOLGE_Z after 20 ns;
|
17 | end if;
|
18 | end if;
|
19 | end process Z_SPEICHER;
|
20 |
|
21 | UE_SN: process(PHI, ZUSTAND) -- Folgezustandsberechnung
|
22 | begin
|
23 |
|
24 | case ZUSTAND is
|
25 | when V00 => if PHI = "10" then FOLGE_Z <= V10I;
|
26 | else if PHI = "01" then FOLGE_Z <= R01I;
|
27 | else if PHI = "00" then FOLGE_Z <= V00;
|
28 | else if PHI = "11" then FOLGE_Z <= Fehler;
|
29 | end if;
|
30 | when V10 => if PHI = "10" then FOLGE_Z <= V10;
|
31 | else if PHI = "01" then FOLGE_Z <= Fehler;
|
32 | else if PHI = "00" then FOLGE_Z <= R00I;
|
33 | else if PHI = "11" then FOLGE_Z <= V11I;
|
34 | end if;
|
35 | when V11 => if PHI = "10" then FOLGE_Z <= R01I;
|
36 | else if PHI = "01" then FOLGE_Z <= V01I;
|
37 | else if PHI = "00" then FOLGE_Z <= Fehler;
|
38 | else if PHI = "11" then FOLGE_Z <= V11;
|
39 | end if;
|
40 | when V01 => if PHI = "10" then FOLGE_Z <= Fehler;
|
41 | else if PHI = "01" then FOLGE_Z <= V01;
|
42 | else if PHI = "00" then FOLGE_Z <= V00I;
|
43 | else if PHI = "11" then FOLGE_Z <= R11I;
|
44 | end if;
|
45 | when R00 => if PHI = "10" then FOLGE_Z <= V10I;
|
46 | else if PHI = "01" then FOLGE_Z <= R01I;
|
47 | else if PHI = "00" then FOLGE_Z <= R00;
|
48 | else if PHI = "11" then FOLGE_Z <= Fehler;
|
49 | end if;
|
50 | when R10 => if PHI = "10" then FOLGE_Z <= R10;
|
51 | else if PHI = "01" then FOLGE_Z <= Fehler;
|
52 | else if PHI = "00" then FOLGE_Z <= R00I;
|
53 | else if PHI = "11" then FOLGE_Z <= V11I;
|
54 | end if;
|
55 | when R11 => if PHI = "10" then FOLGE_Z <= R01I;
|
56 | else if PHI = "01" then FOLGE_Z <= V01I;
|
57 | else if PHI = "00" then FOLGE_Z <= Fehler;
|
58 | else if PHI = "11" then FOLGE_Z <= R11;
|
59 | end if;
|
60 | when R01 => if PHI = "10" then FOLGE_Z <= Fehler;
|
61 | else if PHI = "01" then FOLGE_Z <= R01;
|
62 | else if PHI = "00" then FOLGE_Z <= V00I;
|
63 | else if PHI = "11" then FOLGE_Z <= R11I;
|
64 | end if;
|
65 | when V00I => FOLGE_Z <= V00;
|
66 | when V01I => FOLGE_Z <= V01;
|
67 | when V11I => FOLGE_Z <= V11;
|
68 | when V10I => FOLGE_Z <= V10;
|
69 | when R00I => FOLGE_Z <= R00;
|
70 | when R01I => FOLGE_Z <= R01;
|
71 | when R11I => FOLGE_Z <= R11;
|
72 | when R10I => FOLGE_Z <= R10;
|
73 | end case;
|
74 | end process UE_SN;
|
75 |
|
76 | AUS_SN: process(ZUSTAND) -- Ausgangssignalberechung
|
77 | begin
|
78 | case ZUSTAND is
|
79 | when V00 => A <= '10' after 20 ns;
|
80 | when others => A <= '00' after 20 ns;
|
81 | end case;
|
82 | end process AUS_SN;
|
83 | end SEQUENZ;
|