亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cola.vhd

?? 三十個vhdl源碼
?? VHD
字號:
----libray and package declaraction
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
use work.my_pkg.all;--package including 'debounce' component
----input and output pins declaraction
Entity Vendor is
  Port(       reset:in std_logic;--power reset to another buying 
                clk:in std_logic;--system clock 1KHz
             ok_buy:in std_logic;--push button to confirm buying
             coin_5:in std_logic;--push button to throw coin 5 dollar
            coin_10:in std_logic;--push button to throw coin 10 dollar
        select_cola:in std_logic;--push button to choose drink cola
        select_diet:in std_logic;--push button to choose drink diet
         cancel_buy:in std_logic;--push button to cancel buying
        led_cola_ok:out std_logic;--led to show cola available
        led_diet_ok:out std_logic;--led to show diet available
       led_cola_sel:out std_logic;--led to show cola choosen
       led_diet_sel:out std_logic;--led to show diet choosen 
            led_buy:out std_logic;--led to show buying confirmed
         led_cancel:out std_logic;--led to show buying canceled
           led_five:out std_logic_vector(2 downto 0);--leds to show coin_five numbers
            led_ten:out std_logic_vector(1 downto 0);--leds to show coin_ten numbers
    led_five_return:out std_logic_vector(2 downto 0);--leds to show coin_five returned
     led_ten_return:out std_logic_vector(1 downto 0);--leds to show coin_ten returned            
       led_cola_out:out std_logic;--led to show cola been delivered 
       led_diet_out:out std_logic);--led to show diet been delivered
end;
----define the signal_structure and _flow of the device 
Architecture vendor_arch of vendor is
--global signals flowing among different circuit blocks
  signal ok:std_logic;--edged ok_buy   
  signal cancel:std_logic;--edged cancel_buy 
  signal money_ok:std_logic;--signal for sufficient money
  signal return_clk:std_logic;--twinkling signal for coin returned
  signal cola_choice:std_logic;--to maintain the cola_selection status 
  signal diet_choice:std_logic;--to maintain the diet_selection status   
  signal total_amount_five:integer range 0 to 15;--total amount of coin five(maxi.=15)  
  signal total_amount_ten:integer range 0 to 20;--total amount of coin ten(maxi.=20)  
  signal cola_out:std_logic;--signal shown cola have been delivered  
  signal diet_out:std_logic;--signal shown diet have been delivered 
begin
----to generate 4Hz return_clk via dividing 1024Hz clock by 256
return_clock:Block
  Signal count:std_logic_vector(7 downto 0);--free count from 0 to 256
Begin
  Process(reset,clk)
  Begin 
    if reset = '1' then count<="00000000";
                        return_clk<='0';
    elsif rising_edge(clk) then
       count <= count + "00000001" ;
       if count(7)='1' then return_clk<='1';
                       else return_clk<='0';
       end if;
    end if; 
  end process;
end block;
----to count the number and amount of coin 10 and light the leds
coin_10_counting:Block
  signal coin10:std_logic;--cleared coin_10 signal to count push-button frequency
  signal no_coin_ten:integer range 0 to 2;--no. of thrown coin ten(maxi.=2)  
begin
  u1:debounce port map(clk=>clk,ext=>coin_10,push_out => coin10); 
  Process(reset,coin10)
  begin
    if reset = '1' then total_amount_ten<=0;
                        no_coin_ten<= 0;
                        led_ten<= "00";                                           
    elsif rising_edge(coin10) then--triggered by edged coin10 signal
          total_amount_ten<=total_amount_ten+10;
          if no_coin_ten<2 then led_ten(no_coin_ten) <= '1';  
                                no_coin_ten <= no_coin_ten + 1;
                           else no_coin_ten<=2;--(maxi. no of coin 10=2)
          end if;       
    end if;
  end process;        
end block;
----to count the number and amount of coin 5 and light the leds
coin_5_counting:Block
  signal coin5:std_logic;--cleared coin_5 signal to count push-button frequency  
  signal no_coin_five:integer range 0 to 3;--no. of thrown coin five(maxi.=3)  
begin
  u2:debounce port map(clk=>clk,ext=>coin_5,push_out => coin5);    
  Process(reset,coin5)
  begin
    if reset = '1' then total_amount_five<=0;
                        no_coin_five<= 0;
                        led_five<= "000";                                           
    elsif rising_edge(coin5) then--triggered by edged coin10 signal
          total_amount_five<=total_amount_five+5;
          if no_coin_five<3 then led_five(no_coin_five) <= '1';  
                                 no_coin_five <= no_coin_five + 1;
                            else no_coin_five<=3;--(maxi. no of coin 5=3)
          end if;       
    end if;
  end process;        
end block;
----to select cola or diet
select_drink:block
begin
  Process(reset,clk)
  begin
    if reset = '1' then led_cola_sel<='0';
                        led_diet_sel<='0';
    elsif rising_edge(clk) then
          if select_cola='1' then  led_cola_sel<='1';
                                   led_diet_sel<='0';--exclusive double choices
                                   cola_choice<='1';--to maintain the cola_selection status
                                   diet_choice<='0';--exclusive double choices                                                                      
          end if;
          if select_diet='1' then  led_cola_sel<='0';--exclusive double choices
                                   led_diet_sel<='1';
                                   diet_choice<='1';--to maintain the diet_selection status
                                   cola_choice<='0';--exclusive double choices                                                                    
          end if;
    end if;
  end process;
end block;  
----to check total amount and decide returned coins and twinkle the leds
coin_returned:Block
  signal total_amount:integer range 0 to 35;--(maxi. total amount=35)
begin
  Process(reset,clk)
  begin
    if reset = '1' then total_amount<=0;
                        money_ok<='0';
                        led_five_return<= (others =>'0');
                        led_ten_return<= (others =>'0');                        
    elsif rising_edge(clk) then
      total_amount<=total_amount_ten + total_amount_five;
      if total_amount >=15 then money_ok<='1';
                           else money_ok<='0';
      end if;
      if (cancel='1') then--if cancelled, return all coins
         for i in 0 to 2 loop
             led_five_return(i)<=return_clk;
         end loop; 
         for i in 0 to 1 loop
             led_ten_return(i)<=return_clk;
         end loop; 
      elsif (diet_out='1' or cola_out='1') then--return coins after drink delivered
        case total_amount is
        When 0 to 14 => for i in 0 to 2 loop
                          led_five_return(i)<=return_clk;
                        end loop;
                        for i in 0 to 1 loop
                          led_ten_return(i)<=return_clk;
                        end loop; 
        when 15 => null;
        when 20 => led_five_return(0)<=return_clk;
        when 25 => led_ten_return(0)<=return_clk;
        when 30 => led_ten_return(1)<=return_clk;
                   led_five_return(1)<=return_clk;                               
        when others=> led_ten_return(0)<=return_clk;
                      led_ten_return(1)<=return_clk;
        end case;
      end if;
    end if;
  end process;        
end block;
----to check confirming or canceling buying
ok_or_cancel: block
begin
  p1:process(reset,ok_buy)--to maintain the confirming status
  begin
    if reset = '1' then ok<='0';
                        led_buy<='0';
    elsif rising_edge(ok_buy) then
                   ok<='1';
                   led_buy<='1'; 
    end if;
  end process; 
  p2:process(reset,cancel_buy)--to maintain the canceling status
  begin
    if reset = '1' then cancel<='0';
                        led_cancel<='0'; 
    elsif rising_edge(cancel_buy) then
                  cancel<='1';
                  led_cancel<='1';                  
    end if;
  end process;   
end block;
----to deliver the selected drink and book the remaining number
give_check: block
  signal no_cola:integer range 0 to 20;--bottle no. of remaining cola
  signal no_diet:integer range 0 to 20;--bottle no. of remaining diet
begin
  cola_out<='1' when (money_ok='1' and ok='1' and cola_choice='1')
       else '0';--to deliver cola if necessary
  led_cola_out<=cola_out;   
  diet_out<='1' when (money_ok='1' and ok='1' and diet_choice='1')
       else '0';--to deliver diet if necessary
  led_diet_out<=diet_out;
  cola:Process(reset,cola_out)--to book the bottle no. of remaining cola
  begin
    if reset = '1' then no_cola<=20;
                        led_cola_ok<='1'; 
    elsif rising_edge(cola_out) then
          no_cola<=no_cola-1;
          if no_cola=0 then led_cola_ok<='0';--to show cola empty status
                       else led_cola_ok<='1';          
          end if;
    end if;
  end process;
  diet:Process(reset,diet_out)--to book the bottle no. of remaining diet
  begin
    if reset = '1' then no_diet<=20;  
                        led_diet_ok<='1';   
    elsif rising_edge(diet_out) then
          no_diet<=no_diet-1;
          if no_diet=0 then led_diet_ok<='0';--to show diet empty status
                       else led_diet_ok<='1';
          end if;
    end if;
  end process;  
end block;
-----------------------------------------------------
end vendor_arch;
------------------------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品色呦呦| 久久先锋影音av鲁色资源网| va亚洲va日韩不卡在线观看| 国产真实乱子伦精品视频| 奇米一区二区三区av| 老司机午夜精品| 韩国成人在线视频| 成人污视频在线观看| 91小视频免费观看| 欧美制服丝袜第一页| 欧美日韩高清一区二区不卡| 欧美老女人在线| 日韩精品一区在线| 欧美高清在线精品一区| 亚洲丝袜另类动漫二区| 夜夜夜精品看看| 日本欧美一区二区三区乱码| 美女脱光内衣内裤视频久久网站| 国产一区二区看久久| 成人午夜激情在线| 欧美优质美女网站| 日韩一区二区免费视频| 欧美激情综合网| 一区二区三区免费网站| 日韩成人免费看| 国产成人精品网址| 欧美日韩精品一区二区在线播放| 日韩欧美电影在线| 欧美国产欧美综合| 午夜精品久久久久久久 | 亚洲欧美偷拍卡通变态| 日韩—二三区免费观看av| 国产麻豆日韩欧美久久| 色综合天天综合色综合av| 欧美高清hd18日本| 国产日韩欧美麻豆| 婷婷六月综合亚洲| av成人老司机| 精品成人免费观看| 一区二区三区四区亚洲| 精品一区二区三区欧美| 色哦色哦哦色天天综合| 精品国产网站在线观看| 亚洲综合男人的天堂| 国产乱码精品一品二品| 欧美日韩国产高清一区二区三区 | 欧美精品一二三四| 国产精品视频看| 麻豆成人久久精品二区三区红 | 成人免费视频视频| 91精品国产综合久久福利软件 | 亚洲黄色片在线观看| 国产精品一区久久久久| 91精品国产色综合久久不卡电影 | 91视频在线观看| 欧美激情一区二区三区四区| 美国一区二区三区在线播放| 色综合中文综合网| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 久久精品噜噜噜成人av农村| 欧洲av一区二区嗯嗯嗯啊| 国产精品青草综合久久久久99| 韩国一区二区三区| 日韩一区二区三区精品视频| 亚洲国产精品一区二区尤物区| 不卡av电影在线播放| 久久精品夜色噜噜亚洲a∨| 免费黄网站欧美| 3d动漫精品啪啪| 日本不卡中文字幕| 日韩欧美国产精品| 另类专区欧美蜜桃臀第一页| 欧美一级精品在线| 美女一区二区久久| 久久这里只有精品6| 国产成人免费视频一区| 国产欧美日韩不卡| 99精品偷自拍| 亚洲精品日韩一| 欧美日韩高清一区二区三区| 亚洲18色成人| 日韩一区二区精品葵司在线 | 久久美女艺术照精彩视频福利播放| 人禽交欧美网站| 欧美一二三区在线观看| 久久97超碰色| 久久久午夜精品理论片中文字幕| 国产盗摄一区二区| 亚洲国产成人午夜在线一区| 91小视频在线免费看| 亚洲一区免费视频| 日韩欧美国产三级电影视频| 国产精品456露脸| 日韩一区欧美一区| 欧美性一级生活| 捆绑调教一区二区三区| 久久免费偷拍视频| 96av麻豆蜜桃一区二区| 一区二区三区欧美日韩| 日韩欧美一级特黄在线播放| 国产成人综合网| 亚洲国产精品自拍| 26uuu亚洲综合色| 色综合久久中文综合久久牛| 日韩电影在线一区| 中文字幕av在线一区二区三区| 日本久久电影网| 男女视频一区二区| 亚洲人成精品久久久久| 欧美一级艳片视频免费观看| 国产乱码精品一区二区三区av| 亚洲欧美另类小说| wwwwww.欧美系列| 欧美综合亚洲图片综合区| 精品亚洲porn| 亚洲午夜三级在线| 国产精品久久久久影院老司| 日韩午夜在线影院| 91在线一区二区| 国产一区二区91| 日韩不卡免费视频| 亚洲永久精品大片| 国产精品久久久久一区二区三区共| 777午夜精品视频在线播放| 91美女在线视频| 国产成人一级电影| 麻豆精品一区二区综合av| 亚洲最色的网站| 国产精品久久久久久久浪潮网站| 日韩丝袜情趣美女图片| 欧美日韩高清一区二区不卡| 色婷婷亚洲一区二区三区| 国产福利一区二区三区视频| 蜜臀av性久久久久av蜜臀妖精| 亚洲一区二区三区三| 亚洲色图20p| 国产午夜亚洲精品羞羞网站| 欧美成人一区二区三区在线观看| 欧美精品久久99| 4438成人网| 制服丝袜中文字幕亚洲| 欧美色精品天天在线观看视频| 99精品视频在线观看免费| 国产91在线观看丝袜| 国产九色精品成人porny | 99国内精品久久| 成人亚洲一区二区一| 国产一区二区三区四区五区入口 | 91精品国产美女浴室洗澡无遮挡| 色偷偷久久人人79超碰人人澡| 成人午夜视频在线观看| caoporm超碰国产精品| 91污在线观看| 91啪九色porn原创视频在线观看| 成人免费视频视频| jlzzjlzz欧美大全| 成人激情文学综合网| 99免费精品视频| 色哟哟一区二区在线观看| 99国产精品国产精品久久| 91在线视频观看| 色综合欧美在线| 欧美日韩在线电影| 51午夜精品国产| 日韩小视频在线观看专区| 欧美va天堂va视频va在线| 久久久午夜电影| 1000精品久久久久久久久| 一二三四区精品视频| 日韩黄色小视频| 国产一区二区三区综合| 成人va在线观看| 欧美在线999| 精品99999| 日韩美女久久久| 蜜臀av一区二区| 高潮精品一区videoshd| 91丨porny丨在线| 欧美日韩一区二区三区视频| 日韩精品一区二区三区视频| 国产精品情趣视频| 香蕉影视欧美成人| 激情综合亚洲精品| 色婷婷亚洲一区二区三区| 日韩欧美色电影| 国产精品美女久久久久久久| 日韩国产精品大片| 成人国产精品免费网站| 欧美日韩视频在线观看一区二区三区| 日韩久久久精品| 综合欧美亚洲日本| 激情都市一区二区| 在线观看视频一区二区欧美日韩| 久久亚洲综合色一区二区三区 | 国内精品自线一区二区三区视频| 91天堂素人约啪| 26uuu欧美| 亚洲午夜成aⅴ人片| av在线不卡观看免费观看| 精品国产乱码久久久久久闺蜜|