第1题:
关于以下程序,下列说法中正确的是 module Mux21 (a,b,s,y); input a,b; input s; output y; reg y; always @(a or b or s) if (!s) y = a; else y = b; endmodule
A.每当a或b或s生变化时,将执行always模块内语句
B.a,b可以被定义为wire型
C.该程序输出的表达式为y=(~s)a+sb
D.y可以被定义为wire型
第2题:
下面的代码的执行结果是____ s = 'F' if s == 'f': print('lady') else: print('man')
第3题:
2、下列不是合法标识符的是()
A._abc
B.a_s1
C.d$shut
D.always
第4题:
3、下列哪一个表述是正确:
A.always@(posedge CLK or RST)
B.always@(posedge CLK or negedge RST or A)
C.always@(posedge CLK or D or Q)
D.always@(posedge CLK or negedge RST)
第5题:
下列Moore型状态机采用Verilog语言主控时序部分正确的是:
A.always@(posedge clk or negedge reset) begin if(!reset) current_state<=s0; else current_state<=next_state; end
B.always@(posedge clk ) begin if(!reset) current_state<=s0; else current_state<=next_state; end
C.always@(posedge clk t) if(reset) current_state<=s0; else current_state<=next_state;
D.always@(posedge clk or negedge reset) if(reset) current_state<=s0; else current_state<=next_state;
第6题:
以下的描述中,必然是对Mealy型状态机的描述的是?
A.always @(*) case (state) S0: begin out = 0; if (in) next_state = S1; else next_state = S2; end ……#B.always @(*) case (state) S0: begin if (in) next_state = S1; else next_state = S0; end ……#C.always @(*) case (state) S0: begin if (in) begin next_state = S1; out=1 end else next_state = S0; end ……#D.以上答案均不正确