----------------------------------------------------------------------------------
-- Company: 
-- Engineer: 
-- 
-- Create Date:    17:29:47 04/07/2012 
-- Design Name: 
-- Module Name:    Input_DEMUX - Behavioral 
-- Project Name: 
-- Target Devices: 
-- Tool versions: 
-- Description: 
--
-- Dependencies: 
--
-- Revision: 
-- Revision 0.01 - File Created
-- Additional Comments: 
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity Input_DEMUX is
    Port ( clk : in  STD_LOGIC;
           Output_data : out  STD_LOGIC_VECTOR (17 downto 0);
           Address : in  STD_LOGIC_VECTOR (2 downto 0);
           AM_input : in  STD_LOGIC_VECTOR (17 downto 0);
           FM_input : in  STD_LOGIC_VECTOR (17 downto 0);
           CW_input : in  STD_LOGIC_VECTOR (17 downto 0);
           SSB_input : in  STD_LOGIC_VECTOR (17 downto 0);
           En : in  STD_LOGIC);
end Input_DEMUX;

architecture Behavioral of Input_DEMUX is

signal output_reg: STD_LOGIC_VECTOR (17 downto 0) := (OTHERS => '0');

begin

process (clk) begin
	IF rising_edge(clk) THEN
		IF En = '1' THEN
			CASE Address IS
				WHEN "000" => 	output_reg <= AM_input;								
				WHEN "001" => 	output_reg <= FM_input;			
				WHEN "010" =>  output_reg <= CW_input;
				WHEN OTHERS => output_reg <= SSB_input;
   		END CASE;
		ELSE
			output_reg <= (OTHERS => '0');
		END IF;			
	END IF;
end process;

Output_data <= output_reg;

end Behavioral;

