Added convertor for mod 5 and 6.

Bug in mod 6: out of bound (bit 31 shouldn't be used).