www.pudn.com > x86.rar > bitScanRev.v, change:2007-12-05,size:1835b


//	This module is used to scan the given input from left 
//	finds the position where the first 1 is present 
 
 
 
module bitScanRev(indexOutRev, scanInRev); 
input [31:0]scanInRev; 
output [4:0]indexOutRev; 
assign 		indexOutRev = (scanInRev[31])? (5'd31): 
                    ((scanInRev[30])? (5'd30) : 
                    ((scanInRev[29])? (5'd29) : 
                    ((scanInRev[28])? (5'd28) : 
                    ((scanInRev[27])? (5'd27) : 
                    ((scanInRev[26])? (5'd26) : 
                    ((scanInRev[25])? (5'd25) : 
                    ((scanInRev[24])? (5'd24) : 
                    ((scanInRev[23])? (5'd23) : 
                    ((scanInRev[22])? (5'd22) : 
                    ((scanInRev[21])? (5'd21) : 
                    ((scanInRev[20])? (5'd20) : 
                    ((scanInRev[19])? (5'd19) : 
                    ((scanInRev[18])? (5'd18) : 
                    ((scanInRev[17])? (5'd17) : 
                    ((scanInRev[16])? (5'd16) : 
                    ((scanInRev[15])? (5'd15) : 
                    ((scanInRev[14])? (5'd14) : 
                    ((scanInRev[13])? (5'd13) : 
                    ((scanInRev[12])? (5'd12) : 
                    ((scanInRev[11])? (5'd11) : 
                    ((scanInRev[10])? (5'd10) : 
                    ((scanInRev[9])? (5'd9) : 
                    ((scanInRev[8])? (5'd8) : 
                    ((scanInRev[7])? (5'd7) : 
                    ((scanInRev[6])? (5'd6) : 
                    ((scanInRev[5])? (5'd5) : 
                    ((scanInRev[4])? (5'd4) : 
                    ((scanInRev[3])? (5'd3) : 
                    ((scanInRev[2])? (5'd2) : 
                    ((scanInRev[1])? (5'd1) : 
                    ((scanInRev[0])? (5'd0) : 
                    (5'bz)))))))))))))))))))))))))))))))); 
endmodule