TITYjuchibo_addISPORT(clk,reset:instd_logic;?q:outstd_logic_vector(7downto0));END;ARCHITECTUREbehaveOFjuchibo_addISBEGIN?PROCESS(clk,reset)?VARIABLEtmp:std_logic_vector(7downto0); BEGIN IFreset='0'THEN tmp:="00000000"; ELSIFclk'eventandclk='1'THEN IFtmp="11111111"THEN tmp:="00000000"; ELSE tmp:=tmp+1; ENDIF; ENDIF;q<=tmp;ENDPROCESS;END;递增锯齿波仿真波形:图3递增锯齿波仿真波形递增锯齿波信号产生模块元件图:图4递增锯齿波元件图递减锯齿波信号产生模块代码:LIBRARYIEEE;--锯齿波递减USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYjuchibo_jieISPORT(clk,reset:instd_logic;?q:outstd_logic_vector(7downto0));END;ARCHITECTUREbehaveOFjuchibo_jieISBEGIN?PROCESS(clk,reset)?VARIABLEtmp:std_logic_vector(7downto0); BEGIN IFreset='0'THEN tmp:="11111111"; ELSIFclk'eventandclk='1'THEN IFtmp="00000000"THEN tmp:="11111111"; ELSE tmp:=tmp-1; ENDIF; ENDIF;q<=tmp;