{"id":446,"date":"2026-06-29T14:07:54","date_gmt":"2026-06-29T06:07:54","guid":{"rendered":"http:\/\/www.millscience.cn\/?p=446"},"modified":"2026-07-02T12:01:50","modified_gmt":"2026-07-02T04:01:50","slug":"eda","status":"publish","type":"post","link":"https:\/\/www.millscience.cn\/index.php\/eda\/","title":{"rendered":"eda\u590d\u4e60"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">p5\u56fe<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u8003\u6cd5\u4e00\uff1a\u62bd\u8c61\u5c42\u7ea7\u7684\u6392\u5e8f\uff08\u586b\u7a7a\u9898 \/ \u9009\u62e9\u9898\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\u6700\u57fa\u7840\u7684\u8003\u6cd5\uff0c\u8003\u67e5\u4f60\u5bf9\u786c\u4ef6\u63cf\u8ff0\u201c\u4ece\u5b8f\u89c2\u5230\u5fae\u89c2\u201d\u7684\u8ba4\u77e5\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8003\u70b9\uff1a<\/strong> \u56fe\u5de6\u4fa7\u90a3\u4e2a\u5411\u4e0b\u7684\u7bad\u5934\u201c\u63cf\u8ff0\u548c\u62bd\u8c61\u80fd\u529b\u201d\uff0c\u4ece\u9ad8\u5230\u4f4e\u5206\u522b\u662f\u54ea\u4e94\u4e2a\u5c42\u7ea7\uff1f<\/li>\n\n\n\n<li><strong>\u7b54\u6848\uff08\u4ece\u9ad8\u5230\u4f4e\uff09\uff1a<\/strong> <strong>\u7cfb\u7edf\u7ea7 -> \u7b97\u6cd5\u7ea7 -> \u5bc4\u5b58\u5668\u4f20\u8f93\u7ea7 (RTL) -> \u95e8\u7ea7 -> \u5f00\u5173\u7ea7<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u5178\u578b\u9898\u76ee\uff1a<\/strong> \u201cVerilog HDL \u652f\u6301\u4e0d\u540c\u7ea7\u522b\u7684\u62bd\u8c61\u63cf\u8ff0\uff0c\u8bf7\u6309\u62bd\u8c61\u7ea7\u522b\u4ece\u9ad8\u5230\u4f4e\u6392\u5217\uff1a*<strong>\u3001*<\/strong>\u3001RTL\u7ea7\u3001\u95e8\u7ea7\u3001<strong>_<\/strong>\u3002\u201d<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u8003\u6cd5\u4e8c\uff1aVerilog \u4e0e VHDL \u5728\u5e95\u5c42\u7684\u672c\u8d28\u533a\u522b\uff08\u6781\u5176\u7231\u8003\u7684\u5224\u65ad\u9898 \/ \u9009\u62e9\u9898\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u770b\u56fe\u4e2d\u90a3\u6761\u6700\u663e\u773c\u7684\u5927\u62ec\u53f7\uff0c\u5b83\u5708\u51fa\u4e86 Verilog HDL \u7684\u8303\u56f4\uff0c\u5e76\u4e14<strong>\u6700\u5e95\u90e8\u63a2\u5230\u4e86\u201c\u5f00\u5173\u7ea7\u201d<\/strong>\u3002\u800c\u53f3\u4fa7\u7684 VHDL \u5bf9\u5e94\u7684\u6846\uff0c\u5e95\u90e8\u53ea\u5230\u4e86\u95e8\u7ea7\uff08\u4e0b\u9762\u662f\u5355\u72ec\u7684 VITAL\uff09\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8003\u70b9\uff1a<\/strong> \u4e24\u79cd\u8bed\u8a00\u5728\u5e95\u5c42\u7269\u7406\u5efa\u6a21\u80fd\u529b\u4e0a\u7684\u5dee\u5f02\u3002<\/li>\n\n\n\n<li><strong>\u7b54\u6848\uff1a<\/strong> <strong>Verilog HDL \u80fd\u591f\u8fdb\u884c\u5f00\u5173\u7ea7\uff08\u6676\u4f53\u7ba1\u7ea7\uff09\u7684\u5efa\u6a21\uff0c\u800c\u6807\u51c6\u7684 VHDL \u4e0d\u652f\u6301\u76f4\u63a5\u7684\u5f00\u5173\u7ea7\u5efa\u6a21<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u5178\u578b\u9898\u76ee\uff1a<\/strong>\n<ul class=\"wp-block-list\">\n<li>\uff08\u5224\u65ad\u9898\uff09\u201cVHDL \u548c Verilog HDL \u90fd\u5177\u6709\u5f00\u5173\u7ea7\u7684\u63cf\u8ff0\u80fd\u529b\u3002\u201d \u274c \uff08\u9519\uff0cVHDL\u6ca1\u6709\uff09<\/li>\n\n\n\n<li>\uff08\u9009\u62e9\u9898\uff09\u201c\u4e0b\u5217\u54ea\u79cd\u8bed\u8a00\u66f4\u9002\u5408\u7528\u4e8e\u5e95\u5c42 CMOS \u6676\u4f53\u7ba1\u5f00\u5173\u7ea7\u522b\u7684\u7535\u8def\u63cf\u8ff0\uff1f\u201d \ud83d\udc49 \u9009 Verilog HDL\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u8003\u6cd5\u4e09\uff1aSystemVerilog \u7684\u4f5c\u7528\uff08\u586b\u7a7a\u9898 \/ \u7b80\u7b54\u9898\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u770b\u56fe\u7684\u6700\u4e0a\u65b9\uff0cSystemVerilog \u8865\u8db3\u4e86\u6700\u9876\u90e8\u7684\u7a7a\u95f4\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8003\u70b9\uff1a<\/strong> \u4e86\u89e3 SystemVerilog \u7684\u5b9a\u4f4d\u3002<\/li>\n\n\n\n<li><strong>\u7b54\u6848\uff1a<\/strong> \u5b83\u662f Verilog \u7684\u6269\u5c55\uff0c\u4e3b\u8981\u662f\u4e3a\u4e86\u589e\u5f3a <strong>\u7cfb\u7edf\u7ea7\uff08System Level\uff09<\/strong> \u7684\u5efa\u6a21\u3001\u9a8c\u8bc1\u548c\u63cf\u8ff0\u80fd\u529b\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udca1 \u8003\u524d\u51b2\u523a\u590d\u4e60\u5efa\u8bae<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u8fd9\u9053\u9898\u51fa\u73b0\u5728\u5377\u9762\u4e0a\uff0c\u4f60\u53ea\u9700\u8981\u5728\u5927\u8111\u91cc\u63d0\u53d6\u8fd9\u4e09\u53e5\u8bdd\u5c31\u80fd\u62ff\u6ee1\u5206\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u987a\u5e8f\u662f\uff1a\u7cfb\u7edf\u3001\u7b97\u6cd5\u3001RTL\u3001\u95e8\u3001\u5f00\u5173\u3002<\/strong><\/li>\n\n\n\n<li><strong>Verilog \u624b\u66f4\u957f\uff0c\u80fd\u5f80\u4e0b\u6478\u5230\u201c\u5f00\u5173\u7ea7\u201d\uff08\u6676\u4f53\u7ba1\uff09\u3002<\/strong><\/li>\n\n\n\n<li><strong>VHDL \u504f\u4e0a\u5c42\uff0c\u5e95\u5c42\u8981\u9760 VITAL \u8f85\u52a9\u3002<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u8003\u8bd5\u9047\u5230\u8fd9\u9898\u5c5e\u4e8e\u767d\u7ed9\u7684\u5206\u6570\uff0c\u628a\u8fd9\u51e0\u4e2a\u5173\u952e\u5c42\u7ea7\u548c\u201c\u5f00\u5173\u7ea7\u201d\u7684\u5f52\u5c5e\u770b\u51c6\uff0c\u5c31\u6ca1\u95ee\u9898\u4e86\uff01<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u8f6f\u56fa\u786c\u6838\u7684\u6982\u5ff5<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8f6f\u6838\u4e00\u822c\u662f\u6307\u7ecf\u8fc7\u529f\u80fd\u9a8c\u8bc1\u30015000\u95e8\u4ee5\u4e0a\u7684\u53ef\u7efc\u5408 Verilog HDL\u6216 VHDL\u6a21\u578b\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u56fa\u6838\u901a\u5e38\u662f\u6307\u5728 FPGA \u5668\u4ef6\u4e0a\uff0c\u7ecf\u8fc7\u7efc\u5408\u9a8c\u8bc1\u3001\u5927\u4e8e 5000 \u95e8\u7684\u7535\u8def\u7f51\u8868\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u786c\u6838\u901a\u5e38\u662f\u6307\u5728 ASIC \u5668\u4ef6\u4e0a\uff0c\u7ecf\u8fc7\u9a8c\u8bc1\u3001\u6b63\u786e\u7684\u3001\u5927\u4e8e 5000 \u95e8\u7684\u7535\u8def\u7ed3\u6784\u7248\u56fe\u63a9\u819c<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ip\u6838\u662f\u5177\u6709\u77e5\u8bc6\u4ea7\u6743\u6838\u7684\u96c6\u6210\u7535\u8def\u82af\u6838\u7684\u603b\u79f0\uff0c\u662f\u7ecf\u8fc7\u53cd\u590d\u9a8c\u8bc1\u7684\uff0c\u5177\u6709\u7279\u5b9a\u529f\u80fd\u7684<strong>\u5b8f\u6a21\u5757<\/strong>\uff0c\u4e14\u8be5\u6a21\u5757\u4e0e\u82af\u7247\u5236\u9020\u5de5\u827a\u65e0\u5173\uff0c\u53ef\u4ee5\u79fb\u690d\u5230\u4e0d\u540c\u7684\u534a\u5bfc\u4f53\u5de5\u827a\u4e2d<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">verilog\u6807\u51c6<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">1995\u5e74 \uff1averilog IEEE 1364-1995<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2001\u5e74\uff1averilog IEEE 1364-2001<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u7b2c\u4e8c\u7ae0<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u6807\u8bc6\u7b26\uff1a\u6807\u8bc6\u7b26\u662f\u88ab\u7528\u6765\u547d\u540d\u4fe1\u53f7\uff0c\u6a21\u5757\uff0c\u53c2\u6570\u7b49\uff0c\u5b83\u53ef\u4ee5\u662f\u4efb\u610f\u4e00\u7ec4\u5b57\u6bcd\uff0c\u6570\u5b57\uff0c\u4e0b\u5212\u7ebf\uff0c\u7f8e\u5143\u7b26\u7684\u7ec4\u5408\u3002\u6807\u8bc6\u7b26\u533a\u5206\u5927\u5c0f\u5199\uff0c\u5f00\u5934\u5fc5\u987b\u662f\u5b57\u6bcd\u6216\u8005\u4e0b\u5212\u7ebf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5173\u952e\u5b57\u90fd\u662f\u5c0f\u5199<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e38\u89c1\u8868\u73b0\u5f62\u5f0f\u793a\u4f8b<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u6709\u4f4d\u5bbd\u6574\u6570 (\u63a8\u8350\u683c\u5f0f)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\u6700\u4e25\u8c28\u7684\u5199\u6cd5\uff0c\u53ef\u4ee5\u9632\u6b62\u5728\u7efc\u5408\u4e3a\u5e95\u5c42\u7535\u8def\u65f6\u4ea7\u751f\u610f\u60f3\u4e0d\u5230\u7684\u4f4d\u5bbd\u622a\u65ad\u6216\u6269\u5c55\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>4'b1011<\/code>\uff1a4\u4f4d\u4e8c\u8fdb\u5236\u6570 <code>1011<\/code><\/li>\n\n\n\n<li><code>8'hFA<\/code>\uff1a8\u4f4d\u5341\u516d\u8fdb\u5236\u6570 <code>FA<\/code> (\u4e8c\u8fdb\u5236\u4e3a <code>11111010<\/code>)<\/li>\n\n\n\n<li><code>16'd255<\/code>\uff1a16\u4f4d\u5341\u8fdb\u5236\u6570 <code>255<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4e86\u5e94\u4ed8\u8003\u8bd5\u6216\u5feb\u901f\u56de\u5fc6\uff0c\u4f60\u53ef\u4ee5\u8bb0\u4f4f\u8fd9\u53e5\u987a\u53e3\u6e9c\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u201c\u5355\u7b97\u79fb\uff0c\u5173\u7b49\u4f4d\uff0c\u903b\u8f91\u4e09\u76ee\u6700\u540e\u62fc\u201d<\/strong><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5355<\/strong>\uff1a\u5355\u76ee\uff08<code>!<\/code>, <code>~<\/code>\uff09<\/li>\n\n\n\n<li><strong>\u7b97<\/strong>\uff1a\u7b97\u672f\uff08\u5148\u4e58\u9664\u6a21\uff0c\u540e\u52a0\u51cf\uff09<\/li>\n\n\n\n<li><strong>\u79fb<\/strong>\uff1a\u79fb\u4f4d\uff08<code>&lt;&lt;<\/code>, <code>>><\/code>\uff09<\/li>\n\n\n\n<li><strong>\u5173<\/strong>\uff1a\u5173\u7cfb\uff08\u5927\u5c0f\u5224\u65ad\uff09<\/li>\n\n\n\n<li><strong>\u7b49<\/strong>\uff1a\u76f8\u7b49\uff08\u662f\u5426\u76f8\u7b49\uff09<\/li>\n\n\n\n<li><strong>\u4f4d<\/strong>\uff1a\u6309\u4f4d\u64cd\u4f5c\uff08<code>&amp;<\/code> > <code>^<\/code> > <code>|<\/code>\uff09<\/li>\n\n\n\n<li><strong>\u903b\u8f91<\/strong>\uff1a\u903b\u8f91\u64cd\u4f5c\uff08<code>&amp;&amp;<\/code> > <code>||<\/code>\uff09<\/li>\n\n\n\n<li><strong>\u4e09\u76ee<\/strong>\uff1a\u6761\u4ef6\u9009\u62e9\uff08<code>?:<\/code>\uff09<\/li>\n\n\n\n<li><strong>\u6700\u540e\u62fc<\/strong>\uff1a\u62fc\u63a5\u64cd\u4f5c\uff08<code>{}<\/code>\uff09<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">== \u548c ===\u771f\u503c\u8868<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">==<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>A \\ B<\/strong><\/th><th><strong>0<\/strong><\/th><th><strong>1<\/strong><\/th><th><strong>x<\/strong><\/th><th><strong>z<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong><code>0<\/code><\/strong><\/td><td>1<\/td><td>0<\/td><td>x<\/td><td>x<\/td><\/tr><tr><td><strong><code>1<\/code><\/strong><\/td><td>0<\/td><td>1<\/td><td>x<\/td><td>x<\/td><\/tr><tr><td><strong><code>x<\/code><\/strong><\/td><td>x<\/td><td>x<\/td><td>x<\/td><td>x<\/td><\/tr><tr><td><strong><code>z<\/code><\/strong><\/td><td>x<\/td><td>x<\/td><td>x<\/td><td>x<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">===<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>A \\ B<\/strong><\/th><th><strong>0<\/strong><\/th><th><strong>1<\/strong><\/th><th><strong>x<\/strong><\/th><th><strong>z<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong><code>0<\/code><\/strong><\/td><td>1<\/td><td>0<\/td><td>0<\/td><td>0<\/td><\/tr><tr><td><strong><code>1<\/code><\/strong><\/td><td>0<\/td><td>1<\/td><td>0<\/td><td>0<\/td><\/tr><tr><td><strong><code>x<\/code><\/strong><\/td><td>0<\/td><td>0<\/td><td>1<\/td><td>0<\/td><\/tr><tr><td><strong><code>z<\/code><\/strong><\/td><td>0<\/td><td>0<\/td><td>0<\/td><td>1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.millscience.cn\/wp-content\/uploads\/2026\/07\/5637cf27e2cd2fa5c9b1f776cb2d008.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/www.millscience.cn\/wp-content\/uploads\/2026\/07\/5637cf27e2cd2fa5c9b1f776cb2d008.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"5637cf27e2cd2fa5c9b1f776cb2d008\"\/><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u91c7\u7528\u8fc7\u7a0b\u8bed\u53e5\u5bf9<strong>\u7ec4\u5408\u7535\u8def<\/strong>\u8fdb\u884c\u63cf\u8ff0\u65f6\uff0c\u9700\u8981\u628a<strong>\u5168\u90e8\u7684\u8f93\u5165\u4fe1\u53f7\u5217\u5165\u654f\u611f\u4e8b\u4ef6\u5217\u8868<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u91c7\u7528\u8fc7\u7a0b\u8bed\u53e5\u5bf9<strong>\u65f6\u5e8f\u7535\u8def<\/strong>\u8fdb\u884c\u63cf\u8ff0\u65f6\uff0c\u9700\u8981\u628a<strong>\u65f6\u95f4\u4fe1\u53f7\u548c\u90e8\u5206\u8f93\u5165\u4fe1\u53f7\u5217\u5165\u654f\u611f\u4e8b\u4ef6\u5217\u8868<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7ed3\u6784\u5316\u5efa\u6a21<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5305\u62ec\uff1a<strong>\u6a21\u5757\u7ea7\u5efa\u6a21\uff0c\u95e8\u7ea7\u5efa\u6a21\uff0c\u5f00\u5173\u7ea7\u5efa\u6a21<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9ad8\u9891\u8003\u70b9\u4e00\uff1a\u7aef\u53e3\u6620\u5c04\u89c4\u5219\uff08\u5fc5\u8003\u9009\u62e9\/\u6539\u9519\u9898\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u4f60\u8c03\u7528\uff08\u5b9e\u4f8b\u5316\uff09\u4e00\u4e2a\u73b0\u6210\u7684\u6a21\u5757\u65f6\uff0c\u5982\u4f55\u628a\u5916\u90e8\u4fe1\u53f7\u8fde\u5230\u6a21\u5757\u7684\u7aef\u53e3\u4e0a\uff1f\u8fd9\u662f\u6700\u5bb9\u6613\u51fa\u9898\u7684\u5730\u65b9\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9677\u9631\uff1a\u4f4d\u7f6e\u6620\u5c04 vs. \u540d\u79f0\u6620\u5c04<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>\u4f4d\u7f6e\u6620\u5c04\uff08Positional\uff09<\/strong>\uff1a\u4e25\u683c\u6309\u7167\u539f\u6a21\u5757\u5b9a\u4e49\u7684\u7aef\u53e3\u987a\u5e8f\u8fde\u7ebf\u3002\u7f3a\u70b9\u662f\u6781\u6613\u8fde\u9519\uff0c\u4e14\u4e00\u65e6\u539f\u6a21\u5757\u4fee\u6539\uff0c\u8fd9\u91cc\u7684\u4ee3\u7801\u5168\u5f97\u6539\u3002<\/li>\n\n\n\n<li><strong>\u540d\u79f0\u6620\u5c04\uff08Named\uff0c\u5f3a\u70c8\u63a8\u8350\uff09<\/strong>\uff1a\u4f7f\u7528 <code>.\u7aef\u53e3\u540d(\u8fde\u63a5\u4fe1\u53f7)<\/code> \u7684\u683c\u5f0f\u3002\u987a\u5e8f\u53ef\u4ee5\u968f\u4fbf\u6253\u4e71\uff0c\u975e\u5e38\u6e05\u6670\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u8003\u8bd5\u5e38\u89c1\u6539\u9519<\/strong>\uff1a\u9898\u76ee\u4f1a\u6545\u610f\u628a\u540d\u79f0\u6620\u5c04\u5199\u9519\uff0c\u6216\u8005\u5728\u540c\u4e00\u4e2a\u5b9e\u4f8b\u5316\u91cc\u6df7\u7528\u4e24\u79cd\u6620\u5c04\u65b9\u5f0f\uff08\u8bed\u6cd5\u662f\u4e0d\u5141\u8bb8\u6df7\u7528\u7684\uff09\u3002Verilog\u00a0\/\/ \u5047\u8bbe\u5e95\u5c42\u6a21\u5757\u5b9a\u4e49\u4e3a\uff1amodule D_FF (input D, input clk, output Q);<br>\u00a0\u200b<br>\u00a0\/\/ \u9519\u8bef\u5199\u6cd5\uff08\u6df7\u7528\uff0c\u76f4\u63a5\u96f6\u5206\uff09\uff1a<br>\u00a0D_FF d1 (.D(data_in), clk, .Q(data_out));<br>\u00a0\u200b<br>\u00a0\/\/ \u6ee1\u5206\u5199\u6cd5\uff08\u540d\u79f0\u6620\u5c04\uff09\uff1a<br>\u00a0D_FF d2 (.Q(data_out), .D(data_in), .clk(clock)); \/\/ \u987a\u5e8f\u6253\u4e71\u5b8c\u5168\u6ca1\u95ee\u9898<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u9ad8\u9891\u8003\u70b9\u4e8c\uff1a\u5185\u7f6e\u95e8\u7ea7\u539f\u8bed\u7684\u201c\u6697\u89c4\u5219\u201d<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Verilog \u5185\u7f6e\u4e86\u4e00\u4e9b\u57fa\u7840\u903b\u8f91\u95e8\uff08\u5982 <code>and<\/code>, <code>or<\/code>, <code>not<\/code>, <code>nand<\/code>, <code>xor<\/code> \u7b49\uff09\uff0c\u88ab\u79f0\u4e3a\u95e8\u7ea7\u539f\u8bed\u3002\u8c03\u7528\u5b83\u4eec\u65f6\u6709\u4e00\u4e2a\u6781\u5176\u6b7b\u677f\u7684\u89c4\u5b9a\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7ec8\u6781\u9677\u9631\uff1a\u8f93\u51fa\u5fc5\u987b\u5199\u5728\u7b2c\u4e00\u4f4d\uff01<\/strong> \u5185\u7f6e\u95e8\u7684\u8bed\u6cd5\u662f\uff1a<code>\u95e8\u7c7b\u578b \u5b9e\u4f8b\u540d (\u8f93\u51fa, \u8f93\u51651, \u8f93\u51652, ...);<\/code> \u8003\u8bd5\u65f6\uff0c\u8001\u5e08\u6700\u559c\u6b22\u5728\u586b\u7a7a\u9898\u6216\u8bfb\u56fe\u9898\u91cc\u8003\u8fd9\u4e2a\u987a\u5e8f\uff1aVerilog\u00a0wire out, a, b;<br>\u00a0\/\/ \u8003\u9898\uff1a\u8bf7\u7528\u5185\u7f6e\u4e0e\u95e8\u5b9e\u73b0 out = a &amp; b;<br>\u00a0and u1 (out, a, b); \/\/ \u6b63\u786e\uff1a\u8f93\u51fa out \u5fc5\u987b\u5728\u6700\u524d\u9762\uff01<br>\u00a0and u2 (a, b, out); \/\/ \u81f4\u547d\u9519\u8bef\uff01\u8fd9\u4f1a\u88ab\u7efc\u5408\u6210 a \u4f5c\u4e3a\u8f93\u51fa<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u7aef\u53e3\u7684\u5bf9\u5e94<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u540d\u79f0\u6620\u5c04\uff08Named Mapping\uff09*<em>\u662f\u5b9e\u9645\u5de5\u7a0b\u4e2d\u6700\u6807\u51c6\u3001\u6700\u63a8\u8350\u7684\u7aef\u53e3\u8fde\u63a5\u65b9\u5f0f\u3002\u5b83\u7684\u6838\u5fc3\u601d\u60f3\u662f\uff1a*<\/em>\u201c\u6307\u540d\u9053\u59d3\u5730\u8fde\u7ebf\uff0c\u7edd\u4e0d\u4f9d\u8d56\u4f4d\u7f6e\u987a\u5e8f\u3002\u201d<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8981\u5f7b\u5e95\u641e\u61c2\u5b83\uff0c\u4f60\u53ea\u9700\u8981\u8bb0\u4f4f\u4e00\u4e2a\u6838\u5fc3\u8bed\u6cd5\u516c\u5f0f\u548c\u4e00\u53e5\u53e3\u8bc0\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u6838\u5fc3\u8bed\u6cd5\u516c\u5f0f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Verilog<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;\u8c03\u7528\u7684\u6a21\u5757\u540d \u5b9e\u4f8b\u540d (<br>&nbsp; &nbsp;  .\u5e95\u5c42\u7aef\u53e3\u540d1 (\u5f53\u524d\u6a21\u5757\u7684\u4fe1\u53f7\u7ebfA),<br>&nbsp; &nbsp;  .\u5e95\u5c42\u7aef\u53e3\u540d2 (\u5f53\u524d\u6a21\u5757\u7684\u4fe1\u53f7\u7ebfB),<br>&nbsp; &nbsp;  ...<br>&nbsp;);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\ud83d\udca1 \u72ec\u5bb6\u8bb0\u5fc6\u53e3\u8bc0\uff1a\u201c\u70b9\uff08\u5e95\u5c42\uff09\uff0c\u62ec\uff08\u5f53\u524d\uff09\u201d<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>.<\/code>\uff08\u70b9\uff09<\/strong>\uff1a\u4ee3\u8868\u4f60\u8981\u201c\u70b9\u201d\u5f00\u90a3\u4e2a\u88ab\u8c03\u7528\u7684\u6a21\u5757\uff0c\u6240\u4ee5\u70b9\u540e\u9762\u8ddf\u7740\u7684\u6c38\u8fdc\u662f<strong>\u5e95\u5c42\u6a21\u5757\u539f\u6709\u7684\u7aef\u53e3\u540d\u5b57<\/strong>\u3002<\/li>\n\n\n\n<li><strong><code>()<\/code>\uff08\u62ec\u53f7\uff09<\/strong>\uff1a\u4ee3\u8868\u4f60\u624b\u91cc\u6b63\u62ff\u7740\u4e00\u6839\u7ebf\uff0c\u6240\u4ee5\u62ec\u53f7\u91cc\u9762\u5199\u7684\u662f<strong>\u5f53\u524d\u6a21\u5757\u4e2d\u7528\u6765\u8fde\u63a5\u7684\u4fe1\u53f7\u7ebf\u540d\u5b57<\/strong>\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u6765\u770b\u4e00\u4e2a\u8d85\u7ea7\u76f4\u89c2\u7684\u4f8b\u5b50<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u522b\u4eba\u5199\u597d\u7684\u534a\u52a0\u5668\uff08Half_Adder\uff09\u6a21\u5757\uff0c\u5b83\u7684\u4ee3\u7801\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verilog<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;\/\/ \u5e95\u5c42\u6a21\u5757\uff1a\u534a\u52a0\u5668<br>&nbsp;module Half_Adder (<br>&nbsp; &nbsp;  input  a, &nbsp; &nbsp;  \/\/ \u52a0\u65701<br>&nbsp; &nbsp;  input  b, &nbsp; &nbsp;  \/\/ \u52a0\u65702<br>&nbsp; &nbsp;  output sum, &nbsp;  \/\/ \u672c\u4f4d\u548c<br>&nbsp; &nbsp;  output carry &nbsp; \/\/ \u8fdb\u4f4d<br>&nbsp;);<br>&nbsp; &nbsp;  \/\/ (\u5185\u90e8\u903b\u8f91\u7565)<br>&nbsp;endmodule<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u5728\uff0c\u4f60\u5728\u5199\u4e00\u4e2a<strong>\u9876\u5c42\u6a21\u5757\uff08Top_Module\uff09<\/strong>\uff0c\u624b\u91cc\u6709\u56db\u6839\u7ebf\uff08<code>x<\/code>, <code>y<\/code>, <code>out_sum<\/code>, <code>out_carry<\/code>\uff09\uff0c\u4f60\u60f3\u628a\u5b83\u4eec\u8fde\u5230\u534a\u52a0\u5668\u4e0a\u3002\u4f7f\u7528\u540d\u79f0\u6620\u5c04\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verilog<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;\/\/ \u9876\u5c42\u6a21\u5757<br>&nbsp;module Top_Module (<br>&nbsp; &nbsp;  input  x,<br>&nbsp; &nbsp;  input  y,<br>&nbsp; &nbsp;  output out_sum,<br>&nbsp; &nbsp;  output out_carry<br>&nbsp;);<br>&nbsp;\u200b<br>&nbsp; &nbsp;  \/\/ \u5b9e\u4f8b\u5316\u534a\u52a0\u5668\uff0c\u4f7f\u7528\u540d\u79f0\u6620\u5c04<br>&nbsp; &nbsp;  Half_Adder u1 (<br>&nbsp; &nbsp; &nbsp; &nbsp;  .sum &nbsp; (out_sum), &nbsp; \/\/ \u628a\u5e95\u5c42\u7684 sum \u7aef\u53e3\uff0c\u8fde\u4e0a\u6211\u624b\u91cc\u7684 out_sum \u7ebf<br>&nbsp; &nbsp; &nbsp; &nbsp;  .a &nbsp; &nbsp; (x), &nbsp; &nbsp; &nbsp; &nbsp; \/\/ \u628a\u5e95\u5c42\u7684 a \u7aef\u53e3\uff0c\u8fde\u4e0a\u6211\u624b\u91cc\u7684 x \u7ebf<br>&nbsp; &nbsp; &nbsp; &nbsp;  .carry (out_carry), \/\/ \u628a\u5e95\u5c42\u7684 carry \u7aef\u53e3\uff0c\u8fde\u4e0a\u6211\u624b\u91cc\u7684 out_carry \u7ebf<br>&nbsp; &nbsp; &nbsp; &nbsp;  .b &nbsp; &nbsp; (y) &nbsp; &nbsp; &nbsp; &nbsp;  \/\/ \u628a\u5e95\u5c42\u7684 b \u7aef\u53e3\uff0c\u8fde\u4e0a\u6211\u624b\u91cc\u7684 y \u7ebf<br>&nbsp; &nbsp;  );<br>&nbsp;\u200b<br>&nbsp;endmodule<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u53d1\u73b0\u4e86\u5417\uff1f<\/strong> \u5728\u5b9e\u4f8b\u5316 <code>u1<\/code> \u7684\u65f6\u5019\uff0c\u6211\u6545\u610f\u628a <code>.sum<\/code> \u653e\u5230\u4e86\u7b2c\u4e00\u884c\uff0c\u628a <code>.b<\/code> \u653e\u5230\u4e86\u6700\u540e\u4e00\u884c\u3002\u8fd9\u5c31\u4f53\u73b0\u4e86\u540d\u79f0\u6620\u5c04\u7684\u6700\u5927\u4f18\u52bf\uff1a<strong>\u987a\u5e8f\u5b8c\u5168\u81ea\u7531\uff01<\/strong> \u53ea\u8981\u4f60\u201c\u6307\u540d\u9053\u59d3\u201d\u4e86\uff0c\u7f16\u8bd1\u5668\u7edd\u5bf9\u4e0d\u4f1a\u8fde\u9519\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u8003\u8bd5\u4e0e\u5de5\u7a0b\u4e2d\u7684\u56db\u5927\u8e29\u5751\u70b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u7406\u89e3\u4e86\u57fa\u672c\u7528\u6cd5\u540e\uff0c\u4ee5\u4e0b\u51e0\u4e2a\u89c4\u5219\u662f\u8003\u8bd5\u6700\u7231\u8003\u3001\u5199\u4ee3\u7801\u6700\u5bb9\u6613\u62a5\u9519\u7684\u5730\u65b9\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd34 \u5751\u70b9\u4e00\uff1a\u7aef\u53e3\u60ac\u7a7a\uff08\u60f3\u7a7a\u7740\u4e0d\u8fde\u600e\u4e48\u529e\uff1f\uff09<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709\u65f6\u5019\u6211\u4eec\u8c03\u7528\u4e00\u4e2a\u6a21\u5757\uff0c\u5b83\u7684\u67d0\u4e2a\u8f93\u51fa\u7aef\u53e3\u6211\u4eec\u4e0d\u9700\u8981\u7528\u3002\u5728\u540d\u79f0\u6620\u5c04\u4e2d\uff0c\u5904\u7406\u60ac\u7a7a\u975e\u5e38\u4f18\u96c5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6b63\u786e\u505a\u6cd5<\/strong>\uff1a\u53ea\u5199\u70b9\u548c\u5e95\u5c42\u7aef\u53e3\u540d\uff0c\u62ec\u53f7\u91cc<strong>\u7559\u7a7a<\/strong>\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Verilog<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp; &nbsp;  Half_Adder u2 (<br>&nbsp; &nbsp; &nbsp; &nbsp;  .a &nbsp; &nbsp; (x),<br>&nbsp; &nbsp; &nbsp; &nbsp;  .b &nbsp; &nbsp; (y),<br>&nbsp; &nbsp; &nbsp; &nbsp;  .sum &nbsp; (out_sum),<br>&nbsp; &nbsp; &nbsp; &nbsp;  .carry () &nbsp; &nbsp; &nbsp;  \/\/ \u62ec\u53f7\u91cc\u4ec0\u4e48\u90fd\u4e0d\u5199\uff0c\u4ee3\u8868 carry \u7aef\u53e3\u60ac\u7a7a\u4e0d\u8fde<br>&nbsp; &nbsp;  );<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(\u6ce8\uff1a\u5bf9\u4e8e input \u7aef\u53e3\uff0c\u6700\u597d\u4e0d\u8981\u60ac\u7a7a\uff0c\u5426\u5219\u5e95\u5c42\u6a21\u5757\u4f1a\u63a5\u6536\u5230\u672a\u77e5\u6001 <code>x<\/code>\uff0c\u9664\u975e\u5e95\u5c42\u6709\u9ed8\u8ba4\u503c\u5b9a\u4e49\u3002)<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd34 \u5751\u70b9\u4e8c\uff1a\u4f4d\u5bbd\u4e0d\u5339\u914d<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u62ec\u53f7\u91cc\u7684\u7ebf\uff08\u5982 <code>[3:0] data_in<\/code>\uff09\uff0c\u5fc5\u987b\u548c\u5e95\u5c42\u7aef\u53e3\u7684\u4f4d\u5bbd\u4e00\u81f4\u3002\u5982\u679c\u4e0d\u4e00\u81f4\uff0cVerilog \u4f1a\u9ed8\u8ba4\u8fdb\u884c<strong>\u622a\u65ad<\/strong>\u6216<strong>\u8865\u96f6<\/strong>\uff0c\u8fd9\u901a\u5e38\u4f1a\u4ea7\u751f\u4e00\u4e2a Warning\uff08\u8b66\u544a\uff09\uff0c\u5e76\u4e14\u6781\u5927\u6982\u7387\u5bfc\u81f4\u4f60\u7684\u903b\u8f91\u51fa\u9519\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd34 \u5751\u70b9\u4e09\uff1a\u7edd\u5bf9\u4e0d\u80fd\u201c\u6df7\u642d\u201d<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u540c\u4e00\u4e2a\u5b9e\u4f8b\u5316\u4e2d\uff0c\u4f60\u8981\u4e48\u5168\u7528\u201c\u4f4d\u7f6e\u6620\u5c04\u201d\uff0c\u8981\u4e48\u5168\u7528\u201c\u540d\u79f0\u6620\u5c04\u201d\uff0c<strong>\u4e25\u7981\u6df7\u7528<\/strong>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verilog<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp; &nbsp;  \/\/ \u81f4\u547d\u9519\u8bef\uff1a\u6df7\u7528\u6620\u5c04\u65b9\u5f0f\uff0c\u76f4\u63a5\u7f16\u8bd1\u62a5\u9519\uff01<br>&nbsp; &nbsp;  Half_Adder u3 (<br>&nbsp; &nbsp; &nbsp; &nbsp;  x, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ \u8fd9\u91cc\u7528\u7684\u662f\u4f4d\u7f6e\u6620\u5c04<br>&nbsp; &nbsp; &nbsp; &nbsp;  .b(y), &nbsp; &nbsp; &nbsp; \/\/ \u8fd9\u91cc\u7528\u7684\u662f\u540d\u79f0\u6620\u5c04<br>&nbsp; &nbsp; &nbsp; &nbsp;  .sum(out_sum),<br>&nbsp; &nbsp; &nbsp; &nbsp;  .carry()<br>&nbsp; &nbsp;  );<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd34 \u5751\u70b9\u56db\uff1a\u540d\u5b57\u62fc\u5199\u9519\u8bef<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e2\u7136\u662f\u201c\u6307\u540d\u9053\u59d3\u201d\uff0c\u90a3\u5c31\u8981\u6c42 <code>.\u540d\u5b57<\/code> \u5fc5\u987b\u548c\u5e95\u5c42\u6a21\u5757\u5b9a\u4e49\u7684\u7aef\u53e3\u540d\u5b57<strong>\u4e00\u5b57\u4e0d\u5dee<\/strong>\uff08Verilog \u662f\u533a\u5206\u5927\u5c0f\u5199\u7684\uff09\u3002\u5982\u679c\u5e95\u5c42\u53eb <code>Clk<\/code>\uff0c\u4f60\u5199\u6210\u4e86 <code>.clk(clock)<\/code>\uff0c\u7f16\u8bd1\u5668\u4f1a\u76f4\u63a5\u62a5\u9519\u627e\u4e0d\u5230\u8be5\u7aef\u53e3\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5404\u79cd\u95e8<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.millscience.cn\/wp-content\/uploads\/2026\/07\/image-20260628210030753.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/www.millscience.cn\/wp-content\/uploads\/2026\/07\/image-20260628210030753.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20260628210030753\"\/><\/div><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">\u7b2c\u56db\u7ae0<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u6570\u636e\u9009\u62e9\u5668<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;module mux8to1(out, sel, data_in);<br>&nbsp; &nbsp;  output out;<br>&nbsp; &nbsp;  input [7:0] data_in;<br>&nbsp; &nbsp;  input [3:0] sel;<br>&nbsp; &nbsp;  reg out;<br>&nbsp;\u200b<br>&nbsp; &nbsp;  always @(data_in or sel)<br>&nbsp; &nbsp; &nbsp; &nbsp;  case (sel)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b000 : out = data_in[0];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b001 : out = data_in[1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b010 : out = data_in[2];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b011 : out = data_in[3];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b100 : out = data_in[4];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b101 : out = data_in[5];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b110 : out = data_in[6];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  3'b111 : out = data_in[7];<br>&nbsp; &nbsp; &nbsp; &nbsp;  endcase<br>&nbsp;endmodule<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u79fb\u4f4d\u5bc4\u5b58\u5668<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;module shiftregist1 (D, clk, reset);<br>&nbsp; &nbsp;  parameter shiftregist_width = 4;<br>&nbsp; &nbsp;  output [shiftregist_width-1:0] D;<br>&nbsp; &nbsp;  input clk, reset;<br>&nbsp; &nbsp;  reg [shiftregist_width-1:0] D;<br>&nbsp;\u200b<br>&nbsp; &nbsp;  always @(posedge clk)<br>&nbsp; &nbsp; &nbsp; &nbsp;  if (!reset)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  D &lt;= 4'b0001;<br>&nbsp; &nbsp; &nbsp; &nbsp;  else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  D &lt;= {D[shiftregist_width-2:0], D[shiftregist_width-1]};<br>&nbsp;endmodule<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8ba1\u6570\u5668<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;module comp2bit (Q, clk, reset);<br>&nbsp; &nbsp;  output Q;<br>&nbsp; &nbsp;  input clk, reset;<br>&nbsp; &nbsp;  reg Q;<br>&nbsp;\u200b<br>&nbsp; &nbsp;  always @ (posedge clk or negedge reset)<br>&nbsp; &nbsp; &nbsp; &nbsp;  if (!reset)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Q &lt;= 1'b0;<br>&nbsp; &nbsp; &nbsp; &nbsp;  else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Q &lt;= ~Q;<br>&nbsp;endmodule<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">D\u89e6\u53d1\u5668<\/p>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.millscience.cn\/wp-content\/uploads\/2026\/07\/image-20260702104547346.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/www.millscience.cn\/wp-content\/uploads\/2026\/07\/image-20260702104547346.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20260702104547346\"\/><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709\u9650\u540c\u6b65\u72b6\u6001\u673a\u6709 <strong>\u540c\u6b65<\/strong> \u548c <strong>\u5f02\u6b65<\/strong>\u4e24\u79cd<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e38\u7528\u7684\u7f16\u7801\u65b9\u5f0f\uff1a\u4e8c\u8fdb\u5236\u7f16\u7801\uff0c\u683c\u96f7\u7f16\u7801\u548c\u4e00\u4f4d\u72ec\u70ed\u7f16\u7801<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u7b2c\u4e94\u7ae0<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">timescale\u7684\u8bed\u6cd5\u683c\u5f0f\uff1a`timescale time_unit \/ time_precision<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982 `timescale 1ns \/ 1ns<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u5927\u9898<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u7ec4\u5408\u7535\u8def\u8bbe\u8ba1<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec4\u5408\u7535\u8def\u8bbe\u8ba1\u5927\u9898\uff1a\u4e07\u80fd\u4e94\u6b65\u6cd5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e00\u6b65\uff1a\u9700\u6c42\u5206\u6790\u4e0e\u53d8\u91cf\u5b9a\u4e49\uff08\u5efa\u7acb\u62bd\u8c61\u6a21\u578b\uff09<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u52a8\u4f5c\uff1a<\/strong> \u4ed4\u7ec6\u9605\u8bfb\u9898\u76ee\uff0c\u627e\u51fa\u6240\u6709\u7684\u201c\u8f93\u5165\u6761\u4ef6\u201d\u548c\u201c\u8f93\u51fa\u7ed3\u679c\u201d\uff0c\u5e76\u7ed9\u5b83\u4eec\u5206\u914d\u5b57\u6bcd\u53d8\u91cf\uff08\u5982 A\u3001B\u3001C\u3001Y\uff09\u3002<\/li>\n\n\n\n<li><strong>\u5173\u952e\u70b9\uff1a<\/strong> \u5fc5\u987b\u660e\u786e\u5b9a\u4e49\u903b\u8f91 <code>0<\/code> \u548c <code>1<\/code> \u7684\u7269\u7406\u542b\u4e49\u3002\u4f8b\u5982\uff1a\u201c\u8bbe A \u4e3a\u4e3b\u88c1\u5224\uff0cA=1 \u8868\u793a\u540c\u610f\uff0cA=0 \u8868\u793a\u53cd\u5bf9\uff1b\u8bbe Y \u4e3a\u6700\u7ec8\u7ed3\u679c\uff0cY=1 \u8868\u793a\u901a\u8fc7\uff0cY=0 \u8868\u793a\u5426\u51b3\u3002\u201d\uff08<strong>\u5343\u4e07\u522b\u6f0f\u5199\u8fd9\u53e5\u5b9a\u4e49\uff0c\u5f88\u591a\u8001\u5e08\u4f1a\u5728\u8fd9\u91cc\u6263\u8fc7\u7a0b\u5206<\/strong>\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e8c\u6b65\uff1a\u5217\u51fa\u771f\u503c\u8868\uff08\u6700\u8017\u65f6\uff0c\u4f46\u7edd\u5bf9\u4e0d\u80fd\u9519\uff09<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u52a8\u4f5c\uff1a<\/strong> \u6839\u636e\u8f93\u5165\u53d8\u91cf\u7684\u4e2a\u6570 n\uff0c\u5217\u51fa\u4e00\u4e2a\u5305\u542b 2^n \u884c\u7684\u8868\u683c\u3002\u7a77\u4e3e\u4ece <code>00...0<\/code> \u5230 <code>11...1<\/code> \u7684\u6240\u6709\u8f93\u5165\u60c5\u51b5\uff0c\u5e76\u6839\u636e\u9898\u610f\u586b\u4e0a\u5bf9\u5e94\u7684\u8f93\u51fa Y\u3002<\/li>\n\n\n\n<li><strong>\u907f\u5751\u6307\u5357\uff1a<\/strong> \u9047\u5230\u9898\u76ee\u4e2d\u6ca1\u6709\u8bf4\u660e\u7684\u8f93\u5165\u7ec4\u5408\uff0c\u6216\u8005\u7269\u7406\u4e0a\u4e0d\u53ef\u80fd\u53d1\u751f\u7684\u8f93\u5165\uff08\u6bd4\u5982 BCD \u7801\u91cc\u51fa\u73b0\u4e86 <code>1010<\/code> \u5230 <code>1111<\/code>\uff09\uff0c\u76f4\u63a5\u5728\u8f93\u51fa\u680f\u586b\u5165 <strong>\u65e0\u5173\u9879 <code>d<\/code> (\u6216 <code>x<\/code>)<\/strong>\u3002\u5de7\u5999\u5229\u7528\u65e0\u5173\u9879\uff0c\u53ef\u4ee5\u5728\u4e0b\u4e00\u6b65\u5316\u7b80\u65f6\u5927\u5e45\u51cf\u5c11\u95e8\u7535\u8def\u7684\u6570\u91cf\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e09\u6b65\uff1a\u903b\u8f91\u5316\u7b80\uff08\u6838\u5fc3\u62ff\u5206\u70b9\uff1a\u5361\u8bfa\u56fe\uff09<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u52a8\u4f5c\uff1a<\/strong> \u628a\u771f\u503c\u8868\u91cc\u7684 <code>1<\/code> \u548c <code>d<\/code> \u753b\u8fdb\u5361\u8bfa\u56fe\uff08Karnaugh Map\uff09\u3002<\/li>\n\n\n\n<li><strong>\u5708\u56fe\u94c1\u5f8b\uff1a<\/strong>\n<ol class=\"wp-block-list\">\n<li>\u5708\u6570\u8981\u5c3d\u53ef\u80fd\u5c11\u3002<\/li>\n\n\n\n<li>\u6bcf\u4e2a\u5708\u91cc\u7684\u65b9\u683c\u6570\u5fc5\u987b\u662f 2^k\uff081, 2, 4, 8&#8230;\uff09\uff0c\u5708\u8981\u5c3d\u53ef\u80fd\u5927\u3002<\/li>\n\n\n\n<li>\u5708\u53ef\u4ee5\u8de8\u8d8a\u8fb9\u754c\uff08\u4e0a\u4e0b\u76f8\u8fde\u3001\u5de6\u53f3\u76f8\u8fde\uff0c\u751a\u81f3\u662f\u56db\u4e2a\u89d2\u76f8\u8fde\uff09\u3002<\/li>\n\n\n\n<li>\u65e0\u5173\u9879 <code>d<\/code> \u53ef\u4ee5\u5f53\u6210 <code>1<\/code> \u5708\u8fdb\u53bb\uff08\u5982\u679c\u80fd\u8ba9\u5708\u53d8\u5927\uff09\uff0c\u4e5f\u53ef\u4ee5\u5f53\u6210 <code>0<\/code> \u4e0d\u7406\u5b83\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u56db\u6b65\uff1a\u5199\u51fa\u903b\u8f91\u8868\u8fbe\u5f0f<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u52a8\u4f5c\uff1a<\/strong> \u6839\u636e\u5361\u8bfa\u56fe\u7684\u5708\uff0c\u5199\u51fa\u6700\u7b80\u7684<strong>\u4e0e\u6216\u5f0f (SOP)<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u53d8\u5f62\u8003\u70b9\uff1a<\/strong> \u8003\u5377\u6709\u65f6\u4e0d\u8ba9\u4f60\u76f4\u63a5\u753b\u4e0e\u6216\u95e8\uff0c\u800c\u662f\u4f1a\u52a0\u9650\u5236\u6761\u4ef6\uff1a\n<ul class=\"wp-block-list\">\n<li><em>\u201c\u8bf7\u4ec5\u7528\u4e0e\u975e\u95e8 (NAND) \u5b9e\u73b0\u201d<\/em>\uff1a\u4f7f\u7528\u6469\u6839\u5b9a\u5f8b\uff0c\u7ed9\u6574\u4e2a\u8868\u8fbe\u5f0f\u52a0\u4e24\u6b21\u975e\u53f7\uff08\u53cc\u91cd\u53cd\u76f8\uff09\uff0c\u7136\u540e\u5316\u6210\u5168\u662f\u4e0e\u975e\u7684\u5f62\u5f0f\u3002<\/li>\n\n\n\n<li><em>\u201c\u8bf7\u7528 74LS138 (3-8\u8bd1\u7801\u5668) \u5b9e\u73b0\u201d<\/em>\uff1a\u628a\u8868\u8fbe\u5f0f\u5c55\u5f00\u4e3a<strong>\u6807\u51c6\u4e0e\u6216\u5f0f\uff08\u6700\u5c0f\u9879\u8868\u8fbe\u5f0f\uff09<\/strong>\uff0c\u7136\u540e\u76f4\u63a5\u8fde\u7ebf\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e94\u6b65\uff1a\u7ed8\u5236\u903b\u8f91\u7535\u8def\u56fe \/ \u7f16\u5199 Verilog \u4ee3\u7801<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u52a8\u4f5c\uff1a<\/strong> \u6839\u636e\u4e0a\u4e00\u6b65\u7684\u8868\u8fbe\u5f0f\uff0c\u753b\u51fa\u903b\u8f91\u95e8\u8fde\u63a5\u56fe\uff0c\u6216\u8005\u5199\u51fa\u5bf9\u5e94\u7684 <code>assign<\/code> \u6570\u636e\u6d41\u5efa\u6a21\u4ee3\u7801\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e38\u89c1\u7684\u4e09\u5927\u7ecf\u5178\u8003\u9898\u6a21\u578b<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u201c\u591a\u6570\u8868\u51b3\u201d\u578b\uff08\u542b\u6743\u91cd\u673a\u5236\uff09<\/strong>\n<ul class=\"wp-block-list\">\n<li><em>\u7ecf\u5178\u9898\u76ee\uff1a<\/em> \u4e09\u4e2a\u88c1\u5224 A\u3001B\u3001C\uff0cA \u662f\u4e00\u7968\u5426\u51b3\u6743\uff0cB \u548c C \u666e\u901a\u7968\u3002\u53ea\u6709 A \u540c\u610f\u4e14 B\u3001C \u4e2d\u81f3\u5c11\u4e00\u4eba\u540c\u610f\u65f6\u624d\u901a\u8fc7\u3002<\/li>\n\n\n\n<li><em>\u7834\u9898\u70b9\uff1a<\/em> \u91cd\u70b9\u770b\u7279\u6b8a\u7684\u90a3\u4e2a\u53d8\u91cf\uff0c\u771f\u503c\u8868\u4e2d\u53ea\u8981 A=0\uff0c\u8f93\u51fa\u5168\u4e3a 0\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u201c\u6570\u503c\u68c0\u6d4b\/\u6bd4\u8f83\u201d\u578b<\/strong>\n<ul class=\"wp-block-list\">\n<li><em>\u7ecf\u5178\u9898\u76ee\uff1a<\/em> \u8bbe\u8ba1\u4e00\u4e2a\u7535\u8def\uff0c\u8f93\u5165\u4e3a 4 \u4f4d\u4e8c\u8fdb\u5236\u6570\uff0c\u5f53\u8f93\u5165\u6570\u503c\u5728 5 \u5230 10 \u4e4b\u95f4\u65f6\uff0c\u8f93\u51fa\u9ad8\u7535\u5e73\u3002<\/li>\n\n\n\n<li><em>\u7834\u9898\u70b9\uff1a<\/em> \u8fd9\u662f\u5178\u578b\u7684\u5361\u8bfa\u56fe\u65e0\u5173\u9879\u8fd0\u7528\u9898\u3002\u5982\u679c\u660e\u786e\u8bf4\u8f93\u5165\u662f BCD \u7801\uff0c\u8bb0\u5f97\u628a 10~15 \u5f53\u4f5c\u65e0\u5173\u9879 <code>d<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u201c\u4e2d\u89c4\u6a21\u96c6\u6210\u5668\u4ef6 (MSI)\u201d\u642d\u79ef\u6728\u578b<\/strong>\n<ul class=\"wp-block-list\">\n<li><em>\u7ecf\u5178\u9898\u76ee\uff1a<\/em> \u8bf7\u7528\u4e00\u4e2a 8 \u9009 1 \u6570\u636e\u9009\u62e9\u5668 (74LS151) \u6216\u8005 3-8 \u8bd1\u7801\u5668 (74LS138) \u5b9e\u73b0\u7279\u5b9a\u7684\u903b\u8f91\u51fd\u6570\u3002<\/li>\n\n\n\n<li><em>\u7834\u9898\u70b9\uff1a<\/em> \u4e0d\u9700\u8981\u753b\u590d\u6742\u7684\u5361\u8bfa\u56fe\u3002\u628a\u51fd\u6570\u5316\u4e3a<strong>\u6700\u5c0f\u9879\u4e4b\u548c<\/strong>\uff0c\u6700\u5c0f\u9879\u7684\u7f16\u53f7\uff08\u5982 m_3, m_5, m_7\uff09\u76f4\u63a5\u5bf9\u5e94\u82af\u7247\u5f15\u811a\u7684\u8fde\u7ebf\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u6ca1\u95ee\u9898\uff0c\u6211\u4eec\u6765\u5b9e\u6218\u6f14\u7ec3\u4e00\u9053\u6570\u5b57\u903b\u8f91\u8003\u8bd5\u4e2d<strong>\u6700\u7ecf\u5178\u3001\u6700\u5e38\u8003<\/strong>\u7684\u5165\u95e8\u7ea7\u5927\u9898\uff1a\u201c\u4e09\u4eba\u8868\u51b3\u5668\u201d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u638c\u63e1\u4e86\u8fd9\u9053\u9898\uff0c\u4f60\u5c31\u5f7b\u5e95\u6253\u901a\u4e86\u201c\u4ece\u6587\u5b57\u9700\u6c42\u5230\u7269\u7406\u786c\u4ef6\u201d\u7684\u4efb\u7763\u4e8c\u8109\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ecf\u5178\u4f8b\u9898\uff1a\u4e09\u4eba\u8868\u51b3\u5668\u8bbe\u8ba1 \u4e66p75<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u3010\u9898\u76ee\u63cf\u8ff0\u3011<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709 A\u3001B\u3001C \u4e09\u540d\u8bc4\u59d4\u5bf9\u4e00\u4e2a\u9879\u76ee\u8fdb\u884c\u6295\u7968\u8868\u51b3\u3002\u53ea\u6709\u5f53\u4e24\u540d\u6216\u4e24\u540d\u4ee5\u4e0a\u7684\u8bc4\u59d4\u6295\u201c\u8d5e\u6210\u201d\u7968\u65f6\uff0c\u9879\u76ee\u624d\u7b97\u901a\u8fc7\u3002\u8bf7\u8bbe\u8ba1\u8be5\u8868\u51b3\u5668\u7684\u903b\u8f91\u7535\u8def\uff0c\u5e76\u5199\u51fa\u5bf9\u5e94\u7684 Verilog \u6570\u636e\u6d41\u5efa\u6a21\u4ee3\u7801\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e00\u6b65\uff1a\u9700\u6c42\u5206\u6790\u4e0e\u53d8\u91cf\u5b9a\u4e49\uff08\u5efa\u7acb\u6a21\u578b\uff09<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8f93\u5165\u53d8\u91cf\uff1a<\/strong> \u8bbe A\u3001B\u3001C \u4e3a\u4e09\u540d\u8bc4\u59d4\u7684\u6295\u7968\u72b6\u6001\u3002\n<ul class=\"wp-block-list\">\n<li>\u903b\u8f91 <code>1<\/code> \u8868\u793a\u201c\u8d5e\u6210\u201d\u3002<\/li>\n\n\n\n<li>\u903b\u8f91 <code>0<\/code> \u8868\u793a\u201c\u53cd\u5bf9\u201d\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u8f93\u51fa\u53d8\u91cf\uff1a<\/strong> \u8bbe Y \u4e3a\u6700\u7ec8\u8868\u51b3\u7ed3\u679c\u3002\n<ul class=\"wp-block-list\">\n<li>\u903b\u8f91 <code>1<\/code> \u8868\u793a\u201c\u9879\u76ee\u901a\u8fc7\u201d\u3002<\/li>\n\n\n\n<li>\u903b\u8f91 <code>0<\/code> \u8868\u793a\u201c\u9879\u76ee\u5426\u51b3\u201d\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e8c\u6b65\uff1a\u5217\u51fa\u771f\u503c\u8868\uff08\u7a77\u4e3e\u6240\u6709\u53ef\u80fd\uff09<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e09\u4e2a\u8f93\u5165\uff0c\u603b\u5171\u6709 2^3 = 8 \u79cd\u60c5\u51b5\u3002\u89c4\u5219\u662f\u201c\u81f3\u5c11\u4e24\u4e2a 1\uff0c\u8f93\u51fa\u624d\u662f 1\u201d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>A (\u8bc4\u59d41)<\/strong><\/th><th><strong>B (\u8bc4\u59d42)<\/strong><\/th><th><strong>C (\u8bc4\u59d43)<\/strong><\/th><th><strong>Y (\u7ed3\u679c)<\/strong><\/th><th><strong>\u8bf4\u660e<\/strong><\/th><\/tr><\/thead><tbody><tr><td>0<\/td><td>0<\/td><td>0<\/td><td><strong>0<\/strong><\/td><td>\u5168\u53cd\u5bf9<\/td><\/tr><tr><td>0<\/td><td>0<\/td><td>1<\/td><td><strong>0<\/strong><\/td><td>\u4e00\u4eba\u8d5e\u6210<\/td><\/tr><tr><td>0<\/td><td>1<\/td><td>0<\/td><td><strong>0<\/strong><\/td><td>\u4e00\u4eba\u8d5e\u6210<\/td><\/tr><tr><td>0<\/td><td>1<\/td><td>1<\/td><td><strong>1<\/strong><\/td><td>B\u3001C\u8d5e\u6210 (2\u7968)<\/td><\/tr><tr><td>1<\/td><td>0<\/td><td>0<\/td><td><strong>0<\/strong><\/td><td>\u4e00\u4eba\u8d5e\u6210<\/td><\/tr><tr><td>1<\/td><td>0<\/td><td>1<\/td><td><strong>1<\/strong><\/td><td>A\u3001C\u8d5e\u6210 (2\u7968)<\/td><\/tr><tr><td>1<\/td><td>1<\/td><td>0<\/td><td><strong>1<\/strong><\/td><td>A\u3001B\u8d5e\u6210 (2\u7968)<\/td><\/tr><tr><td>1<\/td><td>1<\/td><td>1<\/td><td><strong>1<\/strong><\/td><td>\u5168\u7968\u8d5e\u6210 (3\u7968)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e09\u6b65\uff1a\u903b\u8f91\u5316\u7b80\uff08\u5361\u8bfa\u56fe\u63a8\u5bfc\uff09<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u5c06\u771f\u503c\u8868\u4e2d Y=1 \u7684\u4f4d\u7f6e\uff08\u4e5f\u5c31\u662f 011, 101, 110, 111\uff09\u586b\u5165\u5361\u8bfa\u56fe\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u76f8\u90bb\u7684 1 \u53ef\u4ee5\u5708\u5728\u4e00\u8d77\uff08\u4e24\u4e2a\u4e00\u5708\uff09\u3002<\/li>\n\n\n\n<li>\u6700\u7ec8\u53ef\u4ee5\u753b\u51fa\u4e09\u4e2a\u5708\uff0c\u5206\u522b\u8986\u76d6\uff1a(A,B)\u3001(A,C)\u3001(B,C)\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u56db\u6b65\uff1a\u5199\u51fa\u903b\u8f91\u8868\u8fbe\u5f0f<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u6839\u636e\u5361\u8bfa\u56fe\u7684\u4e09\u4e2a\u5708\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u51fa\u6700\u7b80\u7684<strong>\u4e0e\u6216\u5f0f (SOP)<\/strong>\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Y = AB + AC + BC<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(\u8fd9\u5c31\u662f\u8fd9\u4e2a\u7535\u8def\u7684\u6838\u5fc3\u7075\u9b42\uff1aA\u548cB\u540c\u610f\u3001\u6216\u8005A\u548cC\u540c\u610f\u3001\u6216\u8005B\u548cC\u540c\u610f)<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u7b2c\u4e94\u6b65\uff1a\u7f16\u5199 Verilog \u4ee3\u7801 (\u6570\u636e\u6d41\u5efa\u6a21)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709\u4e86\u8868\u8fbe\u5f0f\uff0c\u5199\u4ee3\u7801\u5c31\u662f\u4e00\u79d2\u949f\u7684\u4e8b\uff0c\u76f4\u63a5\u628a\u6570\u5b66\u7b26\u53f7\u7ffb\u8bd1\u6210 Verilog \u7684\u6309\u4f4d\u8fd0\u7b97\u7b26\uff08<code>&amp;<\/code> \u548c <code>|<\/code>\uff09\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verilog<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;module Majority_Voter (<br>&nbsp; &nbsp; &nbsp;input &nbsp;A,<br>&nbsp; &nbsp; &nbsp;input &nbsp;B,<br>&nbsp; &nbsp; &nbsp;input &nbsp;C,<br>&nbsp; &nbsp; &nbsp;output Y<br>&nbsp;);<br>&nbsp;\u200b<br>&nbsp; &nbsp; &nbsp;\/\/ \u6570\u636e\u6d41\u5efa\u6a21\uff1a\u7528 assign \u76f4\u63a5\u6620\u5c04\u903b\u8f91\u8868\u8fbe\u5f0f<br>&nbsp; &nbsp; &nbsp;assign Y = (A &amp; B) | (A &amp; C) | (B &amp; C);<br>&nbsp;\u200b<br>&nbsp;endmodule<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(\u6ce8\u610f\uff1a\u5728\u5de5\u7a0b\u4e60\u60ef\u4e2d\uff0c\u867d\u7136 <code>&amp;<\/code> \u4f18\u5148\u7ea7\u9ad8\u4e8e <code>|<\/code>\uff0c\u4f46\u52a0\u4e0a\u62ec\u53f7 <code>()<\/code> \u4f1a\u8ba9\u4ee3\u7801\u53ef\u8bfb\u6027\u5927\u5927\u589e\u5f3a\uff0c\u8003\u8bd5\u65f6\u8fd9\u6837\u5199\u7edd\u5bf9\u6ee1\u5206\u3002)<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u590d\u4f4d (rst_n=0)din = 1din = 0din = 1din = 0din = 1din = 0din = 1din = 0din = 1din = 0S0 \/ 0 (\u672a\u68c0\u6d4b\u52301)S1 \/ 0 (\u8fde\u7eed1\u4e2a1)S2 \/ 0 (\u8fde\u7eed2\u4e2a1)S3 \/ 0 (\u8fde\u7eed3\u4e2a1)S4 \/ 1 (4\u4e2a\u6216\u4ee5\u4e0a1)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>p5\u56fe \u8003\u6cd5\u4e00\uff1a\u62bd\u8c61\u5c42\u7ea7\u7684\u6392\u5e8f\uff08\u586b\u7a7a\u9898 \/ \u9009\u62e9\u9898\uff09 \u8fd9\u662f\u6700\u57fa\u7840\u7684\u8003\u6cd5\uff0c\u8003\u67e5\u4f60\u5bf9\u786c\u4ef6\u63cf\u8ff0\u201c\u4ece\u5b8f\u89c2\u5230\u5fae\u89c2\u201d\u7684\u8ba4\u77e5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-446","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/posts\/446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/comments?post=446"}],"version-history":[{"count":2,"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/posts\/446\/revisions"}],"predecessor-version":[{"id":465,"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/posts\/446\/revisions\/465"}],"wp:attachment":[{"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/media?parent=446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/categories?post=446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.millscience.cn\/index.php\/wp-json\/wp\/v2\/tags?post=446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}