【正文】
)編譯各個模塊,連接各模塊,最終實現(xiàn)一小時的秒表計數(shù)功能。 1)編程實現(xiàn)十進制計數(shù)器 十進制計數(shù)器源代碼: library ieee。 use 。 use 。 use 。 entity t10 is port(clk: in std_logic。 clr: in std_logic。 ena: in std_logic。 cq: out integer range 0 to 15。 carry_out: out std_logic)。 end entity t10。 architecture art of t10 is signal cqi: integer range 0 to 15。 begin process(clk,clr,ena)is begin if clr=39。139。then cqi=0。 elsif clk39。event and clk=39。139。then if ena=39。139。then if cqi9 then cqi=cqi+1。 else cqi=0。end if。 end if。 end if。 end process。 process(cqi)is begin if cqi=9 then carry_out=39。139。 else