可编程ASIC技术课程作业.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《可编程ASIC技术课程作业.docx》由会员分享,可在线阅读,更多相关《可编程ASIC技术课程作业.docx(18页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 可编程ASIC技术课程作业 1请对如下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 (ou
2、t, out0, out1, out2, out3); Endmodule 答:该程序逻辑功能为,根据不同的s1和s0,输出通道改变: (1)当s1=0,s0=0时,out0=d0; (2)当s1=0,s0=1时,out1=d1; (3)当s1=1,s0=0时,out2=d2; (4)当s1=1,s0=1时,out3=d3; 逻辑表达式组为:out0=S1S0d0 out1=S1S0d1 out2=S1S0d2 out3=S1S0d3 out=out0+out1+out2+out3 实现的逻辑功能为典型的数据通道选择器。 2.请对如下Verilog HDL 模块进展仿真和分析,用时序波图形或流
3、程框图描述其 行为,并概括地说明其逻辑功能。如果要使输出fd_out 的占空比为50%,需要 对该模块做什么修改? module exe2(fd_out, clk, d, clr); output fd_out; reg fd_out; 1 / 18 input 15:0 d; input clk, clr; reg 15:0 t; always (posedge clk) begin if (!clr) t = 4h0000; else begin t = t - 1; if (t=0) begin fd_out = 1; t = d; end else fd_out = 0; end en
4、d Endmodule 1原程序时序波形图: 该程序实现的是可变模的减法计数器,输出的是每当到达设定模值就输出1,相当于对 设定模进展检测。 2要使输出fd_out的占空比为50%,对该模块做出如下修改: module exe2(fd_out, clk, d, clr); output fd_out; 2 / 18 reg fd_out; input 15:0 d; input clk, clr; reg 15:0 t; always (posedge clk) begin if (!clr) t = 4h0000; else begin t = t - 1; if (t=0) begin f
5、d_out = 1; t = 1; end else fd_out = 0; end end Endmodule 修改程序后的时序波图: 3 / 18 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) be
6、gin case (func_sel) 3b000: op_result = op_a + op_b; 3b001: op_result = op_a - op_b; 3b010: op_result = op_a * op_b; 3b011: op_result = op_a / op_b; 3b100: op_result = op_a & op_b; 3b101: op_result = op_a | op_b; 3b110: op_result = op_a op_b; 3b111: op_result = op_a op_b; endcase end Endmodule 原程序的时序
7、波图: 4 / 18 该程序逻辑功能为: (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 / op_b; (5) 当fun_sel=100时,op_result = op_a & op_b; (6) 当fun_sel=101时,op_result = op_a | op_b; (7) 当fun_sel=110时, op
8、_result = op_a op_b; (8) 当fun_sel=111时, op_result = op_a op_b; 由 此 可 知 , 该 段 程 序 实 现 的 功 能 是 : 根 据 不 同 的 输 入 选 择 信 号 000,001,011,100,101,110,111,对于两个四位二进制数进展加、减、乘、除、与、或、 异或、同或运算。 4. 请用持续赋值语句,设计一个可实现带使能端E=1 使能的双 4 选 1 数据 选择器的Verilog HDL 模块。 module exe4(outa,outb,in1,in2,in3,in4,in5,in6,in7,in8,sel1,s
9、el2,en); input in1,in2,in3,in4,in5,in6,in7,in8,en; output outa,outb; input sel1,sel2; wire outa,outb; reg r_outa,r_outb; assign outa=r_outa; assign outb=r_outb; 5 / 18 always (en) if(en)begin r_outa=sel1?(sel2?in4:in3):(sel2?in2:in1); r_outb=sel1?(sel2?in8:in7):(sel2?in6:in5);end Endmodule 原程序的时序波图:
10、 5请用Verilog HDL 或VHDL,设计一个功能和引脚与74138 类似的译码器,并 在Quartus 下对其进展仿真验证。 module exe5(out, in,en); output7:0 out;/*定义八位二进制码输出口*/ input2:0 in;/*定义三位二进制码输入口*/ input2:0 en;/*三个使能端*/ reg7:0 out; always (in or en) 6 / 18 begin if(en=3b100) case(in) 3d0: out=8b11111110; 3d1: out=8b11111101; 3d2: out=8b11111011;
11、3d3: out=8b11110111; 3d4: out=8b11101111; 3d5: out=8b11011111; 3d6: out=8b10111111; 3d7: out=8b01111111; endcase else out=8b11111111; end Endmodule 原程序的时序波图: 6请用Verilog HDL 或VHDL,设计一个可同步预置、异步清零的8 位移位存放 器,并在Quartus 下对其进展仿真验证。 7 / 18 module exe6(out,in,reset,set,clk); output7:0 out;/定义四位输出端 input in,r
12、eset,set,clk;/输入信号、清零端、置数端、时钟信号 reg7:0 out; reg7:0 md;/置数存放器 always(posedge clk) begin begin md=8b11111111;end/这里预置数为11111111,可以根据需要更改 if(reset) begin out=0;end else begin if(set) begin out=md;end/置数信号为1,置数 else begin out=out,in;end end end Endmodule 原程序的时序波图: 8 / 18 7请用Verilog HDL 或VHDL,设计一个上升沿触发的可
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 可编程 ASIC 技术 课程 作业
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内