/// <summary> /// Sets multi-bit result from the 32 bit parameter /// </summary> /// <param name="state"></param> /// <returns></returns> protected bool SetResult(int state) { bool changed = false; for (int i = 0; i < this.result.Length; i++) { changed |= this.SetResult(i, CircuitFunction.FromBool((state & (1 << i)) != 0)); } return(changed); }
protected bool Read() { int state = Memory.CellValue(this.data, this.DataBitWidth, this.ReadNumericState(this.address)); if (this.address2 == null) { return(this.SetResult(state)); } else { bool changed = false; for (int i = 0; i < this.outputData.Length; i++) { changed |= this.SetResult(i, CircuitFunction.FromBool((state & (1 << i)) != 0)); } state = Memory.CellValue(this.data, this.DataBitWidth, this.ReadNumericState(this.address2)); for (int i = 0; i < this.outputData2.Length; i++) { changed |= this.SetResult(i + this.outputData.Length, CircuitFunction.FromBool((state & (1 << i)) != 0)); } return(changed); } }
public override bool Evaluate() { return(this.SetResult0(CircuitFunction.FromBool(this.state))); }
public override bool Evaluate() { return(this.SetResult0(CircuitFunction.FromBool((this.Count(State.On1) & 1) == 1))); }