以下语言是数据流建模方式吗?
A: xor x1(a,b,c):
B: assign adder_out = mult_out + out;
C: always @ (a or b or sel) begin if (sel) c = a; else c = b;?end
D: and a1(out,in1,in2);
A: xor x1(a,b,c):
B: assign adder_out = mult_out + out;
C: always @ (a or b or sel) begin if (sel) c = a; else c = b;?end
D: and a1(out,in1,in2);
举一反三
- 下面哪种代码执行后是与其他结果不一样的? A: module mux2_1(a,b,sel,out); input a,b,sel; output out; assign out=(sel==1)?a:b; endmodule B: module mux2_1(a,b,sel,out); input a,b,sel; output out; reg out; always@(a or b or sel) begin case(sel) 0: out=a; 1: out=b; endcase end endmodule C: module mux2_1(a,b,sel,out); input a,b,sel; output out; reg out; always@(*) if(sel==0) out=a; else out=b; endmodule
- 下面梯形图程序的功能是,当M2.0=1时,( ) A: IN1+IN2=OUT B: IN1-IN2=OUT C: IN1×IN2=OUT D: IN1÷IN2=OUT
- 门级建模中,以下调用语句正确的是( )。 A: or or1(out, in1 ,in2); B: or or1(in1 ,in2,out); C: buf b1(in, out1, out2); D: buf b1(out1, in, out2);
- 在语句assign Y = sel ? 0 : 1;中,当sel=0时,Y的值为( )? z|x|0|1
- 下列代码描述中,不能产生时序逻辑的( ) A: always (*)begainif (a&b) rega=c;elserega=0;end B: always (*)begainif (a&b) rega=c;y=rega;end C: always @(a)begainCase(a)2’b00: out=4’b0001;2’b01: out=4’b0010; 2’b10: out=4’b0100;endcaseend