⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cround.vhd

📁 这个是国外大学的项目代码
💻 VHD
字号:
------------------------------------------------------------------------
--  cround.vhd -- Checking the result
------------------------------------------------------------------------
--  Author : Kovacs Laszlo - Attila 
------------------------------------------------------------------------
-- Software version: Xilinx ISE 7.1.04i
--                   WebPack
------------------------------------------------------------------------
------------------------------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity cround is
    Port ( CLK  : in std_logic;
           EN   : in std_logic;
           MASK : in std_logic;
           DI   : in std_logic_vector(15 downto 0);
           DO   : out std_logic_vector(7 downto 0));
end cround;

architecture Behavioral of cround is

signal res, res2 : std_logic_vector(7 downto 0) := "00000000";
signal iDO : std_logic_vector(7 downto 0) := "00000000";

begin

    DO <= iDO;
    
    process(CLK)
    begin
        if rising_edge(CLK) and EN = '1' then
            iDO <= res2;
        end if;
    end process;

    res <= (others => '0') when DI(15) = '1' else
            (others => '1') when DI(14 downto 8) /= "0000000" else
            DI(7 downto 0);

    res2 <= res when MASK = '0' else not res;

end Behavioral;

⌨️ 快捷键说明

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