第九章
下面的代码不会生成多余的锁存器。module test (out1, a, b, c, sel);input a, b, c;output out1;input[1:0] sel;reg out1; always@(a or b or c or sel) begin if (sel ==2'b10) out1 = a; else if (sel == 2'b01) out1 = b; else if (sel == 2'b11) out1 = c;endendmodule ( )
答案:错
下面的代码不存在RTL与综合后门级网表仿真不一致问题。module compare(equal, a, b);parameter size = 1;output equal;input [size-1:0] a, b; reg equal;always @(*) begin equal = (a == b);end endmodule( )下面的代码,会生成级联电路。module test(SEL,A,B,C,D,Y);input [1:0] SEL;input A,B,C,D;output Y;reg Y;always@(SEL,A,B,C,D) beginif(SEL==2'b00) Y=A;else if(SEL==2'b01) Y=B;else if(SEL==2'b10) Y=C;else Y=D;endendmodule( )
答案:错

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(0) dxwkbang
返回
顶部