It depends on both MIPS opcode and MIPS function code .
MIPS opcode gives us instruction format.
instruction format
Design a MIPS control unit which generates signals on MIPS opcode and MIPS function code .
Go through each unique set of MIPS opcode , MIPS function code , see what MIPS control signal are generated.