Page 1 of 1

Interested in binary logic problems/math --- Help?

Posted: Sun Jan 22, 2017 3:45 pm
by WillAdams
Should be pretty simple --- I finally found the time to fill out the rows in the invert bits setting for Grbl 0.9:

http://www.shapeoko.com/wiki/index.php/Grbl#Grbl0.9

Don't have a spreadsheet and it's too early in the morning to write a script/program, so I did it by hand --- would someone please check that I got the math/logic right? Thanks.

Re: Interested in binary logic problems/math --- Help?

Posted: Mon Jan 23, 2017 5:46 pm
by CastIrony
Tried in a spreadsheet, and then my spreadsheet didn't have an XOR function, so I wrote a script.

Your table is correct.

Code: Select all

for oldValue in 0...7
{
    for flags in [1, 2, 4, 3, 5, 6, 7]
    {
        print("\(oldValue ^ flags) ", separator: " ", terminator: "")
    }

    print("")
}

Code: Select all

1 2 4 3 5 6 7 
0 3 5 2 4 7 6 
3 0 6 1 7 4 5 
2 1 7 0 6 5 4 
5 6 0 7 1 2 3 
4 7 1 6 0 3 2 
7 4 2 5 3 0 1 
6 5 3 4 2 1 0 

Re: Interested in binary logic problems/math --- Help?

Posted: Mon Jan 23, 2017 5:54 pm
by WillAdams
Thanks! Much appreciated.