【正文】
when 56=tone_index=5。 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 23 頁 共 50 頁 when 58=tone_index=5。 when 60=tone_index=5。 when 62=tone_index=0。 when 64=tone_index=10。 when 66=tone_index=10。 when 68=tone_index=7。 when 70=tone_index=9。 when 72=tone_index=6。 when 74=tone_index=5。 when 76=tone_index=5。 when 78=tone_index=5。 when 80=tone_index=5。 when 82=tone_index=0。 when 84=tone_index=5。 when 86=tone_index=5。 when 88=tone_index=6。 when 90=tone_index=9。 when 92=tone_index=6。 when 94=tone_index=6。 when 96=tone_index=6。 when 98=tone_index=6。 when 100=tone_index=8。 when 102=tone_index=9。 when 104=tone_index=12。 when 106=tone_index=10。 when 108=tone_index=9。 when 110=tone_index=9。 when 112=tone_index=8。 when 114=tone_index=5。 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 25 頁 共 50 頁 when 116=tone_index=3。 when 118=tone_index=3。 when 120=tone_index=8。 when 122=tone_index=8。 when 124=tone_index=8。 when 126=tone_index=5。 when 128=tone_index=5。 when 130=tone_index=8。 when 132=tone_index=5。 when 134=tone_index=5。 when 136=tone_index=5。 when 138=tone_index=0。 when others=tone_index=0。 end if。 process(tone_index) 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 26 頁 共 50 頁 begin case tone_index is when 0=tone=11111111111。 773 when 2=tone=01110010000。 1036 when 5=tone=10010101101。 1290 when 7=tone=10101011100。 1410 when 9=tone=10111001000。 1542 when 12=tone=11001010110。 1668 when 15=tone=11011000000。 others:no output end case。 process(clk) control the frequence of the speaker begin if(clk39。139。 if(tone2047) then spk=not spk。 else tone_count=tone_count+1。 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 27 頁 共 50 頁 end if。 end one。實(shí)習(xí)伊始階段,我忙著去查資料,可是發(fā)現(xiàn)網(wǎng)上提供的資料千篇一律,沒有一點(diǎn)質(zhì)量,這也讓我明白其實(shí)網(wǎng)上的東西基本都是你抄過來我抄過去,沒有一點(diǎn)創(chuàng)新。 其實(shí),本課程設(shè)計(jì)最艱難階段則是在中間階段,一是課程設(shè)計(jì)有一段時間了,但是還沒有一點(diǎn)頭緒;二是看著其他同學(xué)陸陸續(xù)續(xù)進(jìn)入狀態(tài),心理有一點(diǎn)著急。 結(jié)果皇天不負(fù)有心人,我們最終還是完成了老師的基本任務(wù),同時我們也發(fā)揮了我們的想象,擴(kuò)展了一些模塊,而且都還成功了。 至今本次課程設(shè)計(jì)已經(jīng)結(jié)束了,但是 這兩周的課程設(shè)計(jì)讓我至生難忘,因?yàn)楸敬蔚恼n程設(shè)計(jì)完全是憑自己的知識與能力做出來的,可能做的東西不是很好,但是這其中的過程讓我覺得很值。 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 29 頁 共 50 頁 參考文獻(xiàn) [1] 《 SOPCIIEDA 實(shí)驗(yàn)指導(dǎo)書》(第二版) [2] 《 SOPCII 使用手冊》(第二版) [3] [4]《 EDA 技術(shù)基礎(chǔ)》 . 譚會生 編著 . 湖南大學(xué)出版社, 2021 [5]《 EDA 技術(shù)實(shí)用教程(第 三 版),潘松、黃繼業(yè)編著 ,科學(xué)出版社 ,2021 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 30 頁 共 50 頁 附錄 A 源程序 library ieee。 use 。 entity taxi is port( Clk : in std_logic。 Rst : in std_logic。 decide : in std_logic。 Motor : in std_logic。 SEG_SEL : buffer std_logic_vector(2 downto 0) )。 architecture one of taxi is signal Disp_Temp : integer range 0 to 15。 signal Meter1,Meter10,Meter100,Meter1K : integer range 0 to 9。 signal Old_Money1 : integer range 0 to 9。 signal count : std_logic_vector(2 downto 0)。 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 31 頁 共 50 頁 signal ena1 :std_logic。 signal CQ1,CQ2,CQ3,CQ4 : std_logic_vector(3 downto 0)。 SIGNAL DOUT : STD_LOGIC_VECTOR(15 DOWNTO 0)。 signal lout4:std_logic_vector(3 downto 0)。 signal tone : std_logic_vector(10 downto 0)。 signal tone_index : integer range 0 to 15。 signal time : integer range 0 to 150。 begin process(Motor) begin if(Rst=39。) then Meter1=0。 Meter100=0。 elsif(Motor39。139。 if(Meter10=9) then Meter10=0。 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 32 頁 共 50 頁 if(Meter1K=9) then Meter1K=0。 end if。 end if。 end if。 end if。 end process。039。 elsif(Rst=39。) then Money1=0。 Money100=0。event and Clk=39。) then if daytime =39。 then if(Meter1K1) then Money100=0。 Money1=0。 else Money1=Meter100。 if(Old_Money1=9 and Money1=0) then if(Money10=9) then Money10=0。 else Money100=Money100+1。 else Money10=Money10+1。 end if。 Money10=8。 Old_Money1=0。 Old_Money1=Money1。 if(Money100=9) then Money100=0。 end if。 end if。 end if 。 end if。 Money10=8。 Old_Money1=0。 Old_Money1=Money1。 if(Money100=9) then Money100=0。 end if。 出租車計(jì)費(fèi)器的設(shè)計(jì) 第 35 頁 共 50 頁 end if。 end if。 Money10=2。 Old_Money1=0。 Old_Money1=Money1。 if(Money100=9) then Money100=0。 end if。 end if。 end if。 end if 。 end proce