pwminv2x.vhd

来自「这个是国外大学的项目代码」· VHDL 代码 · 共 67 行

VHD
67
字号
------------------------------------------------------------------------
--  pwminv2x.vhd -- Pulse Width Modulator
------------------------------------------------------------------------
--  Author : Kovacs Laszlo - Attila 
------------------------------------------------------------------------
-- Software version: Xilinx ISE 7.1.04i
--                   WebPack
------------------------------------------------------------------------
-- This Pulse Width Modulator according to the 5 most significant bits 
-- of the data input selects one of the 32 logics (pulse widths),
-- using inverse clock signals, so the pulse modulations does 
-- not have the same length.
------------------------------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity pwminv2x is
    Port ( CLK2X : in std_logic;
           CLK   : in std_logic;
           CLK2  : in std_logic;
           CLK4  : in std_logic;
           CLK8  : in std_logic;
           DO    : out std_logic;
           DI    : in std_logic_vector(7 downto 0));
end pwminv2x;
architecture Behavioral of pwminv2x is

begin

    with DI(7 downto 3) select
    DO <= '1'                                        when "11111",
        CLK2X or CLK or CLK2 or CLK4 or CLK8         when "11110",
        CLK2X or CLK or CLK2 or CLK4                 when "11101",
        CLK2X or CLK or CLK2 or (CLK4 and CLK8)      when "11100",
        CLK2X or CLK or CLK2                         when "11011",
        CLK2X or CLK or (CLK2 and (CLK4 or CLK8))    when "11010",
        CLK2X or CLK or (CLK2 and CLK4)              when "11001",
        CLK2X or CLK or (CLK2 and CLK4 and CLK8)     when "11000",
        CLK2X or CLK                                 when "10111",
        CLK2X or (CLK and (CLK2 or CLK4 or CLK8))    when "10110",
        CLK2X or (CLK and (CLK2 or CLK4))            when "10101",
        CLK2X or (CLK and (CLK2 or (CLK4 and CLK8))) when "10100",
        CLK2X or (CLK and CLK2)                      when "10011",
        CLK2X or (CLK and CLK2 and (CLK4 or CLK8))   when "10010",
        CLK2X or (CLK and CLK2 and CLK4)             when "10001",
        CLK2X or (CLK and CLK2 and CLK4 and CLK8)    when "10000",
        CLK2X                                        when "01111", 
        CLK2X and (CLK or CLK2 or CLK4)              when "01110",
        CLK2X and (CLK or CLK2 or CLK4 or CLK8)      when "01101",
        CLK2X and (CLK or CLK2 or (CLK4 and CLK8))   when "01100",
        CLK2X and (CLK or CLK2)                      when "01011",
        CLK2X and (CLK or (CLK2 and (CLK4 or CLK8))) when "01010",
        CLK2X and (CLK or (CLK2 and CLK4))           when "01001",
        CLK2X and (CLK or (CLK2 and CLK4 and CLK8))  when "01000",
        CLK2X and CLK                                when "00111",
        CLK2X and CLK and (CLK2 or CLK4 or CLK8)     when "00110",
        CLK2X and CLK and (CLK2 or CLK4)             when "00101",
        CLK2X and CLK and (CLK2 or (CLK4 and CLK8))  when "00100",
        CLK2X and CLK and CLK2 and (CLK4 or CLK8)    when "00011",
        CLK2X and CLK and CLK2 and CLK4 and CLK8     when "00010",
        '0'                                          when others; 

end Behavioral;
                                

⌨️ 快捷键说明

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