title: How I can find maximum number in verilog array
body: <p>So, I have a <code>reg[7:0] corr_Output[0:63];</code> which is filled with values in my module. How I can find maximum number in this array at one CLK cycle?
  I wrote a 8 bit comparator:</p>
  
  <pre><code>module Comparator2D(
  input [7:0] X1,
  input [7:0] indexX1,
  input [7:0] X2,
  input [7:0] indexX2,
  output [7:0] Y,
  output [7:0] indexY
  );
  
  always begin
      if (X1 &gt; X2) begin
          Y = X1;
          indexY = indexX1;
      end
      else begin
          Y = X2;
          indexY = indexX2;
      end
  end
  endmodule
  </code></pre>
  
  <p>But I dont know how I should  instantiate this module in my top design? I think I should use "for loop", or even write another module which will concatenate my Comparator2D module in pyramid form, but as I found  I cant pass whole array to input port of module, so Im a little stuck..</p>