久久中文视频-久久中文网-久久中文亚洲国产-久久中文字幕久久久久-亚洲狠狠成人综合网-亚洲狠狠婷婷综合久久久久


曙海教育集團(tuán)論壇FPGA專(zhuān)區(qū)FPGA初中級(jí) → FPGA 時(shí)鐘問(wèn)題


  共有8405人關(guān)注過(guò)本帖樹(shù)形打印

主題:FPGA 時(shí)鐘問(wèn)題

美女呀,離線(xiàn),留言給我吧!
wangxinxin
  1樓 個(gè)性首頁(yè) | 博客 | 信息 | 搜索 | 郵箱 | 主頁(yè) | UC


加好友 發(fā)短信
等級(jí):青蜂俠 帖子:1393 積分:14038 威望:0 精華:0 注冊(cè):2010-11-12 11:08:23
FPGA 時(shí)鐘問(wèn)題  發(fā)帖心情 Post By:2010-12-19 14:00:46

剛學(xué)不久~

我要做24H製的時(shí)鐘~但我一直DEBUG~一直用不出來(lái)~

Xilinx ISE 8.2i軟體~

請(qǐng)會(huì)的人幫我看一下哪出錯(cuò)了~謝



library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;


---- Uncomment the following library declaration if instantiating

---- any Xilinx primitives in this code.

--library UNISIM;

--use UNISIM.VComponents.all;


entity CLOCK_00_60 is

    Port ( CLK : in  STD_LOGIC;

           RESET : in  STD_LOGIC;

           ENABLE : out  STD_LOGIC_VECTOR (6 downto 0);

           SEGMENT : out  STD_LOGIC_VECTOR (6 downto 0));

end CLOCK_00_60;


architecture Behavioral of CLOCK_00_60 is

signal SCAN_CLK :STD_LOGIC;

signal COUNT_CLK :STD_LOGIC;

signal DECODE_BCD :STD_LOGIC_VECTOR (3 downto 0);

signal mineable :STD_LOGIC;

signal hreable :STD_LOGIC;

signal POSITION:STD_LOGIC_VECTOR (6 downto 0);

signal DIVIDER:STD_LOGIC_VECTOR (29 downto 1);

signal COUNT_BCD:STD_LOGIC_VECTOR (23 downto 0);


begin

-------------------------------------------------

process (CLK,RESET)

begin

if RESET = '0' then

 DIVIDER <= ( others => '0');

elsif CLK' event and CLK = '1' then

 DIVIDER <= DIVIDER + 1 ;

end if;

end process;

COUNT_CLK<=DIVIDER(24);

SCAN_CLK<=DIVIDER(15);

------------------------------------------------秒

process(RESET,SCAN_CLK)

begin

if RESET = '0' then

 COUNT_BCD <= ( others => '0');

elsif SCAN_CLK' event and SCAN_CLK = '1' then

 if   COUNT_BCD(3 downto 0)= x"9" then

    COUNT_BCD(3 downto 0)<= x"0";

    COUNT_BCD(7 downto 4)<= COUNT_BCD(7 downto 4)+1;

 else

   COUNT_BCD(3 downto 0)<= COUNT_BCD(3 downto 0)+1;

 end if;

end if;

end process;

mineable <= '1' when COUNT_BCD(7 downto 0) = x"59" else '0';

----------------------------------------------------------分


process(RESET,SCAN_CLK)

begin

if RESET = '0' then

 COUNT_BCD <= ( others => '0');

 if mineable = '1' then

elsif SCAN_CLK' event and SCAN_CLK = '1' then

 if   COUNT_BCD(11 downto 8)= x"9" then

    COUNT_BCD(11 downto 8)<= x"0";

    COUNT_BCD(15 downto 12)<= COUNT_BCD(15 downto 12)+1;

 else

   COUNT_BCD(11 downto 8)<= COUNT_BCD(11 downto 8)+1;

 end if;

end if;

end if;

end process;

hreable <= '1' when COUNT_BCD(15 downto 8) = x"59" else '0';

-------------------------------------------------------------時(shí)

process(RESET,SCAN_CLK)

begin

if RESET = '0' then

 COUNT_BCD <= ( others => '0');

  if mineable = '1' and hreable = '1' then

elsif SCAN_CLK' event and SCAN_CLK = '1' then

 if   COUNT_BCD(19 downto 16)= x"9" then

    COUNT_BCD(19 downto 16)<= x"0";

    COUNT_BCD(23 downto 20)<= COUNT_BCD(23 downto 20)+1;

  if   COUNT_BCD(19 downto 16)= x"2" then

   COUNT_BCD(23 downto 20)<= x"0";

 else

   COUNT_BCD(19 downto 16)<= COUNT_BCD(19 downto 16)+1;

  end if;

 end if;

  end if;

end if;

end process;



process(RESET,SCAN_CLK)

begin

if RESET = '0' then

 POSITION <= "1111110";

elsif SCAN_CLK' event and SCAN_CLK = '1' then

 POSITION<="111111"&POSITION(0);

end if;

end process;

ENABLE<=POSITION;

-----------------------------------------------------------

process(POSITION,SCAN_CLK)

begin

case POSITION is

 when "1111110" => DECODE_BCD <=COUNT_BCD(3 downto 0);    --秒

 when "1111101" => DECODE_BCD <=COUNT_BCD(7 downto 4);    --秒

 when "1111011" => DECODE_BCD <=COUNT_BCD(11 downto 8);   --分

 when "1110111" => DECODE_BCD <=COUNT_BCD(15 downto 12);   --分

   when "1101111" => DECODE_BCD <=COUNT_BCD(19 downto 16);   --時(shí)

   when "1011111" => DECODE_BCD <=COUNT_BCD(23 downto 20);   --時(shí)

 when others => null;

end case;

end process;

 

with DECODE_BCD Select

SEGMENT<= "1000000" when X"0",

  "1111001" when X"1",

  "0100100" when X"2",

  "0110000" when X"3",

  "0011001" when X"4",

  "0010010" when X"5",

  "0000010" when X"6",

  "1111000" when X"7",

  "0000000" when X"8",

  "0010000" when X"9",

  "1111111" when others;


end Behavioral;

支持(0中立(0反對(duì)(0單帖管理 | 引用 | 回復(fù) 回到頂部
總數(shù) 20 1 2 下一頁(yè)

返回版面帖子列表

FPGA 時(shí)鐘問(wèn)題








簽名
主站蜘蛛池模板: 99久久精品免费精品国产 | 亚洲黄色第一页 | 成人午夜免费视频毛片 | 亚洲男人天堂网站 | 精品videosex性欧美 | 香蕉99国内自产自拍视频 | 香港一级特黄高清免费 | 亚洲欧美日韩国产一区二区精品 | 精品久久九九 | 国产亚洲福利 | 国产深夜福利视频观看 | 国产猛烈无遮掩视频免费网站男女 | 日本又黄又爽又免费 | 亚洲欧美精品成人久久91 | 日韩欧美国产视频 | 深夜国产成人福利在线观看女同 | 亚洲乱码一区二区三区国产精品 | 中文成人在线 | 91tv成人影院免费 | 国产精品久久久久久麻豆一区 | 韩国理伦一级毛片 | 日韩专区亚洲国产精品 | 男女午夜| 和日本免费不卡在线v | 在线播放性xxx欧美 在线播放亚洲视频 | 久久精品视频一区二区三区 | 超级香蕉97视频在线观看一区 | 国产成人毛片视频不卡在线 | 欧美在线精品一区二区三区 | 午夜爽爽爽男女免费观看hd | 日本午夜高清视频 | 日韩国产在线播放 | 国产成人在线看 | 91精品日本久久久久久牛牛 | 亚洲综合色一区二区三区小说 | 亚洲图片视频在线观看 | 亚欧免费视频 | 国产高清一 | 久久久久女人精品毛片九一 | 久久视频在线播放视频99re6 | 美女视频黄a视频免费全程 美女视频黄a视频免费全过程 |