module Log_max(v,n_var,T,clk);
input clk;
input [31:0]v;
output [31:0]n_var;
output reg [31:0] T;
wire [31:0] v;
reg [31:0]n_var;
//reg [3:0] base = 2;
//floor of the log base 2
function integer CLogB2;
input [31:0] Depth; //pseudo input port which remains unused throughout the program
integer i;
begin
//i = Depth;
i= 2614;
for(CLogB2 = 0; i > 1; CLogB2 = CLogB2 + 1)
i = i >> 1;
end
endfunction
always @ (posedge clk)
begin
n_var = CLogB2(v);
//T = base ** n_var; This is unsynthesizable. Can only be simulated
T = 2 ** n_var;
end
endmodule