Regardless of the fact that this function was not used in design it has the wrong comment and implementation (vga_fifo_dc.v:129) gray2bin is not simple bin2gray on bin here is right function function AWIDTH:1 gray2bin; input AWIDTH:1 gray; integer i; begin for (i=1;i<AWIDTH;i++) gray2bini = ^(gray>>(i-1)); end endfunction