inv_control.vhd

来自「fpga实现OFDM的源代码 并且配有各个部分的详细说明」· VHDL 代码 · 共 38 行

VHD
38
字号
library IEEE;use IEEE.STD_LOGIC_1164.all;use IEEE.STD_LOGIC_ARITH.all;use IEEE.STD_LOGIC_UNSIGNED.all;entity inv_control is  generic (    stage : natural:=3);  port (    clk       : in  std_logic;    rst       : in  std_logic;    Gen_state : in  std_logic_vector(2*stage+2 downto 0);    inv       : out std_logic);end inv_control;architecture inv_control of inv_control is  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);begin  process (clk, rst)  begin  -- process    if rst = '1' then                   -- asynchronous reset (active low)      inv <= '0';    elsif clk'event and clk = '1' then  -- rising clock edge      if (unsigned(state) = 0) or (unsigned(state) = 1 and unsigned(counter)< 4) then        inv <= not(counter(1));      else		  inv <= '0';      end if;    end if;  end process;end inv_control;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?