public int execute(Instruction inst) {

		this.inst = inst;

		InstructionType type = inst.get_type();
		int format = inst.get_format();

		switch (format) {
		case 0:
			if (r_format())
				return result;
			break;
		case 1:
			if (memory_format())
				return result;
			break;
		case 2:
			if (memory_format())
				return result;
			break;
		// branch case
		// if the branch condition is true then : PC <- PC + 4 + (sign-extended
		// immediate field)<<2.
		// two types : bne , beq
		case 3:
			branch_format();
			return 0;
		case 4:
			// j and jal , there is no ALU as they only update the PC ==> 'PC <-
			// target address'
		case 5:
			// jr => Sets only the value of PC to the value of the 'rs' register
		}

		return 0;
	}