OpenCores
URL https://opencores.org/ocsvn/ofdm/ofdm/trunk

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [mux_control.vhd] - Blame information for rev 14

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 tmsiqueira
library IEEE;
2
use IEEE.STD_LOGIC_1164.all;
3
use IEEE.STD_LOGIC_ARITH.all;
4
use IEEE.STD_LOGIC_SIGNED.all;
5
 
6
entity mux_control is
7
 
8
  generic (
9
    stage : natural);
10
 
11
  port (
12
    clk       : in  std_logic;
13
    rst       : in  std_logic;
14
    Gen_state : in  std_logic_vector(8 downto 0);
15
    sel_mux   : out std_logic);
16
end mux_control;
17
 
18
architecture mux_control of mux_control is
19
 
20
  alias state   : std_logic_vector(2 downto 0) is Gen_state(2*stage+2 downto 2*stage);
21
  alias counter : std_logic_vector(2*stage-1 downto 0) is Gen_state(2*stage-1 downto 0);
22
 
23
begin
24
 
25
  process(clk, rst)
26
  begin
27
    if rst = '1' then
28
      sel_mux <= '0';
29
    elsif clk'event and clk = '1' then
30
      if unsigned(state) = 0 and unsigned(counter) = 1 then
31
        sel_mux <= '0';
32
      elsif unsigned(state) = 1 and unsigned(counter) = 1 then
33
        sel_mux <= '1';
34
      end if;
35
    end if;
36
  end process;
37
 
38
end mux_control;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.