{"id":2197,"date":"2019-03-11T00:47:34","date_gmt":"2019-03-11T00:47:34","guid":{"rendered":""},"modified":"2019-03-11T08:47:53","modified_gmt":"2019-03-11T00:47:53","slug":"eda%e5%ae%9e%e7%8e%b0%e9%97%b9%e9%92%9f%e9%93%83%e5%a3%b0%e8%ae%be%e8%ae%a1","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2197","title":{"rendered":"EDA\u5b9e\u73b0\u95f9\u949f\u94c3\u58f0\u8bbe\u8ba1"},"content":{"rendered":"

\n\t\u95f9\u949f\u7684\u8bbe\u7f6e\u4f18\u5148\u7ea7\u8981\u4f4e\u4e8e\u6b63\u5e38\u793a\u6570\uff0c\u6240\u4ee5\u5fc5\u987b\u5728\u6b63\u5e38\u793a\u6570\u65f6\u4f7f\u7528\u95f9\u949f\u5f00\u5173\u624d\u80fd\u8fdb\u884c\u95f9\u949f\u7684\u8bbe\u5b9a\uff0c\u800c\u4e14\u95f9\u949f\u7684\u6821\u65f6\u6821\u5206\u662f\u7528\u76842Hz\u7684\u5feb\u901f\u6821\u65f6\u6821\u5206\uff0c\u66f4\u52a0\u7684\u65b9\u4fbf\u6709\u6548\uff0c\u56e0\u4e3a\u662f\u5728\u6b63\u5e38\u8ba1\u6570\u4e0b\u7684\u95f9\u949f\u8bbe\u5b9a\uff0c\u6240\u4ee5\u8bbe\u5b9a\u95f9\u949f\u65f6\u65f6\u949f<\/u>\u4f9d\u7136\u6b63\u5e38\u7684\u884c\u8d70\u3002\u95f9\u949f\u5c06\u5411\u62a5\u65f6\u7535\u8def<\/u>\u8f93\u51fa\u4e00\u4e2a\u95f9\u949f\u6765\u4e86\u7684\u4fe1\u53f7\uff0c\u4ee5\u4fbf\u5728\u62a5\u65f6\u6a21\u5757\u4e2d\u5b9e\u73b0\u95f9\u949f\u7684\u94c3\u58f0\u3002\u5177\u4f53\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n

\n\tmodule alarm<\/u>(clk_2Hz,naozhong_swh,alarm_hour,alarm_min,hour,minute<\/u>,hour_reg,min_reg,alarm,swh,baochi_swh);<\/p>\n

\n\t <\/div>\n

\n\tinput clk_2Hz;<\/p>\n

\n\tinput naozhong_swh,baochi_swh; \/\/\u95f9\u949f\u5f00\u5173<\/p>\n

\n\tinput alarm_hour,alarm_min;<\/p>\n

\n\tinput [1:0]swh; \/\/\u9632\u6b62\u51fa\u73b0\u4f18\u5148\u7ea7\u95ee\u9898<\/p>\n

\n\tinput [5:0]hour; \/\/\u65f6\u95f4\u6bd4\u8f83<\/p>\n

\n\tinput [5:0]minute;<\/p>\n

\n\toutput reg[5:0]hour_reg;<\/p>\n

\n\toutput reg[5:0]min_reg;<\/p>\n

\n\toutput reg alarm;<\/p>\n

\n\talways@(posedge clk_2Hz)<\/p>\n

\n\tbegin<\/p>\n

\n\tif((naozhong_swh)&&(swh[1:0] == 'b11)&&(!baochi_swh))<\/p>\n

\n\tbegin<\/p>\n

\n\tif(alarm_hour)<\/p>\n

\n\tbegin<\/p>\n

\n\tif(hour_reg == 'd23)<\/p>\n

\n\thour_reg <= 'd0;<\/p>\n

\n\telse<\/p>\n

\n\thour_reg <= hour_reg + 'd1;<\/p>\n

\n\tend<\/p>\n

\n\tif(alarm_min)<\/p>\n

\n\tbegin<\/p>\n

\n\tif(min_reg == 'd59)<\/p>\n

\n\tmin_reg <= 'd0;<\/p>\n

\n\telse<\/p>\n

\n\tmin_reg <= min_reg + 'd1;<\/p>\n

\n\tend<\/p>\n

\n\tend<\/p>\n

\n\tend<\/p>\n

\n\talways@(posedge clk_2Hz)<\/p>\n

\n\tbegin<\/p>\n

\n\tif((hour_reg == hour)&&(min_reg == minute))<\/p>\n

\n\tbegin<\/p>\n

\n\talarm <= 'd1;<\/p>\n

\n\tend<\/p>\n

\n\telse<\/p>\n

\n\tbegin<\/p>\n

\n\talarm <= 'd0;<\/p>\n

\n\tend<\/p>\n

\n\tend<\/p>\n

\n\tendmodule<\/p>\n","protected":false},"excerpt":{"rendered":"

\u95f9\u949f\u7684\u8bbe\u7f6e\u4f18\u5148\u7ea7\u8981\u4f4e\u4e8e\u6b63\u5e38\u793a\u6570\uff0c\u6240\u4ee5\u5fc5\u987b\u5728\u6b63\u5e38\u793a\u6570\u65f6\u4f7f\u7528\u95f9\u949f\u5f00\u5173\u624d\u80fd\u8fdb\u884c\u95f9\u949f\u7684\u8bbe\u5b9a\uff0c\u800c\u4e14\u95f9\u949f\u7684\u6821\u65f6\u6821\u5206\u662f\u7528\u76842Hz\u7684\u5feb\u901f\u6821\u65f6\u6821\u5206\uff0c\u66f4\u52a0\u7684\u65b9\u4fbf\u6709\u6548\uff0c\u56e0\u4e3a\u662f\u5728\u6b63\u5e38\u8ba1\u6570\u4e0b\u7684<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2197"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2197"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2197\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2197"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}