library ieee;
use ieee.std_logic_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
entity gasp is
port(
x, y : in std_LOGIC;
d_in : in integer;
d_out, d: out integer
);
end gasp;
architecture gasp of gasp is
COMPONENT dfflop
port(
data_in: in integer;
enable: in std_logic;
data_out: out integer
);
END COMPONENT;
COMPONENT gasp_ctrl
PORT
(
in0, in1 : in STD_LOGIC;
en : out STD_LOGIC
);
END COMPONENT;
COMPONENT state_conductor
port(
in_left : in std_logic; -- - in_left is left bit for current_state
in_right : in std_logic; -- - in_right is right bit for current_state
state : out std_logic -- assert low or high bit for gasp controller
);
END COMPONENT;
---- state conductor wire ------
signal state_1: std_LOGIC;
------- enable wire ------------
signal en_1, w, en_2, z: std_LOGIC ;
------- data wire ------------
signal data_wire, data_wire1 : integer ;
begin
------------ stage 1 ---------------------
ctrl_1 : gasp_ctrl port map (in0 => x, in1 => state_1, en => en_1);
latch_1 : dfflop port map (data_in => d_in, enable => en_1, data_out => data_wire);
conductor_1 : state_conductor port map (in_left => en_1 ,in_right => en_2, state => state_1);
ctrl_2 : gasp_ctrl port map (in0 => state_1, in1 => y, en => en_2);
latch_2 : dfflop port map (data_in => data_wire, enable => en_2, data_out => d_out);
d <= data_wire;
end gasp;