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

正文內(nèi)容

基于cpld的出租車計費系統(tǒng)設(shè)計_畢業(yè)設(shè)計論文-資料下載頁

2024-08-31 18:22本頁面

【導(dǎo)讀】基于CPLD的出租車計費器系統(tǒng)設(shè)計

  

【正文】 文件 use 。 use 。 17 entity kmmoney is port( 定義輸入輸出端口 clk :in std_logic。 reset :in std_logic。 timecount:in std_logic。 clkout :in std_logic。 kmt2 :in std_logic_vector(3 downto 0)。 kmt3 :in std_logic_vector(3 downto 0)。 count1 :out std_logic_vector(3 downto 0)。 count2 :out std_logic_vector(3 downto 0)。 count3 :out std_logic_vector(3 downto 0) )。 end kmmoney。 architecture rtl of kmmoney is signal cash:std_logic_vector(11 downto 0)。 signal price:std_logic_vector(3 downto 0)。 signal enable:std_logic。 begin kmmoney1:PROCESS(cash,kmt2) 此進程產(chǎn)生下一進程的敏感信號 begin if cash=000001000000then price=0100。 else price=0100。 end if。 if(kmt2=0011)OR(kmt3=0001)then enable=39。139。 else enable=39。039。 end if。 end process。 kmmoney2:process(reset,clkout,clk,enable,price,kmt2) variable reg2:std_logic_vector(11 downto 0)。 variable clkout_t:integer range 0 to 10。 begin if reset=39。139。then cash=000000000011。 起步費用設(shè)為 3元 elsif clk39。event and clk=39。139。then 判斷是否需要時間計費,每 20s加一元 if timecount=39。139。then 18 reg2:=cash。 if reg2(3 downto 0)+00011001then 產(chǎn)生進位 reg2(7 downto 0):=reg2(7 downto 0)+00000111。 if reg2(7 downto 4)1001then cash=reg2+000001100000。 else cash=reg2。 end if。 else cash=reg2+0001。 end if。 里程計費 elsif clkout=39。139。 and enable=39。139。then if clkout_t=9 then clkout_t:=0。 reg2:=cash。 if 0000amp。reg2(3 downto 0)+price(3 downto 0)00001001then reg2(7 downto 0):= 十位進位 reg2(7 downto 0)+00000110+price。 if reg2(7 downto 4)1001then 百位進位 cash=reg2+000001100000。 else cash=reg2。 end if。 else cash=reg2+price。 end if。 else 對時鐘計數(shù) clkout_t:=clkout_t+1。 end if。 end if。 end if。 end process。 count1=cash(3 downto 0)。 總費用的個位 count2=cash(7 downto 4)。 總費用的十位 count3=cash(11 downto 8)。 總費用的百位 end rtl。 1) TOP 模塊 library ieee。 use 。 19 entity top is port( 定義整個系統(tǒng)的輸入輸出端口 clk :in std_logic。 reset :in std_logic。 start :in std_logic。 stop :in std_logic。 sp :in std_logic_vector(2 downto 0)。 kmt1:out std_logic_vector(3 downto 0)。 kmt2:out std_logic_vector(3 downto 0)。 kmt3:out std_logic_vector(3 downto 0)。 count1:out std_logic_vector(3 downto 0)。 count2:out std_logic_vector(3 downto 0)。 count3:out std_logic_vector(3 downto 0) )。 end top。 architecture rtl of top is 對上述電路模塊進行元件定義 ponent speed is 定義速度模塊 port( clk :in std_logic。 reset:in std_logic。 start:in std_logic。 stop :in std_logic。 sp :in std_logic_vector(2 downto 0)。 clkout:out std_logic )。 end ponent speed。 ponent times is 定義計時模塊 port( clk :in std_logic。 reset:in std_logic。 start:in std_logic。 stop :in std_logic。 sp :in std_logic_vector(2 downto 0)。 timecount:out std_logic )。 end ponent times。 ponent kilometers is 定義計程模塊 port( clkout,reset:in std_logic。 kmt1:out std_logic_vector(3 downto 0)。 20 kmt2:out std_logic_vector(3 downto 0)。 kmt3:out std_logic_vector(3 downto 0) )。 end ponent kilometers。 ponent kmmoney is 定義計費模塊 port( clk :in std_logic。 reset :in std_logic。 timecount:in std_logic。 clkout :in std_logic。 kmt2 :in std_logic_vector(3 downto 0)。 kmt3 :in std_logic_vector(3 downto 0)。 count1 :out std_logic_vector(3 downto 0)。 count2 :out std_logic_vector(3 downto 0)。 count3 :out std_logic_vector(3 downto 0) )。 end ponent kmmoney。 signal clktmp :std_logic。 signal timetmp:std_logic。 signal kmtmp2 :std_logic_vector(3 downto 0)。 signal kmtmp3 :std_logic_vector(3 downto 0)。 begin 使用定義的例化模塊 U1:speed PORT MAP(clk,reset,start,stop,sp,clktmp)。 U2:times PORT MAP(clk,reset,start,stop,sp,timetmp)。 U3:kilometers PORT MAP(clktmp,reset,kmt1,kmtmp2,kmtmp3)。 U4:kmmoney PORT MAP(clk,reset,timetmp,clktmp,kmtmp2,kmtmp3,count1,count2,count3)。 kmt2=kmtmp2。 kmt3=kmtmp3。 end rtl。
點擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1