freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于fpga的ic卡電話計(jì)費(fèi)系統(tǒng)的設(shè)計(jì)-在線瀏覽

2025-01-11 01:35本頁面
  

【正文】 電話計(jì)費(fèi)器 ~~~~~信號(hào)定義 ~~~~~ clk 時(shí)鐘信號(hào), 1Hz card 卡插入信號(hào) state 接通信號(hào) decide 話務(wù)種類: 01 市話, 10 長(zhǎng)話, 11 特話 remaining 本張 IC 卡初始余額 dispmoney 顯示卡內(nèi)余額,單位為角 disptime 顯示通話時(shí)間 pwrite 下降沿寫卡 pread 上升沿讀卡 pwarn 余額過少告警,市話 3 角,長(zhǎng)話 6 角 cut 自動(dòng)切斷通話信號(hào) library ieee。 use 。 entity IC_Count_Core is port(clk,card,state: in std_logic。 remaining: in std_logic_vector(11 downto 0)。 dispmoney: out std_logic_vector(11 downto 0)。 end IC_Count_Core。 signal ptime: std_logic_vector(11 downto 0)。039。039。 num 指示通話計(jì)時(shí) 的秒數(shù) , temp 用于余額不足從報(bào)警提示開始到自動(dòng)切斷通話的時(shí)間 signal warn: bit :=39。 signal pcut: bit :=39。 begin process(clk) begin if(clk39。139。 t1m=39。 if(pcut=39。) then pread=39。計(jì)時(shí) 1 分鐘 ,且當(dāng)用戶能夠正常通話時(shí) ,開始 讀用戶 卡 end if。139。電話接通后,開始計(jì)時(shí) else num=0。 t1m=39。 pread=39。 end if。 end process。event and clk=39。) then時(shí)鐘下降沿時(shí)觸發(fā) if(set=39。) then寫卡前的初始化工作,即開始裝入用戶 IC 卡中的余額 money=remaining。139。 if(card=39。 and state=39。) then 用戶已經(jīng)插卡,并且已經(jīng)撥通電話 if(t1m=39。) then case (state amp。139。039。139。 if(money(7 downto 4)/=0) then money(7 downto 4)=money(7 downto 4)1。 money(11 downto 8)=money(11 downto 8)1。 else money(3 downto 0)=money(3 downto 0)3。 市話計(jì)時(shí) if(ptime(3 downto 0)=9) then ptime(3 downto 0)=0000。 ptime(11 downto 8)=ptime(11 downto 8)+1。 end if。 end if。039。139。039。 decide=10即進(jìn)行長(zhǎng)話計(jì)費(fèi) when 110= if(money6) then warn=39。 pwrite=39。 reset_ena=39。 else if(money(3 downto 0)0110) then money(3 downto 0)=money(3 downto 0)+4。 else money(7 downto 4)=1001。 end if。 end if。 if(ptime(7 downto 4)=9) then ptime(7 downto 4)=0000。 else ptime(7 downto 4)=ptime(7 downto 4)+1。 第 8 頁 else ptime(3 downto 0)=ptime(3 downto 0)+1。 warn=39。 pwrite=39。 reset_ena=39。 end if。 ptime=ptime。 else pwrite=39。寫完一次卡 end if。 warn=39。 reset_ena=39。 pwrite=39。 end if。 end process。event and clk=39。) then if(warn=39。) then temp=temp+1。 end if。139。 pcut=39。 end if。039。039。039。039。 end if。 end process。139。039。 pwarn=warn。 該模塊的程序包含 3 個(gè)進(jìn)程模塊,第一個(gè)進(jìn)程是一個(gè) 60 進(jìn)制計(jì)數(shù)器,在時(shí)鐘周期的上升沿觸發(fā),主要用于判 斷是否計(jì)滿一分鐘,以便開始讀寫 IC 卡,對(duì)其進(jìn)行扣費(fèi)和計(jì)時(shí)。另外,最主要的是還能實(shí)時(shí)監(jiān)測(cè)用戶卡內(nèi)余額是否足以 繼續(xù)進(jìn)行通話,如果余額不足,將 warn 信號(hào)置 1,即發(fā)出告警信號(hào)提醒用戶,并將在 15 秒后強(qiáng)行切斷通話。 第三個(gè)進(jìn)程是用于當(dāng)用戶余額不足時(shí),系統(tǒng)發(fā)出提示信號(hào)后, 在一定時(shí)間后便 開始強(qiáng)制中斷通話。在此條件下對(duì)計(jì)費(fèi)計(jì) 第 10 頁 時(shí)模塊進(jìn)行波形仿真 ,其結(jié)果如圖 32 所示。 由于用戶卡內(nèi)只有 3 元,如果用戶撥打的是長(zhǎng)途電話 ( 元 /分鐘 ),故用戶一共只能通話 5 分鐘,因此其仿真結(jié)果是正確的。由于 8 位數(shù)碼管需要采用動(dòng)態(tài)掃描顯示,以便不同的各個(gè)數(shù)碼管顯示的數(shù)據(jù)各自不同,因此該模塊需要包含 數(shù)據(jù)選擇器、 38 譯碼電路 、模 8 計(jì)數(shù)器 、 LED 顯示譯碼器 4 個(gè)子模塊。 圖 33 顯示模塊的系統(tǒng)方框圖 ① 在外部時(shí)鐘 clk_1k 的作用下,八進(jìn)制計(jì)數(shù)器的輸出從 000 到 111 依次循環(huán)變化,輸出信號(hào)為三位數(shù)據(jù)寬度的 sel,信號(hào) sel 經(jīng)過 38 譯碼電路選通一個(gè) LED數(shù)碼管,同時(shí)它還作為數(shù)據(jù)選擇器的選擇信號(hào),用來選擇對(duì)應(yīng)位的數(shù)據(jù)并將其轉(zhuǎn)換為 4 位矢量,最后將數(shù)據(jù)選擇器的輸出 dout[3..0]送到 七 段顯示譯碼電路的輸入端口,將其轉(zhuǎn)換成用來點(diǎn)亮 LED 數(shù)碼管的 de_segment 信號(hào)。 use 。 entity IC_count8 is port(clk_1k: in std_logic。 end IC_count8。 begin process(clk_1k) begin 第 12 頁 if(clk_1k39。139。039。 else sel_tmp=sel_tmp+1。 end if。 end process。 ② 數(shù)據(jù)選擇器的功能是,根據(jù)八進(jìn)制計(jì)數(shù)器的計(jì)數(shù)輸出的選擇信號(hào)來 選擇對(duì)應(yīng)的計(jì)費(fèi)、計(jì)時(shí)數(shù)據(jù),并送至七段顯示譯碼電路進(jìn)行顯示。其 VHDL 源代碼 (): 數(shù)碼管段選掃描模塊 library ieee。 use 。 entity segscan is po
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1