Beispiel #1
0
        private int GridPositionToMinterm(int x, int y)
        {
            var x_gray = GrayCodeConverter.Decimal2Gray(x);
            var y_gray = GrayCodeConverter.Decimal2Gray(y);

            var result = y_gray * (1 << varsX.Length) + x_gray;

            return(result);
        }
Beispiel #2
0
        private Point MintermToGridPosition(int minterm)
        {
            var y_gray = minterm >> varsX.Length;
            var x_gray = minterm - (y_gray << varsX.Length);

            var pos = new Point(
                GrayCodeConverter.Gray2Decimal(x_gray),
                GrayCodeConverter.Gray2Decimal(y_gray)
                );

            return(pos);
        }