【正文】
24。P3:key_out=(not k1) and k2。 end if。 end if。 else k1=39。P2:process(clk)begin if falling_edge(clk) then if t/=7 then k1=39。 end if。 elsif falling_edge(clk) then if t/=7 then t=t+1。139。signal k1,k2:std_logic。end key_debounce。 key_in : in STD_LOGIC。use 。use 。use 。end Behavioral。end process。 when others=sig=11111111。 when 110=sig=10111111。 when 100=sig=11101111。 when 010=sig=11111011。片選控制pian:process(count) isbegincase count is when 000=sig=11111110。end process。039。 end case。 when 1111=duansel=1111110。 when 1000=duansel=0000000。 when 0110=duansel=0100000。 when 0100=duansel=1001100。 when 0010=duansel=0010010。段選控制DUAN:process(BCD) isbegin case BCD is abcdefg 0123456 when 0000=duanSel=0000001。end case。 when 111=BCD=m_2。 when 101=BCD=1111。 when 011=BCD=s_1。 when 001=BCD=hs_2。end process。 end if。 then if count=111 then count=000??刂菩?shù)點(diǎn)的亮與滅begin完成計(jì)數(shù)功能t:process(clk) isbegin if rising_edge(clk) and clk=39。signal dp:STD_LOGIC:=39。signal BCD:STD_LOGIC_VECTOR (3 downto 0)。end display。 duanSel : out STD_LOGIC_VECTOR (6 downto 0))。 m_2 : in STD_LOGIC_VECTOR (3 downto 0)。 s_2 : in STD_LOGIC_VECTOR (3 downto 0)。 hs_2 : in STD_LOGIC_VECTOR (3 downto 0)。entity display is Port ( clk : in STD_LOGIC。 Unment the following library declaration if instantiating any Xilinx primitives in this code.library UNISIM。use 。5 掃描顯示控制電路library IEEE。count_dis=state(0)。clean=state(2)。end if。 else state=111。 when others=state=010。 end case。 when 10=state=011。 end case。 when 10=state=001。 end case。 then if state=111 then case SR is when 10=state=011。process(clk_1KHz,state,SR)beginif rising_edge(clk_1KHz) and clk_1KHz=39。begin SR = start_stop amp。architecture Behavioral of control issignal state:STD_LOGIC_VECTOR(2 DOWNTO 0):=111。 count_dis:out STD_LOGIC)。 clean: out STD_LOGIC。 split_rest:in STD_LOGIC。use 。use 。use 。end Behavioral。 end if。 count_out5=count_in5。 count_out3=count_in3。 then count_out1=count_in1。architecture Behavioral of latch isbeginprocess(en,count_in1,count_in2,count_in3,count_in4,count_in5,count_in6)begin if en=39。 count_out6 : out STD_LOGIC_VECTOR (3 downto 0))。 count_out4 : out STD_LOGIC_VECTOR (3 downto 0)。 count_out2 : out STD_LOGIC_VECTOR (3 downto 0)。 count_in6 : in STD_LOGIC_VECTOR (3 downto 0)。 count_in4 : in STD_LOGIC_VECTOR (3 downto 0)。 count_in2 : in STD_LOGIC_VECTOR (3 downto 0)。entity latch is Port ( en : in STD_LOGIC。 Unment the fol