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

📄 redor.vhd

📁 Cadence的VHDL运算库包
💻 VHD
字号:
--------------------------------------------------------------------------------- Title       : Reduce OR-- Project     : VHDL Library of Arithmetic Units--------------------------------------------------------------------------------- File        : RedOr.vhd-- Author      : Reto Zimmermann  <zimmi@iis.ee.ethz.ch>-- Company     : Integrated Systems Laboratory, ETH Zurich-- Date        : 1998/01/11--------------------------------------------------------------------------------- Copyright (c) 1998 Integrated Systems Laboratory, ETH Zurich--------------------------------------------------------------------------------- Description :-- OR all bits of the input vector.-------------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;library arith_lib;use arith_lib.arith_lib.all;-------------------------------------------------------------------------------entity RedOr is  generic (width : positive := 8);  	-- word width  port (A : in std_logic_vector(width-1 downto 0);  -- input vector	Z : out std_logic);		-- output bitend RedOr;-------------------------------------------------------------------------------architecture Behavioral of RedOr isbegin  -- OR all bits  reduceOr : process (A)    variable zv : std_logic;  begin    zv := A(0);    for i in 1 to width-1 loop      zv := zv or A(i);    end loop;    Z <= zv;  end process reduceOr;end Behavioral;-------------------------------------------------------------------------------architecture Structural of RedOr is begin  -- OR all bits  -- again behavioral description used (well handled by all synthesizers)   reduceOr : process (A)    variable zv : std_logic;  begin    zv := A(0);    for i in 1 to width-1 loop      zv := zv or A(i);    end loop;    Z <= zv;  end process reduceOr;end Structural;-------------------------------------------------------------------------------

⌨️ 快捷键说明

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