URL
https://opencores.org/ocsvn/ofdm/ofdm/trunk
[/] [ofdm/] [branches/] [avendor/] [mux_control.vhd] - Diff between revs 4 and 13
Only display areas with differences |
Details |
Blame |
View Log
Rev 4 |
Rev 13 |
library IEEE;
|
library IEEE;
|
use IEEE.STD_LOGIC_1164.all;
|
use IEEE.STD_LOGIC_1164.all;
|
use IEEE.STD_LOGIC_ARITH.all;
|
use IEEE.STD_LOGIC_ARITH.all;
|
use IEEE.STD_LOGIC_SIGNED.all;
|
use IEEE.STD_LOGIC_SIGNED.all;
|
|
|
entity mux_control is
|
entity mux_control is
|
|
|
generic (
|
generic (
|
stage : natural);
|
stage : natural);
|
|
|
port (
|
port (
|
clk : in std_logic;
|
clk : in std_logic;
|
rst : in std_logic;
|
rst : in std_logic;
|
Gen_state : in std_logic_vector(8 downto 0);
|
Gen_state : in std_logic_vector(8 downto 0);
|
sel_mux : out std_logic);
|
sel_mux : out std_logic);
|
end mux_control;
|
end mux_control;
|
|
|
architecture mux_control of mux_control is
|
architecture mux_control of mux_control is
|
|
|
alias state : std_logic_vector(2 downto 0) is Gen_state(2*stage+2 downto 2*stage);
|
alias state : std_logic_vector(2 downto 0) is Gen_state(2*stage+2 downto 2*stage);
|
alias counter : std_logic_vector(2*stage-1 downto 0) is Gen_state(2*stage-1 downto 0);
|
alias counter : std_logic_vector(2*stage-1 downto 0) is Gen_state(2*stage-1 downto 0);
|
|
|
begin
|
begin
|
|
|
process(clk, rst)
|
process(clk, rst)
|
begin
|
begin
|
if rst = '1' then
|
if rst = '1' then
|
sel_mux <= '0';
|
sel_mux <= '0';
|
elsif clk'event and clk = '1' then
|
elsif clk'event and clk = '1' then
|
if unsigned(state) = 0 and unsigned(counter) = 1 then
|
if unsigned(state) = 0 and unsigned(counter) = 1 then
|
sel_mux <= '0';
|
sel_mux <= '0';
|
elsif unsigned(state) = 1 and unsigned(counter) = 1 then
|
elsif unsigned(state) = 1 and unsigned(counter) = 1 then
|
sel_mux <= '1';
|
sel_mux <= '1';
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|
|
|
end mux_control;
|
end mux_control;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.