Altera_Forum
Honored Contributor
9 years agofinding single max value in an input signal having 1000 decimal values
I want to find max in input file, read from a memory. This input file size 1000 decimal sample values. I have written the following code to find max value but it didn't give the correct result .plzzz help me so i can find a single max value in this input signal..thanks in advance..
module max_min(input clk, input [15:0]din, output [15:0]dout); reg [15:0]max=0; always @(posedge clk) beginif($signed(din)>max) max<=din; else
max<=0; end
assign dout=max;`endmodule