【正文】
U4: price_count port map(sta=sta,t_count=x,d_count=y,mjiao=pri_jiao,mge=pri_ge,mshi=pri_shi,mbai=pri_bai)。 U2: time_count port map(sta=sta,sclk=sclk,dge=w,t_count=x,minge=time_ge,minshi=time_shi)。signal w,x,y: std_logic。 mjiao,mge,mshi,mbai: out integer range 0 to 10)。end ponent。 kmfen,kmge,kmshi: out integer range 0 to 10。end ponent。 minge: out integer range 0 to 10。ponent time_count isport(sta,sclk,dge: in std_logic。 dge: out std_logic)。end。 pri_jiao,pri_ge,pri_shi,pri_bai: out integer range 0 to 10。entity p is port(sclk,lclk,sta,doub: in std_logic。library ieee。end process。mshi=shi。 end if。 cbai:=1。 bai:=d_bai+t_bai+cshi。 else cshi:=0。 if shi=10 then shi:=shi10。 end if。 cge:=1。begin ge:=d_ge+t_ge。process(d_ge,d_shi,d_bai,t_ge,t_shi,t_bai)variable cge,cshi,cbai: integer range 0 to 1。d_bai=dbai。d_ge=dge。end if。 dshi:=0。else djiao:=0。 end if。 end if。 if dbai=10 then dbai:=0。 if dshi=10 then dshi:=0。 if dge=10 then dge:=0。 if djiao=10 then djiao:=0。139。 then if d_count39。beginif sta=39。process(sta,d_count)variable djiao: integer range 0 to 10。t_bai=tbai。t_ge=tge。 tbai:=0。else tge:=8。 end if。 end if。 tbai:=tbai+1。 tshi:=tshi+1。 then tge:=tge+1。event and t_count=39。139。variable tge: integer range 0 to 10:=8。signal d_ge,d_shi,d_bai: integer range 0 to 10。end。entity price_count isport(sta,t_count,d_count: in std_logic。library ieee。end process。kmshi=shi。 kmfen=fen。039。 shi:=0。 else fen:=0。 end if。 end if。 end if。 shi:=shi+1。 g