public static Integer computeLogic(GateType gate_type,ArrayList<Integer> inputs){
  Integer out=new Integer(-1);
  if (gate_type == GateType.OR || gate_type == GateType.OUTPUT_OR || gate_type == GateType.OUTPUT) {
    out=computeOR(inputs);
  }
 else   if (gate_type == GateType.NOR) {
    out=computeNOR(inputs);
  }
 else   if (gate_type == GateType.NOT) {
    out=computeNOT(inputs.get(0));
  }
 else   if (gate_type == GateType.AND) {
    out=computeAND(inputs);
  }
  return out;
}

public static Integer computeLogic ( GateType gate_type , ArrayList < Integer > inputs ) { Integer out = new Integer ( - 1 ) ; if ( gate_type == GateType . OR || gate_type == GateType . OUTPUT_OR || gate_type == GateType . OUTPUT ) { out = computeOR ( inputs ) ; } else if ( gate_type == GateType . NOR ) { out = computeNOR ( inputs ) ; } else if ( gate_type == GateType . NOT ) { out = computeNOT ( inputs . get ( 0 ) ) ; } else if ( gate_type == GateType . AND ) { out = computeAND ( inputs ) ; } return out ; }
compute logic based on gate type and input bits not of [ 0 ] = 1 nor of [ 0 , 0 ] = 1 and of [ 1 , 1 ] = 1 output of [ 1 ] = 1 output_or of [ 0 , 1 ] = 1
