Exams/ece241 2014 q4

Given the finite state machine circuit as shown, assume that the D flip-flops are initially reset to zero before the machine begins.

Build this circuit.

错误代码:

module top_module (
    input clk,
    input x,
    output z
); 
reg q1,q2,q3;
    initial begin
        q1 =0;
        q2 =0;
        q3 =0;
    end
    always @(posedge clk)begin
    	q1 <= x^q1;
        q2<= x&~q2;
        q3 <= x|~q3;
    
       z = ~(q1|q2|q3);
    
   end
endmodule

因为always 内语句是同时执行所以存在 z 输出不对的情况。

module top_module (
    input clk,
    input x,
    output z
); 
reg q1,q2,q3;
    initial begin
        q1 =0;
        q2 =0;
        q3 =0;
    end
    always @(posedge clk)begin
    	q1 <= x^q1;
        q2<= x&~q2;
        q3 <= x|~q3;
     end
      assign  z = ~(q1|q2|q3);
    
  
endmodule

上一篇:速盾:如何判断高防服务器的防御是否真实?


下一篇:探索大型语言模型在文化常识方面的理解能力与局限性-实验装置