public String generateAllOutputs() throws Exception
	{
		// The first lines about the number of states and their names
		String result = "STATES_NO:" + (int) Math.pow(2, flipflops.size())
				+ "\n";
		result += "STATES: ";
		for (int i = 0; i < Math.pow(2, flipflops.size()); i++)
			result += "S" + i + " ";
		result += "\n";
		result += "STATE_DIAGRAM:\n";

		// Try all the possible states
		ArrayList<ArrayList<Boolean>> allStates = CircuitHelpers
				.binaryCombination(flipflops.size());
		for (int state = 0; state < allStates.size(); state++)
		{
			result += "S" + state + ":\n";

			// assign the flip flops states to this configuration
			CircuitHelpers.mapFlipFlopsCurrentStates(flipflops,
					allStates.get(state));

			// Generate and try all the possible combinations of the input
			ArrayList<ArrayList<Boolean>> allInputsCombinations = CircuitHelpers
					.binaryCombination(inputs.size());
			for (int inputCombination = 0; inputCombination < allInputsCombinations
					.size(); inputCombination++)
			{
				// Assign the input values to the current combination
				CircuitHelpers.mapInputValues(inputs,
						allInputsCombinations.get(inputCombination));
				for (Input input : inputs)
					result += input.name + "="
							+ CircuitHelpers.boolToInteger(input.getValue())
							+ " ";

				// Find the next state
				int nextState = CircuitHelpers.nextStatesToDecimal(flipflops);
				result += "-> S" + nextState;

				// Find the outputs
				for (Output output : outputs)
					result += "," + output.name + "="
							+ CircuitHelpers.boolToInteger(output.getValue())
							+ " ";
				result += "\n";
			}
		}
		return result;
	}