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

📄 mux2_8.vhd

📁 Xilinx软核microblaze源码(VHDL)版本7.10
💻 VHD
字号:
--------------------------------------------------------------------------------- $Id: mux2_8.vhd,v 1.1 2007/10/12 09:11:36 stefana Exp $--------------------------------------------------------------------------------- mux_encode_sel - entity/architecture pair-----------------------------------------------------------------------------------                  ****************************--                  ** Copyright Xilinx, Inc. **--                  ** All rights reserved.   **--                  ****************************----------------------------------------------------------------------------------- Filename:        mux_encode_sel_imp.vhd-- Version:         v1.00a-- Description:     Parameterizeable mux with binary encoded select--                  --------------------------------------------------------------------------------- Structure:   --                  mux_encode_sel.vhd----------------------------------------------------------------------------------- Author:          B.L. Tise-- History:--   BLT            2001-04-06    First Version--   BLT            2001-05-08    Added 8:1 mux----------------------------------------------------------------------------------- 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 and use statements-------------------------------------------------------------------------------library IEEE;use IEEE.std_logic_1164.all;library Unisim;use Unisim.vcomponents.all;library Microblaze_v7_10_a;use Microblaze_v7_10_a.MicroBlaze_Types.all;------------------------------------------------------------------------------- Entity section-------------------------------------------------------------------------------------------------------------------------------------------------------------- Definition of Generics:--          C_TARGET        -- Xilinx target family, legal values are--                             VIRTEX and VIRTEXII (not a string)--          C_DW            -- width of data buses--          C_NB            -- number of data buses--          C_BE            -- TRUE=Big Endian, FALSE=Little Endian-- Definition of Ports:--          D               -- data input (Dbus0, Dbus1, Dbus2, ...)--          S               -- select input (S0,S1,S2,...) S0 most significant--          Y               -- mux output Y = Dbus(S)--          YL              -- mux output before last mux stage  (removed)-------------------------------------------------------------------------------entity mux2_8 is  generic (    C_TARGET : TARGET_FAMILY_TYPE;    C_BE     : boolean := true    );  port (    D : in  std_logic_vector(0 to 15);    S : in  std_logic_vector(0 to 0);    Y : out std_logic_vector(0 to 7)    );end entity mux2_8;------------------------------------------------------------------------------- Architecture section-----------------------------------------------------------------------------architecture IMP of mux2_8 is  constant C_DW : integer := 8;  constant C_NB : integer := 2;--------------------------------------------------------------------------------- Begin architecture-------------------------------------------------------------------------------begin  -- architecture imp  GEN_2 : if C_NB = 2 generate    signal iY : std_logic_vector(0 to C_DW-1);  begin    GEN2_LOOP : for i in 0 to C_DW-1 generate      signal lut_in : std_logic_vector(0 to 2);    begin      lut_in(0 to 1) <= (D(i), D(i+C_DW));      lut_in(2)      <= S(S'right);      LUT3_I : LUT3        generic map(          INIT => X"CA"          )        port map (          O  => iY(i),                  -- [out]          I0 => lut_in(0),              -- [in]          I1 => lut_in(1),              -- [in]          I2 => lut_in(2));             -- [in]    end generate GEN2_LOOP;    Y <= iY;    -- YL <= iY;  end generate GEN_2;end architecture IMP;

⌨️ 快捷键说明

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