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

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

?? 一個游戲程序.vhd

?? EDA基礎教程
?? VHD
?? 第 1 頁 / 共 2 頁
字號:
-- --   Copyright (c) 1993,1994 by Exemplar Logic, Inc.  All Rights Reserved.---- This source file may be used and distributed without restriction    -- provided that this copyright statement is not removed from the file  -- and that any derivative work contains this copyright notice.         -----------------  This is a synthesizable description that implements an emulator --  of the Mancala game (African beans game).----  Description of the Hardware-----------------------------------  The hardware for the game includes a number of displays, each with a button and--  a light, that each represent a 'bin' that can store marbles (beans). ----  The display indicates the number of marbles in each bin at any given time. --  The light indecates that the present bin is not empty and that pushing the --  button is a valid move in the game.----  The button for each display indicates that a player takes the marbles from --  the selected bin, and takes them in his hand. The hand is represented by a --  diplay itself (no button).----  Each player has a home bin, located on opposite sides of the game. The home --  bin is also represented by a display. There should not be a button on the --  home bins, since the game does not allow the removal of marbles from the home--  bins.----  Besides this, the game has a button to start the game, and a reset for power-up--  purposes.----  Here is a picture that represents the hardware setup of the game :------  *  == Light for valid move or to indicate the player who is active--  O  == Button to make move--  _-- | | --  -  == 7 - segment display-- |_|----                           work bins--                  *   O     *   O     *   O     *   O--                  _   _     _   _     _   _     _   _--                 | | | |   | | | |   | | | |   | | | | --                  -   -     -   -     -   -     -   ---       *         |_| |_|   |_| |_|   |_| |_|   |_| |_|         *--     _   _                                                   _   _--    | | | |                                                 | | | |--     -   -                                                   -   ---    |_| |_|                                                 |_| |_|---- home bin LEFT                                           home bin right--                  *   O     *   O     *   O     *   O            --                  _   _     _   _     _   _     _   _--                 | | | |   | | | |   | | | |   | | | | --                  -   -     -   -     -   -     -   ---                 |_| |_|   |_| |_|   |_| |_|   |_| |_|----                            work bins----     _   _--    | | | |--     -   -                                              O  Start Game--    |_| |_|----    Hand bin------ The Rules of the game ----------------------------    At the start of the game, the left player is active and can make a move.--    The left player selects a bin (by pressing the corresponding button).--    The machine will move the marbles from the bin (display) to the hand (diplay)--    and drop one marble in each successive bin (clockwise) from the hand, --    starting with the bin clock-wise adjecent to the selected bin.--    A marble is never dropped in a opponents home bin (will be skipped).----    If the last marble from the hand is dropped in an empty bin, the players--    switch turns, and it is the other players turn to make a move.----    If the last marble from the hand is dropped in the players home bin,--    the player can make another move.----    If the last marble from the hand is dropped in a non-empty work bin,--    all the marbles from that bin will be moved back to the hand and the --   game proceeds.----    The game ends if there are no more marbles in any of the work bins.----    The winner of the game is the player who has most marbles in his/her--    home bin at the end of the game.--------  About the design------------------------    The design contains a controller and a data path. The controller contains --    a state machine that defines the overall state of the game (waiting for a--    move, end of the game, playing). --    The controller also has a register that defines which bin is active at any--    point in time during active playing. ----    The controller provides signals for the data path to decrement the hand --    marble count, or load the hand with the selected work bin count, or indecate--    that the game is over and a winner should be defined etc.----    The data path contains a register for each bin in the game. --    The number of bins is easily programmable by setting a integer constant.--    The data path also contains counters to decrement the hand marble count--    or increment the bin marble counts.----    The data path provides signals for the controller to indicate that the --    hand bin is empty, or which of the work bins is empty.--   --    The work bin registers are loaded with a equal number of marbles at the start --    of the game. The total number of marbles in the game is programmable by setting--    a generic in the top entity.----    The data path also includes light drivers for the lights on each button that --    indicate a valid move, and the lights that indicate which player is active.--    Two extra signals are generated by the data path that let the home bin --    display of the winner of the game blink on and off (at the end of the game).----    The design does not include a merry-go-round display driver. This is done--    outside this design, on the Aptix board. ----    The design does also not include a 18 bit clock devider that provides a --    vary slow ticking clock to let humans follow the moves of the machine --    cycle by cycle.----    library ieee ;use ieee.std_logic_1164.all ;package mancala_pack is   type boolean_array is array (natural range <>) of boolean ;   type player_t is (LEFT, RIGHT, BOTH, NEITHER) ;   -- Define the number of bins in the game here.   -- This include the two home bins   constant nr_of_bins : natural := 10 ;    -- Define the indexes of the two home bins    constant OUTER_LEFT : natural := 0 ;   constant OUTER_RIGHT : natural := nr_of_bins/2 ;    -- Make a 'mask' constant that eliminates the home bins   constant not_home_bins : boolean_array (nr_of_bins-1 downto 0) :=        (OUTER_LEFT=>FALSE, OUTER_RIGHT=>FALSE, OTHERS=>TRUE) ;   -- Component Declaration of the controller of the game   component control        generic (nr_of_bins : natural := 32) ;       port (start_game : in boolean ;           reset, clk : in std_logic ;           buttons : in boolean_array (nr_of_bins-1 downto 0) ;           empty_bins : in boolean_array (nr_of_bins-1 downto 0) ;           hand_is_empty : in boolean ;                     active_bin : buffer boolean_array (nr_of_bins-1 downto 0) ;           decrement_hand : out boolean ;           load_hand_with_active_bin : out boolean ;                the_player : out player_t ;           end_of_the_game : out boolean ;           waiting_for_move : out boolean       ) ;   end component ;end mancala_pack ;library ieee ;use ieee.std_logic_1164.all ;use work.mancala_pack.all ;entity control is   generic (nr_of_bins : natural := 10) ;   port (start_game : in boolean ;         reset, clk : in std_logic ;         buttons : in boolean_array (nr_of_bins-1 downto 0) ;         empty_bins : in boolean_array (nr_of_bins-1 downto 0) ;         hand_is_empty : in boolean ;                   active_bin : buffer boolean_array (nr_of_bins-1 downto 0) ;         decrement_hand : out boolean ;         load_hand_with_active_bin : out boolean ;         the_player : out player_t ;         end_of_the_game : out boolean ;         waiting_for_move : out boolean    ) ;end control ;architecture exemplar of control is    type state_t is (PLAY, WAIT_FOR_MOVE, END_OF_GAME);   -- The state variables for the controller state machine   signal present_state, next_state : state_t ;   -- A separate register (one-hot) defines which bin is active   signal present_active_bin : boolean_array(nr_of_bins-1 downto 0) ;   signal player : player_t ;   signal switch_player : boolean ;   signal last_bin_was_empty, next_bin_is_empty : boolean ;   -- Shift routine to shift to the next bin.   function shift(sel : boolean_array) return boolean_array is   begin      -- shift this register to the right, roll over right bit to left      return sel(sel'right) & sel(sel'left downto sel'right+1);    end ;   -- General routine to check if a boolean array contains all 'false' elements.   function is_empty (bins : boolean_array) return boolean is      constant empty : boolean_array (bins'range) := (others=>false) ;   begin       return (bins = empty) ;   end ;begin   process (clk, reset)   begin       if (reset='1') then           present_state <= END_OF_GAME ;           last_bin_was_empty <= FALSE ;           present_active_bin <= (others=>false) ;       elsif (clk'event and clk='1') then           present_state <= next_state ;           last_bin_was_empty <= next_bin_is_empty ;           present_active_bin <= active_bin ;       end if ;   end process ;   process (start_game,present_state,hand_is_empty,empty_bins,buttons,            present_active_bin, last_bin_was_empty, player)       variable next_active_bin : boolean_array (present_active_bin'range) ;   begin       load_hand_with_active_bin <= FALSE ;       decrement_hand <= FALSE ;       switch_player <= FALSE ;       waiting_for_move <= FALSE ;       next_bin_is_empty <= FALSE ;       end_of_the_game <= FALSE ;       case present_state is         when PLAY =>           if (hand_is_empty) then               -- No more marbles in the hand.               if (is_empty (present_active_bin AND not_home_bins)) then                  -- Stop if we drop the last marble in our own bin                   next_state <= WAIT_FOR_MOVE ;                   active_bin <= (others=>false) ;               elsif (last_bin_was_empty) then                  -- Stop and switch players if we drop the last marble                  -- in an empty bin                   switch_player <= TRUE ;                   next_state <= WAIT_FOR_MOVE ;                   active_bin <= (others=>false) ;               else                   -- Continue if last marble dropped in a non-empty bin.                  -- Re-load hand with the full bin contents.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日精品一区视频| 亚洲人成亚洲人成在线观看图片 | 99re热这里只有精品视频| 亚洲精品一区二区三区精华液| 欧美96一区二区免费视频| 日韩一区二区免费在线电影| 久久激情综合网| 国产亚洲欧美日韩日本| 成人午夜伦理影院| 亚洲激情成人在线| 在线成人小视频| 黄页视频在线91| 亚洲欧洲日韩av| 欧美精选午夜久久久乱码6080| 美日韩一区二区三区| 久久精品人人爽人人爽| 91看片淫黄大片一级在线观看| 一区二区免费看| 日韩女同互慰一区二区| 东方aⅴ免费观看久久av| 日韩伦理免费电影| 91麻豆精品国产91久久久使用方法 | 在线亚洲欧美专区二区| 日韩成人伦理电影在线观看| 日韩精品一区二区三区中文精品| 成人一级视频在线观看| 亚洲午夜影视影院在线观看| 日韩欧美亚洲一区二区| 91女厕偷拍女厕偷拍高清| 天堂久久一区二区三区| 国产精品全国免费观看高清| 欧美精品色综合| 成人h精品动漫一区二区三区| 亚洲一二三四区| 久久精品一区四区| 欧美高清dvd| 99久久婷婷国产| 麻豆专区一区二区三区四区五区| 亚洲六月丁香色婷婷综合久久 | 欧美日韩一级黄| 国产精品456露脸| 五月婷婷欧美视频| 欧美激情一区不卡| 欧美一级高清大全免费观看| 成人a免费在线看| 狠狠色综合日日| 亚洲午夜电影网| 亚洲美女少妇撒尿| 欧美韩日一区二区三区四区| 欧美电影免费观看高清完整版| 91久久线看在观草草青青| 国产91丝袜在线播放0| 蜜桃在线一区二区三区| 天天综合天天做天天综合| 亚洲精品乱码久久久久久日本蜜臀 | 另类小说欧美激情| 亚洲一区二区三区视频在线| 中文字幕一区二区在线播放| 久久久综合视频| 精品国产网站在线观看| 欧美一区二区三区免费视频| 亚洲国产精品黑人久久久 | 国产精品国产三级国产普通话三级 | 精品国产伦一区二区三区免费 | 91在线丨porny丨国产| 91国产免费观看| 国产 欧美在线| 国产一区二区电影| 久久国产欧美日韩精品| 日本在线不卡视频| 日本成人在线一区| 蓝色福利精品导航| 免费在线观看一区| 美女视频一区二区| 亚洲专区一二三| 中文字幕一区av| 国产精品视频在线看| 久久久99精品免费观看| 国产日韩精品久久久| 国产欧美一区二区在线| 久久久久久久久久久久电影| 26uuu国产一区二区三区| 欧美精品一区二区久久久| 精品国产区一区| 国产亚洲成av人在线观看导航| 国产日本欧美一区二区| 国产精品午夜免费| 亚洲色图都市小说| 亚洲国产成人高清精品| 日韩av一区二区三区| 伦理电影国产精品| 国产精品伊人色| 99精品久久99久久久久| 日本国产一区二区| 制服视频三区第一页精品| 日韩欧美精品在线| 久久色在线观看| 国产精品精品国产色婷婷| 依依成人综合视频| 蜜臀91精品一区二区三区| 国产成人一区二区精品非洲| 91在线观看免费视频| 欧美日韩一区二区不卡| 欧美r级在线观看| 国产精品久久久久久久久快鸭| 一区二区三区中文字幕| 美女在线观看视频一区二区| 国产自产v一区二区三区c| 91小视频在线| 日韩视频在线观看一区二区| 久久精品一区二区三区不卡| 欧美日韩大陆一区二区| 精品日韩一区二区三区免费视频| 久久久久国产精品厨房| 亚洲一区二区三区四区在线观看| 蜜臀久久久久久久| 97超碰欧美中文字幕| 正在播放亚洲一区| 国产精品伦一区| 偷拍自拍另类欧美| 成人午夜精品一区二区三区| 欧美日韩大陆一区二区| 国产精品人成在线观看免费| 琪琪久久久久日韩精品| heyzo一本久久综合| 精品免费视频.| 亚洲一区在线观看免费 | 欧美国产精品专区| 首页国产丝袜综合| 99久久伊人网影院| 精品少妇一区二区三区在线播放 | 99精品桃花视频在线观看| 91精品国产综合久久精品app| 国产精品三级av在线播放| 日韩av午夜在线观看| 色婷婷久久久综合中文字幕| 久久精品亚洲麻豆av一区二区 | 国产日韩欧美精品综合| 午夜av电影一区| 在线视频中文字幕一区二区| 国产欧美一区二区三区鸳鸯浴 | 欧美综合欧美视频| 国产精品久久久久婷婷| 国产一区二区三区在线观看免费视频| 欧美色图在线观看| 1000精品久久久久久久久| 国产麻豆精品视频| 日韩欧美另类在线| 青青青伊人色综合久久| 欧美日韩久久久| 一区二区在线观看视频| 99久久99久久综合| 中文字幕在线观看不卡视频| 懂色av一区二区三区免费看| 久久久欧美精品sm网站 | 不卡高清视频专区| 国产视频911| 国产盗摄视频一区二区三区| 久久亚洲二区三区| 国产毛片精品一区| 久久久久久亚洲综合影院红桃| 免费的国产精品| 欧美一级片在线看| 免费人成在线不卡| 欧美va在线播放| 精品午夜久久福利影院| 欧美大片顶级少妇| 国产在线播精品第三| 久久美女高清视频| 国产成人免费在线| 国产精品色哟哟| 91天堂素人约啪| 亚洲精品老司机| 精品视频一区二区不卡| 天天av天天翘天天综合网色鬼国产| 欧美日韩中文一区| 久久精品国产亚洲5555| 精品日韩99亚洲| 国产美女娇喘av呻吟久久| 久久精品人人做人人爽97| 不卡视频免费播放| 亚洲成人激情社区| 日韩一本二本av| 国产露脸91国语对白| 欧美激情在线一区二区三区| 色综合欧美在线| 日韩av电影天堂| 精品精品国产高清一毛片一天堂| 国产乱码一区二区三区| 亚洲三级在线免费观看| 欧美人动与zoxxxx乱| 国模大尺度一区二区三区| 国产精品视频麻豆| 欧美日韩一区二区欧美激情| 国内精品在线播放| 亚洲乱码一区二区三区在线观看| 欧美精品成人一区二区三区四区| 九九**精品视频免费播放| 国产精品萝li| 91精品国产综合久久久久久久|