📄 pwminv2x.vhd
字号:
------------------------------------------------------------------------
-- 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -