allzerodet.vhd

来自「Cadence的VHDL运算库包」· VHDL 代码 · 共 67 行

VHD
67
字号
--------------------------------------------------------------------------------- Title       : All-zeroes detector-- Project     : VHDL Library of Arithmetic Units--------------------------------------------------------------------------------- File        : AllZeroDet.vhd-- Author      : Reto Zimmermann  <zimmi@iis.ee.ethz.ch>-- Company     : Integrated Systems Laboratory, ETH Zurich-- Date        : 1997/12/29--------------------------------------------------------------------------------- Copyright (c) 1998 Integrated Systems Laboratory, ETH Zurich--------------------------------------------------------------------------------- Description :-- Detection of the all-zeroes vector.-------------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;library arith_lib;use arith_lib.arith_lib.all;-------------------------------------------------------------------------------entity AllZeroDet is  generic (width : positive := 8);  	-- word width  port (A : in std_logic_vector(width-1 downto 0);  -- operand	Z : out std_logic);		-- all-zeroes flagend AllZeroDet;-------------------------------------------------------------------------------architecture Behavioral of AllZeroDet is  signal Zeroes : std_logic_vector(width-1 downto 0);  -- zeroes vectorbegin  -- initialization of zeroes vector  Zeroes <= (others => '0');  -- all-zeroes detection  Z <= '1' when A = Zeroes else '0';end Behavioral;-------------------------------------------------------------------------------architecture Structural of AllZeroDet is  signal ZT : std_logic;  -- temp.begin  -- all-zeroes detection  zeroFlag : RedOr    generic map (width)    port map (A, ZT);  -- result  Z <= not ZT;end Structural;-------------------------------------------------------------------------------

⌨️ 快捷键说明

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