【正文】
。use 。entity fangbo isport(reset:in std_logic。 clk: in std_logic。 t:buffer std_logic_vector(7 downto 0))。end entity。architecture one of fangbo isbeginprocess(clk)variable count:integer range 0 to 500。begin if reset=39。039。 then count:=0。 elsif rising_edge(clk) then if count=500 then t=00000000。 count:=0。 elsif count=255 then t=11111111。 count:=count+1。 else count:=count+1。 end if。end if。end process。end one。(3)、階梯波形的設(shè)計(jì)可采用0,50,100,150,每次間隔50進(jìn)行設(shè)計(jì)階梯波產(chǎn)生模塊jietibo:library ieee。use 。use 。use 。entity jietibo isport(reset:in std_logic。 clk: in std_logic。 t:buffer std_logic_vector(7 downto 0))。end entity。architecture one of jietibo isbeginprocess(clk)variable count:integer range 0 to 500。begin if reset=39。039。 then count:=0。 elsif rising_edge(clk) then count:=count+1。 if count=500 then count:=0。 elsif count=450 then t=11011000。 elsif count=400 then t=11000000。 elsif count=350 then t=10101000。 elsif count=300 then t=10010000。 elsif count=250 then t=01110000。 elsif count=200 then t=01100000。 elsif count=150 then t=01000100。 elsif count=100 then t=00110000。 elsif count=50 then t=00011000。 else t=00000000。 end if。end if。end process。end one。(4)鋸齒波的設(shè)計(jì)采用0~255循環(huán)加法計(jì)數(shù)器實(shí)現(xiàn)。通過賦值給輸出值。clk是時(shí)鐘信號,當(dāng)復(fù)位信號有效時(shí),輸出為‘0’,輸出最小值設(shè)為“0”,最大值設(shè)為“255”,從“0”開始,當(dāng)時(shí)鐘檢測到有上升沿的時(shí)候,輸出就會(huì)呈現(xiàn)遞增的趨勢,加“1”。鋸齒波產(chǎn)生模塊juchi:library ieee。use 。use 。use 。entity juchibo isport(reset:in std_logic。 clk: in std_logic。 t:buffer std_logic_vector(7 downto 0))。end entity。architecture one of juchibo isbeginprocess(clk)begin if reset=39。039。 then t=00000000。 elsif rising_edge(clk) then if t=11111111then t=00000000。 else t=t+1。 end if。 end if。end process。end one。(5)、三角波的設(shè)計(jì)采用0~255~0循環(huán)加/減法計(jì)數(shù)器實(shí)現(xiàn)三角波產(chǎn)生模sanjiaobo:library ieee。use 。use 。use 。entity sanjiaobo isport(reset:in std_logic。 clk: in std_logic。 t:buffer std_logic_vector(7 downto 0))。end entity。architecture one of san