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

Have a suggestion for the website or forum? Post it here.
Post Reply
WillAdams
Posts: 8542
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

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

Post by WillAdams » Sun Jan 22, 2017 3:45 pm

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.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets
Nomad 883 Pro #596 (bamboo)

CastIrony
Posts: 650
Joined: Mon Jul 21, 2014 10:21 pm
Location: Portland, OR

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

Post by CastIrony » Mon Jan 23, 2017 5:46 pm

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 
Shapeoko 3 #192 - Complete! Needs limit switches.

WillAdams
Posts: 8542
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

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

Post by WillAdams » Mon Jan 23, 2017 5:54 pm

Thanks! Much appreciated.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets
Nomad 883 Pro #596 (bamboo)

Post Reply