PWM信号发生器-vhdl学习指导

上传者: 42187487 | 上传时间: 2022-06-19 14:28:17 | 文件大小: 20.91MB | 文件类型: PPT
PWM信号发生器 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity Pwm is port( clk: in std_logic; --clk signal wr_n:in std_logic; --write signal addr:in std_logic; --address signal WrData:in std_logic_vector(7 downto 0); --writedata signal PwmOut:out std_logic); --Global signal end Pwm; architecture one of Pwm is signal period:std_logic_vector(7 downto 0); signal duty:std_logic_vector(7 downto 0); signal counter:std_logic_vector(7 downto 0); Begin process(clk,WrData) begin if rising_edge(clk) then if (wr_n='0') then if addr='0' then period<=WrData; duty<=duty; else period<=period; duty<=WrData; end if; else period<=period; duty<=duty; end if; end if; end process; process(clk) begin if rising_edge(clk) then if counter=0 then counter<=period; else counter<=counter-1; end if; if counter>duty then PwmOut<='0'; else PwmOut<='1'; end if; end if; end process; end one;

文件下载

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明