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

📄 add_sub_with_const.vhd

📁 Xilinx软核microblaze源码(VHDL)版本7.10
💻 VHD
字号:
--------------------------------------------------------------------------------- $Id: add_sub_with_const.vhd,v 1.1 2007/10/12 09:11:36 stefana Exp $--------------------------------------------------------------------------------- add_sub_with_const.vhd - Entity and architecture----  ***************************************************************************--  **  Copyright(C) 2003 by Xilinx, Inc. All rights reserved.               **--  **                                                                       **--  **  This text contains proprietary, confidential                         **--  **  information of Xilinx, Inc. , is distributed by                      **--  **  under license from Xilinx, Inc., and may be used,                    **--  **  copied and/or disclosed only pursuant to the terms                   **--  **  of a valid license agreement with Xilinx, Inc.                       **--  **                                                                       **--  **  Unmodified source code is guaranteed to place and route,             **--  **  function and run at speed according to the datasheet                 **--  **  specification. Source code is provided "as-is", with no              **--  **  obligation on the part of Xilinx to provide support.                 **--  **                                                                       **--  **  Xilinx Hotline support of source code IP shall only include          **--  **  standard level Xilinx Hotline support, and will only address         **--  **  issues and questions related to the standard released Netlist        **--  **  version of the core (and thus indirectly, the original core source). **--  **                                                                       **--  **  The Xilinx Support Hotline does not have access to source            **--  **  code and therefore cannot answer specific questions related          **--  **  to source HDL. The Xilinx Support Hotline will only be able          **--  **  to confirm the problem in the Netlist version of the core.           **--  **                                                                       **--  **  This copyright and support notice must be retained as part           **--  **  of this text at all times.                                           **--  ***************************************************************************----------------------------------------------------------------------------------- Filename:        add_sub_with_const.vhd---- Description:     --                  -- VHDL-Standard:   VHDL'93--------------------------------------------------------------------------------- Structure:   --              add_sub_with_const.vhd----------------------------------------------------------------------------------- Author:          goran-- Revision:        $Revision: 1.1 $-- Date:            $Date: 2007/10/12 09:11:36 $---- History:--   goran  2004-09-30    First Version----------------------------------------------------------------------------------- Naming Conventions:--      active low signals:                     "*_n"--      clock signals:                          "clk", "clk_div#", "clk_#x" --      reset signals:                          "rst", "rst_n" --      generics:                               "C_*" --      user defined types:                     "*_TYPE" --      state machine next state:               "*_ns" --      state machine current state:            "*_cs" --      combinatorial signals:                  "*_com" --      pipelined or register delay signals:    "*_d#" --      counter signals:                        "*cnt*"--      clock enable signals:                   "*_ce" --      internal version of output port         "*_i"--      device pins:                            "*_pin" --      ports:                                  - Names begin with Uppercase --      processes:                              "*_PROCESS" --      component instantiations:               "<ENTITY_>I_<#|FUNC>-------------------------------------------------------------------------------library IEEE;use IEEE.std_logic_1164.all;use IEEE.numeric_std.all;entity add_sub_with_const is    generic (    Size   : natural := 10;    Const0 : natural := 0;    Const1 : natural := 127    );  port (    Value : in  std_logic_vector(0 to Size-1);    Sub   : in  std_logic;    Sel   : in  std_logic;    Res   : out std_logic_vector(0 to Size-1));end entity add_sub_with_const;library unisim;use unisim.vcomponents.all;architecture IMP of add_sub_with_const is  constant const0_s : std_logic_vector(0 to Size-1) := std_logic_vector(to_unsigned(Const0, size));  constant const1_s : std_logic_vector(0 to Size-1) := std_logic_vector(to_unsigned(Const1, size));  signal addsub : std_logic_vector(0 to Size-1);  signal carry  : std_logic_vector(0 to Size);  begin  -- architecture IMP  carry(Size) <= Sub;  AddSub_Block : for I in Size-1 downto 0 generate    addsub(I) <= Sub xor (Value(I) xor ((Sel and Const1_s(I)) or ((not Sel) and Const0_s(I))));    MUXCY_L_I1 : MUXCY_L      port map (        DI => Value(I),                 -- [in  std_logic S = 0]        CI => Carry(I+1),               -- [in  std_logic S = 1]        S  => addsub(I),                -- [in  std_logic (Select)]        LO => Carry(I));                -- [out std_logic]            XOR_I : XORCY      port map (        LI => addsub(I),        CI => Carry(I+1),        O  => res(I));  end generate AddSub_Block;  end architecture IMP;

⌨️ 快捷键说明

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