FPGA/HDLBits

Exams/m2014 q4c

장영현 2023. 6. 18. 15:42
728x90

Problem Statement

Implement the following circuit:

 

module top_module (
    input clk,
    input d, 
    input r,   // synchronous reset
    output q);

    always @(posedge clk)begin
        if(r)
            q <= 1'b0;
        else
 	       q <= d;
    end
    
endmodule

 


clk이 상승엣지일 시 동작이 작동해야한다. (synchronous reset이기 때문)