resolve() {
        if (this.reset.value == 1) {
            this.masterState = this.slaveState = this.preset.value || 0;
        } else if (this.en.value == 0) {
            this.prevClockState = this.clockInp.value;
        } else if (this.en.value == 1 || this.en.connections.length == 0) {
            if (this.clockInp.value == this.prevClockState) {
                if (this.clockInp.value == 0 && this.J.value != undefined && this.K.value != undefined) {
                    if (this.J.value && this.K.value) { this.masterState = 1 ^ this.slaveState; }
                    else if (this.J.value ^ this.K.value) { this.masterState = this.J.value; }
                }
            } else if (this.clockInp.value != undefined) {
                if (this.clockInp.value == 1) {
                    this.slaveState = this.masterState;
                } else if (this.clockInp.value == 0 && this.J.value != undefined && this.K.value != undefined) {
                    if (this.J.value && this.K.value) { this.masterState = 1 ^ this.slaveState; }
                    else if (this.J.value ^ this.K.value) { this.masterState = this.J.value; }
                }
                this.prevClockState = this.clockInp.value;
            }
        }

        if (this.qOutput.value != this.slaveState) {
            this.qOutput.value = this.slaveState;
            this.qInvOutput.value = this.flipBits(this.slaveState);
            simulationArea.simulationQueue.add(this.qOutput);
            simulationArea.simulationQueue.add(this.qInvOutput);
        }

        this.setOutputsUpstream(true);
    }
@memberof JKflipFlop
Edge triggered master slave JK flip flop is resolved by
setting the slaveState = masterState when there is an edge
in the clock. masterState = this.J when no change in clock.