- 1、本文档共30页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
VerilogHDL实验内容
第七章 逻辑电路的描述 7.1 组合电路的设计 7.2 时序电路的设计 7.3 有限状态机 7. 4 存储器的描述 7.1 组合电路的设计 7.1.1 3线-8线译码器 module decoder(out,in); output[7:0] out; input[2:0] in; reg[7:0] out; always@(in) begin … end endmodule 7.1.2 8线-3线编码器 module zcoder(out,in); output[2:0] out; input[7:0] in; reg[2:0] out; always@(in) begin … end endmodule 7.1.3 七段显示译码器 BCD-七段显示译码电路的真值表 case({D3,D2,D1,D0}) 4d0: {a,b,c,d,e,f,g}=7b1111110; 4d1: {a,b,c,d,e,f,g}=7b0110000; 4d2: {a,b,c,d,e,f,g}=7b1101101; 4d3: {a,b,c,d,e,f,g}=7b1111001; 4d4: {a,b,c,d,e,f,g}=7b0110011; 4d5: {a,b,c,d,e,f,g}=7b1011011; 4d6: {a,b,c,d,e,f,g}=7b1011111; 4d7: {a,b,c,d,e,f,g}=7b1110000; 4d8: {a,b,c,d,e,f,g}=7b1111111; 4d9: {a,b,c,d,e,f,g}=7b1111011; default: {a,b,c,d,e,f,g}=7bx; endcase 7.1 .4 四选一数据选择器 module mux_case(out,in0,in1,in2,in3,sel); output out; input in0, in1, in2, in3; Input [1:0] sel; reg out; always @(in0 or in1 or in2 or in3 or sel) begin case(sel) 2b00: out=in0; 2b01: out=in1; 2b10: out=in2; default: out=in3; endcase end endmodule module mux_if(out,in0,in1,in2,in3,sel); output out; input in0,in1,in2,in3; input[1:0] sel; reg out; always @(in0 or in1 or in2 or in3 or sel) begin if(sel= =2b00) out=in0; else if(sel= =2b01) out=in1; else if(sel= =2b10) out=in2; else out=in3; end endmodule 7.1.5 数据分配器 module zss_if(out0, out1, out2, out3, in0,sel); output out0, out1, out2, out3; input in0; input[1:0] sel; reg out; always @(in0 or sel) begin {out0, out1, out2, out3} = 4’b0000; if(sel= =2b00) out0=in0; else if(sel= =2b01) out1=in0; else if(sel= =2b10) out2=in0; else if(sel= =2b11) out3=in0; end endmodule 7.1 .5 数据比较器 7.2 时序电路的设计 7.2.1 D触发器 异步清0,异步置1 module DFF1(q,qn,d,clk,set,reset); input d,clk,set,reset; output q,qn; reg q,qn; always @(posedge clk or negedge set or negedge reset) begin … end endmodule 同步清0,同步置1 if (reset) begin q = 0; qn = 1; end else if (set) begin q
您可能关注的文档
- VB程序设计前四章回顾2.doc
- vb、vc编码规范.doc
- VB程序设计单元测验试卷(含答案).doc
- VB大纲复习.doc
- VB程序设计教程概述.doc
- VB理论题库.doc
- VB_编程练习(答案).doc
- VB串口通讯方式解释.doc
- VB上机练习题(一).doc
- VB单选题(第5章).doc
- 新的一年工作展望.docx
- 医生年终个人工作的述职报告(3篇).docx
- 2023年消防设施操作员之消防设备中级技能考前冲刺练习题附答案详解.docx
- 2022-2023年环境影响评价工程师之环评技术导则与标准通关练习题包括详细解答.docx
- 2023年中级注册安全工程师之安全生产管理考前冲刺检测卷和答案.docx
- 2023年中级银行从业资格之中级银行管理考前冲刺测试卷提供答案解析.docx
- 2023年公共营养师之二级营养师通关模拟考试试卷附带答案.docx
- 证券分析师之发布证券研究报告业务考前冲刺模拟题库.docx
- 2022-2023年二级建造师之二建建设工程法规及相关知识综合提升测试卷附答案.docx
- 2023年二级建造师之二建机电工程实务通关模拟考试试卷提供答案解析.docx
文档评论(0)