LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
USE IEEE.std_logic_arith.ALL;
USE IEEE.std_logic_unsigned.ALL;
ENTITY clk_div10 IS
port(clk:IN std_logic;
clk_div:OUT std_logic);
END clk_div10;
ARCHITECTURE rtl OF clk_div10 IS
SIGNAL count:std_logic_vector(2 DOWNTO 0 );
SIGNAL clk_tmp:std_logic;
BEGIN
PROCESS(clk)
BEGIN
IF ( clk'event AND clk ='1') THEN ---上升沿触发;
IF ( count ="100" )THEN ----当count记过五个时钟周期时,clk_tmp反相;
count <= (OTHERS => '0' );
clk_tmp <= NOT clk_tmp;
ELSE
count <= count +1;
END IF;
END IF;
END PROCESS;
clk_div <= clk_tmp;
END rtl;
还没打完,下面还有,
ä½ çé®é¢å¨äºå¯¹EVENTå±æ§çè¿ç¨ï¼è¿ä¸ªå±æ§åªå¯¹PS2INTERUPTIONçåå沿ææï¼èä¸ä¸è½åæ¶åå
¶ä»å¹¶åï¼å 为沿æ¯ä¸ä¸ªç¬é´ï¼å
¶ä»å¯ä»¥çæææ°¸è¿ï¼è¿ç§éæ©å
³ç³»æ¬èº«å°±çç¾ï¼æ以æ æ³ç»¼åã
ä½ å¯ä»¥ç¨ä½ å½åé¨åçæ¶éç¼å²ä¸¤æPS2INTERUPTIONï¼ç¶åç¨æ¶é沿触åå¨ä½ï¼
å½ç¶ï¼éå¯¹ä½ è¿ç§ç¹æ®æ
åµï¼ä½ ä¹å¯ä»¥ç´æ¥æ¶éä¸ï¼LITTLED <= PS2INTERUPTION2ï¼äº¦å¯é¿å
äºç¨³æï¼
æ¥ä¸æ¥è¿æå¢ ä½ çä¸é®ç®± æç»ä½ å ä½ å¸®å¸®å¿å
接下来还有呢 你留下邮箱 我给你发 你帮帮忙呗