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

📄 dpc.vhd

📁 This is a project about PWM. Application in motor speed control
💻 VHD
字号:
----------------------------------------------------------------------------- dpc (PWM generator)---------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity dpc is  port (    clk         : in std_logic;    period      : in std_logic_vector(31 downto 0);    width       : in std_logic_vector(31 downto 0);    pulse       : out std_logic  );end entity;architecture behaviour of dpc issignal counter: std_logic_vector(31 downto 0);begin  process     begin      wait until rising_edge(clk);      if (counter >= period) then        counter <= (others => '0');      else        counter <= counter + '1';      end if;      if (counter >= width) then        pulse <= '0';      else        pulse <= '1';      end if;    end process;end behaviour;

⌨️ 快捷键说明

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