Dar89
Junior Member level 1
Hello,
I have to solve a problem end the most effective way I have found is to put some logic on the asynchronous reset pin of a flip-flop. I can do this by putting and AND between the global_reset (which is and asynchronous reset, but synchronized before driving registers) and a control signal, as reported in the following. Do you see any reliability issue in this code?
I have to solve a problem end the most effective way I have found is to put some logic on the asynchronous reset pin of a flip-flop. I can do this by putting and AND between the global_reset (which is and asynchronous reset, but synchronized before driving registers) and a control signal, as reported in the following. Do you see any reliability issue in this code?
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 module(clk, sync_rst, T, In, Out) input clk, sync_rst, T, In; output Out; reg T_reg; wire int_rst; assign int_rst = !(sync_rst & T_reg); always @(posedge clk) T_reg <= T; end always @(posedge clk, negedge int_rst) begin if(int_rst ) Out <= 1'b0; else if(T) //clock gating Out <= In; end endmodule
Last edited by a moderator: