public void ConstValuePort(Port port, bool isOne) { //var a = Assignment.Parse(this, port.N ); if (Assigmnets.FirstOrDefault(a => a.Left.Signal.Name == port.Name) != null) { var istr = Regex.Match(port.Name, IndexPattern).Value; int index; int.TryParse(istr, out index); var initVector = InitVector.ExtractInitVectorValut(GetInitVector()); var binaryValut = InitVector.FromHexToBibValue(initVector); var newBinary = new StringBuilder(string.Empty); var bit = isOne ? '1' : '0'; for (int j = 0; j < binaryValut.Length; j++) { newBinary.Append(j % ((index + 1) * 4) < (index + 1) * 2 ? bit : binaryValut[j]); } var hex = InitVector.FomBinToHexValue(newBinary.ToString()); var newVector = InitVector.ValueToVector(hex); ChangeInitVector(newVector); } }
public AssignmentSignal GetOutput() { return(Assigmnets.FirstOrDefault(x => x.Left.Signal.Name == Entity.Ports.FirstOrDefault(c => c.PortType == PortTypes.Out).Name).Right.Signal); }