data/full_repos/permissive/436253691/hardware/nios_sys/nios_system/synthesis/submodules/COUNTER_OFFSET_NEG.v
data/verilator_xmls/3a1305ef-f0ec-4128-8a87-5de791cece78.xml
module COUNTER_OFFSET_NEG #(parameter BITWIDTH=10) (


COUNTER_OFFSET_Clk,
COUNTER_OFFSET_Clr,
COUNTER_OFFSET_En,
COUNTER_OFFSET_Number,
COUNTER_OFFSET_offset,


COUNTER_OFFSET_Out,
COUNTER_OFFSET_Eqn_Flag
);






input COUNTER_OFFSET_Clk;
input COUNTER_OFFSET_Clr;
input COUNTER_OFFSET_En;
input [BITWIDTH-1:0] COUNTER_OFFSET_Number;
input [BITWIDTH-1:0] COUNTER_OFFSET_offset;
output [BITWIDTH-1:0] COUNTER_OFFSET_Out;
output COUNTER_OFFSET_Eqn_Flag;





reg [BITWIDTH-1:0] counter;





always@(negedge COUNTER_OFFSET_Clk or negedge COUNTER_OFFSET_Clr)
begin
		if(!COUNTER_OFFSET_Clr)
			counter<=0;
		else if(COUNTER_OFFSET_En)
			counter<=counter +1'b1;
end






assign COUNTER_OFFSET_Out=counter+COUNTER_OFFSET_offset;
assign COUNTER_OFFSET_Eqn_Flag = counter== COUNTER_OFFSET_Number ? 1'b1 : 1'b0;


endmodule
module COUNTER_OFFSET_NEG #(parameter BITWIDTH=10) (


COUNTER_OFFSET_Clk,
COUNTER_OFFSET_Clr,
COUNTER_OFFSET_En,
COUNTER_OFFSET_Number,
COUNTER_OFFSET_offset,


COUNTER_OFFSET_Out,
COUNTER_OFFSET_Eqn_Flag
);







input COUNTER_OFFSET_Clk;
input COUNTER_OFFSET_Clr;
input COUNTER_OFFSET_En;
input [BITWIDTH-1:0] COUNTER_OFFSET_Number;
input [BITWIDTH-1:0] COUNTER_OFFSET_offset;
output [BITWIDTH-1:0] COUNTER_OFFSET_Out;
output COUNTER_OFFSET_Eqn_Flag;





reg [BITWIDTH-1:0] counter;





always@(negedge COUNTER_OFFSET_Clk or negedge COUNTER_OFFSET_Clr)
begin
		if(!COUNTER_OFFSET_Clr)
			counter<=0;
		else if(COUNTER_OFFSET_En)
			counter<=counter +1'b1;
end






assign COUNTER_OFFSET_Out=counter+COUNTER_OFFSET_offset;
assign COUNTER_OFFSET_Eqn_Flag = counter== COUNTER_OFFSET_Number ? 1'b1 : 1'b0;


endmodule