genrate decode matrix