Re: Aufgaben und Übungen,

-- Sieht, auch gut aus, die Werte f"ur das D-Latch - ich sage gleich, ich habe die Schaltung auf ihre alte Art bez"uglich Latches wieder hergestellt. Eigentlich tut alles prima, eine kleinigkeit ist es noch. Aber nicht das D-Latch, ich teste alles durch

library ieee;
use ieee.std_logic_1164.all;

entity meinautomat0028ausgangschaltnetz is
port
(
 a, b: in std_logic;
 x: in std_logic;
 y0, y1, y2: out std_logic
);
end;

library ieee;
use ieee.std_logic_1164.all;

entity meinautomat0028uebergangsschaltnetz is
port
(
 a, b: in std_logic;
 aout, bout: out std_logic;
 x: in std_logic
);
end;

architecture verhalten of meinautomat0028ausgangschaltnetz is
begin
    y0 <= b;
    y1 <= a;
    y2 <= (not b and not a) or (b and a);
end;

architecture verhalten of meinautomat0028uebergangsschaltnetz is
begin
    bout <= b xor a;
    aout <= not a;
end;

library ieee;
use ieee.std_logic_1164.all;

entity meinautomat0028rslatch is
port (
    q: out std_logic;
    r, s: in std_logic
);
end;

architecture verhalten of meinautomat0028rslatch is
    signal q1, q2 : std_logic;
begin
    q1 <= (s nor q2);
    q2 <= (r nor q1);

    q <= q1;
end;

library ieee;
use ieee.std_logic_1164.all;

entity meinautomat0028rslatchtaktgesteuert is
port (
    q: out std_logic;
    r, s, c: in std_logic
);
end;

architecture verhalten of meinautomat0028rslatchtaktgesteuert is
    component meinautomat0028rslatch
    port (
        q: out std_logic;
        r, s: in std_logic
    );
    end component;
    signal r1, s1: std_logic;
begin
    instanzrslatch: meinautomat0028rslatch PORT MAP (r=>r1, s=>s1, q=>q);
    r1 <= c and r;
    s1 <= c and s;
end;

library ieee;
use ieee.std_logic_1164.all;

entity meinautomat0028dlatch is
port
(
    q: out std_logic;
    d, c: in std_logic
);
end;

architecture verhalten of meinautomat0028dlatch is
    component meinautomat0028rslatchtaktgesteuert
    port
    (
        q: out std_logic;
        r, s, c: in std_logic
    );
    end component;
    signal r1, s1: std_logic;
begin
    instanzrslatchtaktgesteuert: meinautomat0028rslatchtaktgesteuert PORT MAP (r=>r1, s=>s1, q=>q, c=>c);
    r1 <= d;
    s1 <= not d;
end;

library ieee;
use ieee.std_logic_1164.all;

entity meinautomat0028dmasterslaveflipflop is
port
(
    q: out std_logic;
    d, c: in std_logic
);
end;

architecture verhalten of meinautomat0028dmasterslaveflipflop is
    component meinautomat0028dlatch is
    port (
        q: out std_logic;
        d, c: in std_logic
    );
    end component;
    signal c1, c2: std_logic;
    signal d1: std_logic;
begin
    master: meinautomat0028dlatch PORT MAP (q=>d1, d=>d, c=>c1);
    slave: meinautomat0028dlatch PORT MAP (q=>q, d=>d1, c=>c2);
    c1 <= c;
    c2 <= not c;
end;

library ieee;
use ieee.std_logic_1164.all;

entity meinautomat0028schaltwerk is
port
(
    c: in std_logic;
    x: in std_logic;
    y0, y1, y2: out std_logic
);
end;

architecture verhalten of meinautomat0028schaltwerk is
    component meinautomat0028dmasterslaveflipflop
    port
    (
        d, c: in std_logic;
        q: out std_logic
    );
    end component;
    component meinautomat0028ausgangschaltnetz
    port
    (
        a, b: inout std_logic;
        x: in std_logic;
        y0, y1, y2: out std_logic
    );
    end component;
    component meinautomat0028uebergangsschaltnetz
    port
    (
        aout, bout: out std_logic;
        a, b: in std_logic;
        x: in std_logic
    );
    end component;
    signal v1, v2 : std_logic;
    signal w1, w2 : std_logic;
    signal p1, p2 : std_logic;
begin
    state1: meinautomat0028dmasterslaveflipflop PORT MAP (d=>w1, c=>c, q=>v1);
    state2: meinautomat0028dmasterslaveflipflop PORT MAP (d=>w2, c=>c, q=>v2);
    ausgang: meinautomat0028ausgangschaltnetz PORT MAP (b=>v1, a=>v2, x=>x, y0=>y0, y1=>y1, y2=>y2);
    uebergang: meinautomat0028uebergangsschaltnetz PORT MAP (b=>v1, a=>v2, bout=>w1, aout=>w2,x=>x);
end;

library ieee;
use ieee.std_logic_1164.all;

entity testbench is
    port (
        c: inout std_logic;
        x: inout std_logic;
        y0, y1, y2: out std_logic
    );
end;

architecture verhalten of testbench is
component meinautomat0028dlatch is
port
(
    q: out std_logic;
    d, c: in std_logic
);
end component;
signal d, q: std_logic;
begin
    rsc: meinautomat0028dlatch PORT MAP (c=>c, d=>d, q=>q);
    d <= '0' after 0 ns, '1' after 1 ns, '0' after 2 ns, '1' after 3 ns, '1' after 4 ns, '0' after 5 ns;
    c <= '1' after 0 ns, '1' after 1 ns, '1' after 2 ns, '0' after 3 ns, '1' after 4 ns, '0' after 5 ns;
end;