allonedet.vhd

来自「VHDL的基本数学运算库,非常好用」· VHDL 代码 · 共 64 行

VHD
64
字号
--------------------------------------------------------------------------------- Title       : All-ones detector-- Project     : VHDL Library of Arithmetic Units--------------------------------------------------------------------------------- File        : AllOneDet.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-ones vector.-------------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;library arith_lib;use arith_lib.arith_lib.all;-------------------------------------------------------------------------------entity AllOneDet is  generic (width : positive := 8);  	-- word width  port (A : in std_logic_vector(width-1 downto 0);  -- operand	Z : out std_logic);		-- all-ones flagend AllOneDet;-------------------------------------------------------------------------------architecture Behavioral of AllOneDet is  signal Ones : std_logic_vector(width-1 downto 0);  -- ones vectorbegin  -- initialization of ones vector  Ones <= (others => '1');  -- all-ones detection  Z <= '1' when A = Ones else '0';end Behavioral;-------------------------------------------------------------------------------architecture Structural of AllOneDet is  signal ZT : std_logic_vector(width-1 downto 0);  -- temp.begin  -- all-ones detection  zeroFlag : RedAnd    generic map (width)    port map (A, Z);end Structural;-------------------------------------------------------------------------------

⌨️ 快捷键说明

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