data/full_repos/permissive/120944384/code/synt/calc_weight_coef.sv
[Errno 2] No such file or directory: 'preprocess.output'
data/verilator_xmls/96a6144f-a54b-42ef-91ef-c1b88ea59b52.xml
module calc_weight_coef
#(
	parameter DATA_WIDTH = 32
)
(

	input wire							clk,


	input wire	[DATA_WIDTH-1: 0]		Z,
	output wire	[DATA_WIDTH-1: 0]		weight_coef
);

localparam Zmin = 0;
localparam Zmax = 255;
localparam Zhalf_summ = (Zmax + Zmin)/2;

reg [DATA_WIDTH: 0]		Zsumm;
reg	[DATA_WIDTH-1: 0]	weight_coef_tmp;
always @( posedge clk )
	if ( Z <= Zhalf_summ )
		weight_coef_tmp = Z - Zmin;  
	else
		weight_coef_tmp = Zmax - Z; 


assign weight_coef = ( weight_coef_tmp != 0 ) ? weight_coef_tmp : 1; 
		
endmodule
module calc_weight_coef
#(
	parameter DATA_WIDTH = 32
)
(

	input wire							clk,


	input wire	[DATA_WIDTH-1: 0]		Z,
	output wire	[DATA_WIDTH-1: 0]		weight_coef
);


localparam Zmin = 0;
localparam Zmax = 255;
localparam Zhalf_summ = (Zmax + Zmin)/2;

reg [DATA_WIDTH: 0]		Zsumm;
reg	[DATA_WIDTH-1: 0]	weight_coef_tmp;
always @( posedge clk )
	if ( Z <= Zhalf_summ )
		weight_coef_tmp = Z - Zmin;  
	else
		weight_coef_tmp = Zmax - Z; 


assign weight_coef = ( weight_coef_tmp != 0 ) ? weight_coef_tmp : 1; 
		
endmodule