Thanks lut worked great I would never have thought to use it for this -----Original Message----- From: Jeff Epler [mailto:[email protected]] Sent: Sunday, November 16, 2014 9:06 PM To: Enhanced Machine Controller (EMC) Subject: Re: [Emc-users] Hal mux
The "lut5" component can be used to implement arbitrary functions of up to 5 bit inputs. Since the kind of lut you need has just three bit inputs, it is a good candidate for being implemented by lut5. http://linuxcnc.org/docs/html/man/man9/lut5.9.html http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Lut5 Specifically, you can use the "lut5.py" program to find the magic number for a two-input lut: $ python lut5.py -n3 '(i2 and i1) or (not i2 and i0)' # expression = (i2 and i1) or (not i2 and i0) #in: i4 i3 i2 i1 i0 out weight # 0: 0 0 0 0 0 0 # 1: 0 0 0 0 1 1 0x2 # 2: 0 0 0 1 0 0 # 3: 0 0 0 1 1 1 0x8 # 4: 0 0 1 0 0 0 # 5: 0 0 1 0 1 0 # 6: 0 0 1 1 0 1 0x40 # 7: 0 0 1 1 1 1 0x80 # setp lut5.N.function 0xca here, pin in-2 will function as the selection pin, and pins in-0 and in-1 will function as the two pins to be selected from. When in-2 is true, the value from in-1 is selected; when it is false, the value from in-0 is selected. Jeff ---------------------------------------------------------------------------- -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
