可编程ASIC技术课程作业.doc
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
可编程ASIC技术课程作业 请对如下Verilog HDL模块进展仿真和分析,说明其描述方式,画出对应的逻辑图或写出逻辑表达式〔组〕 ,并概括地说明其逻辑功能。 module exe1(out, d3, d2,d1,d0, s1,s0); output out; input d3, d2,d1,d0, s1,s0; not (not_s1,s1), (not_s0,s0); and (out0, d0, not_s1, not_s0), (out1, d1, not_s1, s0); and (out2, d2, s1, not_s0), (out3, d3, s1, s0); or (out, out0, out1, out2, out3); Endmodule 答:该程序逻辑功能为,根据不同的s1和s0,输出通道改变: 当s1=0,s0=0时,out0=d0; 当s1=0,s0=1时,out1=d1; 当s1=1,s0=0时,out2=d2; 当s1=1,s0=1时,out3=d3; 逻辑表达式组为: out0=S1S0d0 out1=S1S0d1 out2=S1S0d2 out3=S1S0d3 out=out0+out1+out2+out3 实现的逻辑功能为典型的数据通道选择器。 2.请对如下Verilog HDL模块进展仿真和分析,用时序波图形或流程框图描述其行为,并概括地说明其逻辑功 能。如果要使输出fd_out的占空比为50%,需要对该模块做什么修改? module exe2(fd_out, clk, d, clr); output fd_out; reg fd_out; input [15:0] d; input clk, clr; reg [15:0] t; always (posedge clk) begin if (!clr) t <= 4'h0000; else begin t <= t - 1; if (t==0) begin fd_out <= 1; t <= d; end else fd_out <= 0; end end Endmodule 〔1〕原程序时序波形图: 该程序实现的是可变模的减法计数器,输出的是每当到达设定模值就输出1,相当于 对设定模进展检测。 〔2〕要使输出fd_out的占空比为50%,对该模块做出如下修改: module exe2(fd_out, clk, d, clr); output fd_out; reg fd_out; input [15:0] d; input clk, clr; reg [15:0] t; always (posedge clk) begin if (!clr) t <= 4'h0000; else begin t <= t - 1; if (t==0) begin fd_out <= 1; t <= 1; end else fd_out <= 0; end end Endmodule 修改程序后的时序波图: 3. 请对如下Verilog HDL模块进展仿真和分析,写出对应的逻辑表达式〔组〕或真值表,并概括地说明其逻辑 功能。 module exe3(op_result, func_sel, op_a, op_b); output [7:0] op_result; input [2:0] func_sel; input [3:0] op_a, op_b; reg [7:0] op_result; always (func_sel or op_a or op_b) begin case (func_sel) 3'b000: op_result <= op_a + op_b; 3'b001: op_result <= op_a - op_b; 3'b010: op_result <= op_a * op_b; 3'b011: op_result <= op_a / op_b; 3'b100: op_result <= op_a & op_b; 3'b101: op_result <= op_a " op_b; 3'b110: op_result <= op_a ^ op_b; 3'b111: op_result <= op_a ~^ op_b; endcase end Endmodule 原程序的时序波图: 该程序逻辑功能为: (1) 当fun_sel=000时,op_result = op_a + op_b; (2) 当fun_sel=001时,op_result = op_a - op_b; (3) 当fun_sel=010时,op_result = op_a * op_b; (4) 当fun_sel=011时,op_result = op_a /
剩余17页未读,继续阅读
- m0_677847022024-02-20资源内容详细,总结地很全面,与描述的内容一致,对我启发很大,学习了。
- 粉丝: 85
- 资源: 9357
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助