1、 STD_LOGIC; SIGNAL beep5 : SIGNAL cnt_beep4 : integer range 0 to 4; SIGNAL beep4,beep2 : SIGNAL cnt10Hz : integer range 0 to 19; SIGNAL clk_10Hz : SIGNAL clk_5Hz : SIGNAL reset_delay : SIGNAL reset_cnt : integer range 0 to 5;begin process(clk, reset) begin if( clkevent and clk=1 ) then if( en_5ms= i
2、f( cnt10Hz19 ) then cnt10Hz = cnt10Hz+1; else= 0; clk_5Hz = not clk_5Hz; end if; 10 ) then clk_10Hz = ;0 end if; end if; end process; process(clk_10Hz, reset) if( reset= reset_cnt reset_delay elsif( clk_10Hzevent and clk_10Hz= if( reset_cnt5 ) then reset_cnt = reset_cnt+1; reset_delay else= reset_cn
3、t; process(clk_5Hz, reset, cnt_alarmin, alarmin, cnt_beep4) or (cnt_alarmin= and alarmin=) then cnt_beep4 beep4 elsif( clk_5Hzevent and clk_5Hz= if( cnt_beep44 ) then cnt_beep4 beep4 beep2 when 3 = when 4 = when others = end case; process(timein) case timein is when X59_59 | X59_5659_5759_58 = freq
4、beep5 -1kHz when others = -不响 - 计数器闹铃优先级最高,时间闹铃优先级次之,整点报时闹铃优先级最低。 - 当计数器时间到闹铃时,时间闹铃和整点报时闹铃被屏蔽, - 当时间闹铃正在进行时,整点报时闹铃被屏蔽。 alarm_out = ( (not reset) and tone_H -全局清零的时候响 ) or ( reset_delay and ( (not cnt_alarmin) and (not alarmin) and is_need_alarm and beep5 and (clk_1Hz) and (not freq) and tone_L) or (
5、freq and tone_H) -整点报时 or (not cnt_alarmin) and alarmin and tone_L and clk_10Hz and beep4) -普通闹铃 or (cnt_alarmin and tone_L and beep2) -计数器闹铃 ) );end ARCHITECTURE;library IEEE;use IEEE.STD_LOGIC_1164.all;package ascii_table is constant sp : std_logic_vector(7 downto 0) := x20 -空格 constant gantanhao
6、:21 -感叹号 ! constant shuangyinhao :22 -双引号 constant jinghao :23 -井号 # constant dollar :24 -美元符号 $ constant baifenhao :25 -百分号 % constant dizhi :26 -地址符号 & constant youdanyinhao :27 -右单引号 constant zuokuohao :28 -左括号 ( constant youkuohao :29 -右括号 ) constant chenghao :2a -乘号 * constant jiahao :2b -加号 +
7、constant douhao :2c -逗号 , constant jianhao :2d -减号 - constant xiaoshudian :2e -小数点 . constant fanxiegang :2f -反斜杠 / constant n0 :30 -数字 0 constant n1 :31 -数字 1 constant n2 :32 -数字 2 constant n3 :33 -数字 3 constant n4 :34 -数字 4 constant n5 :35 -数字 5 constant n6 :36 -数字 6 constant n7 :37 -数字 7 constant
8、 n8 :38 -数字 8 constant n9 :39 -数字 9 constant maohao :3a -冒号 : constant fenhao :3b -分号 ; constant xiaoyuhao :3c -小于号 constant wenhao :3f -问号 ? constant huaa :40 -花a constant uA :41 -大写 A constant uB :42 -大写 B constant uC :43 -大写 C constant uD :44 -大写 D constant uE :45 -大写 E constant uF :46 -大写 F cons
9、tant uG :47 -大写 G constant uH :48 -大写 H constant uI :49 -大写 I constant uJ :4a -大写 J constant uK :4b -大写 K constant uL :4c -大写 L constant uM :4d -大写 M constant uN :4e -大写 N constant uO :4f -大写 O constant uP :50 -大写 P constant uQ :51 -大写 Q constant uR :52 -大写 R constant uSS :53 -大写 S constant uT :54 -
10、大写 T constant uU :55 -大写 U constant uV :56 -大写 V constant uW :57 -大写 W constant uX :58 -大写 X constant uY :59 -大写 Y constant uZ :5a -大写 Z constant zuozhongkuohao :5b -左中括号 constant renminbi :5c -人民币 ¥ constant youzhongkuohao :5d -右中括号 constant shangjianhao :5e -上尖号 constant xiahuaxian :5f -下划线 _ cons
11、tant zuodanyinhao :60 -左单引号 constant aa :61 -小写 a constant b :62 -小写 b constant c :63 -小写 c constant d :64 -小写 d constant e :65 -小写 e constant f :66 -小写 f constant g :67 -小写 g constant h :68 -小写 h constant i :69 -小写 i constant j :6a -小写 j constant k :6b -小写 k constant l :6c -小写 l constant m :6d -小写 m constant n :6e -小写 n constant o :6f -小写 o constant p :70 -小写 p constant q :71 -小写 q constant r :72 -小写 r constant s :73 -小写 s constant t :74 -小写 t constant u :75 -小写 u constant v :76 -小写 v constant w :77 -小写 w constant x :78 -小写 x constant y :79 -小写 y constant z :7a -小写 z constant zuodakuo
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1