【文章內(nèi)容簡(jiǎn)介】
is port(clk,xz:in std_logic。 y1,y2,y3,y4,y5,y6:out std_logic)。 end cd1。 architecture rtl of cd1 is signal a1,b2,c3,d4,e5,f6:std_logic。 Begin process(clk,xz) begin if (clk39。event and clk=39。139。)then if (xz=39。039。) then a1=39。139。 c3=a1。 e5=c3。 elsif (xz=39。139。) then b2=39。139。 d4=b2。 f6=d4。 end if。 end if。 y1=a1。 y2=b2。 y3=c3。 y4=d4。 y5=e5。 y6=f6。 end process 。 end rtl。 cd1 要求 六盞燈編號(hào)分別為 Y Y Y Y YY6; 有一“ 控制方式選擇鍵 ”,當(dāng)電路的電源接通后 ,該選擇鍵為‘ 0’時(shí),彩燈點(diǎn)亮順序?yàn)?YY Y5。 當(dāng)該選擇鍵為‘ 1’時(shí),彩燈點(diǎn)亮順序?yàn)?YY Y6。 每盞燈依次隔 1秒被點(diǎn)亮 ,按下 復(fù)位 鍵燈都滅。 畫出外圍電路、寫出流程 六盞彩燈控制 CD2 程序 entity cd2 is port(clk,xz:in std_logic。 y1,y2,y3,y4,y5,y6:out std_logic)。 end cd2。 architecture rtl of cd2 is signal a1,b2,c3,d4,e5,f6:std_logic。 Begin process(clk,xz,rs) Begin If (rs=39。139。) then a1=39。039。 b2=39。039。 c3=39。039。 d4=39。039。 e5=39。039。 f6=39。039。 elsif (clk39。event and clk=39。139。)then if (xz=39。039。) then a1=39。139。 c3=a1。 e5=c3。 elsif (xz=39。139。) then b2=39。139。