#garfield Logs
Nov 08 2023
#garfield Calendar
06:59 AM rue_mohr: was there another power outage?
02:39 PM aandrew: https://ibb.co/Jq7VGq6
02:39 PM aandrew: been a while since I've had to work with these kinds of parts. heh
05:14 PM rue_mohr: what
05:14 PM rue_mohr: 485
05:15 PM rue_mohr: is the input on the rs485?
05:15 PM rue_mohr: no
05:15 PM rue_mohr: yes
06:13 PM aandrew: yes the signal I'm looking for is the start of an RS485 UART transmission. I could just look at the + or - but I had them so why not use them
06:13 PM aandrew: it worked first time too, which suprised me
06:14 PM aandrew: https://ibb.co/GQxTB5b
07:29 PM rue_mohr: the 121 is pretty good at just working right
07:29 PM rue_mohr: nice
07:50 PM aandrew: AAAAND it was available on amazon, which is kind of important since I have none of my stock with me
07:51 PM aandrew: ended up getting a very small cache of R/C/D, some mosfets and transistors, and some popcorn logic in DIP. The 121 and 123 were both avail, so I grabbed the dual just in case
07:51 PM aandrew: I kind of feel like I'm 14 or 15 again
07:55 PM rue_mohr: did you notice wallmart has electronic parts?
07:58 PM aandrew: some do, yes, but it's way way less than amazon. and you can order online like amazon but the shipping times are almost never good
08:02 PM rue_mohr: yea, when it comes up I giggle
08:02 PM rue_mohr: their prices are crazy
08:03 PM rue_mohr: but, hey
08:10 PM rue_mohr: why did ma take the pickle juice?
08:11 PM rue_mohr: asking her is useless, she will deny it and say she knows nothing
08:11 PM rue_mohr: which might be trie
08:11 PM rue_mohr: true
08:39 PM aandrew: maybe she's gonna have a few caesars
08:39 PM rue_mohr: oh no, I hope she's not drinking again
08:41 PM rue_mohr: for (f = 0, j = 0; f = (bin[j] > 4)?1:f, j < 4; j++)
08:42 PM rue_mohr: OOooo...
08:44 PM rue_mohr: printf(" %s \n", f?"(FAIL)":"<------PASS.");
08:44 PM rue_mohr: I'm twisting it up good tonight
08:58 PM rue_mohr: ok
08:58 PM rue_mohr: if you make every set of gates possible with 2 inputs
08:59 PM rue_mohr: you will get 16 types of gates
08:59 PM rue_mohr: one of them is always true, and one is always false
08:59 PM rue_mohr: so we will ignore those, 14 left
09:00 PM rue_mohr: AND NAND OR NOR XOR NXOR makes 6
09:00 PM rue_mohr: then the funny stuff
09:01 PM rue_mohr: A&/B /(A&/B) /A&B /(/A&B)
09:02 PM rue_mohr: makes 10
09:02 PM rue_mohr: so 4 are missing
09:02 PM rue_mohr: maybe
09:02 PM rue_mohr: A /A B /B ?
09:07 PM rue_mohr: if I'm searching for a logic gate that matches a column of bits
09:08 PM rue_mohr: I suppose there are two ways to do it
09:08 PM rue_mohr: I can take the bits and check against each gate
09:08 PM rue_mohr: or
09:08 PM rue_mohr: list which gates match the output
09:09 PM rue_mohr: for example
09:09 PM rue_mohr: A B Y
09:09 PM rue_mohr: 1 1 1
09:09 PM rue_mohr: could be AND, OR, NXOR, TRUE...
09:09 PM rue_mohr: other stuff
09:10 PM rue_mohr: but
09:10 PM rue_mohr: thats not quite right, that could only match against 8 gates
09:10 PM rue_mohr: hu
09:11 PM rue_mohr: one of them accounts for the column tho
09:11 PM rue_mohr: but
09:11 PM rue_mohr: hmmm
09:12 PM rue_mohr: ouch mind bender
09:13 PM rue_mohr: so, with two given inputs and an output, you can only ... it must match two
09:23 PM VanUnamed: heey rue_mohr !
09:23 PM VanUnamed: you get to pick 3 pictures of your projects at random and share them
09:28 PM rue_mohr: hah
09:28 PM rue_mohr: you want 3 random pics?
09:29 PM rue_mohr: (on the logic project:) it turns out any A,B,Y combination actually maps to 8 logic gates
09:29 PM rue_mohr: (of the 16)
09:37 PM Tom_L: http://linuxcnc.org/docs/stable/html/man/man9/lut5.9.html
09:37 PM Tom_L: similar?
09:38 PM rue_mohr: kinda, mines just 2 inputs
09:38 PM Tom_L: i used that on once but don't think i am now
09:42 PM rue_mohr: I'm trying to build something that can look at a logic table and tell me if any of the outputs corrospond to simple logic gates of the inputs
09:42 PM rue_mohr: its bending my brain in new ways
09:43 PM Tom_L: of course they do
09:46 PM Tom_L: nor, and, or
09:46 PM Tom_L: for 2 inputs
09:46 PM rue_mohr: I have a table I'm feeding it
09:46 PM rue_mohr: of values, and I wast it to find corrilations
09:48 PM rue_mohr: so
09:48 PM rue_mohr: lets say I have a table like this
09:48 PM rue_mohr: A B Y
09:48 PM rue_mohr: 0 0 0
09:48 PM rue_mohr: 0 1 1
09:48 PM rue_mohr: 1 0 1
09:48 PM rue_mohr: 1 1 0
09:48 PM rue_mohr: I want it to tell me which gate that conforms to
09:49 PM rue_mohr: and its actually easy
09:49 PM rue_mohr: uint16_t GATEMATCH[] = {0b0000000011111111, 0b1111111100000000, 0b0000111100001111, 0b1111000011110000, 0b0011001100110011, 0b1100110011001100, 0b0101010101010101, 0b1010101010101010 };
09:49 PM rue_mohr: there are 16 possible gates
09:49 PM rue_mohr: that table is a flag table for which gates conform to a 3 input set
09:49 PM rue_mohr: all I have to do is AND them up
09:49 PM rue_mohr: char * GATESTRING[] = {"FALSE","AND","TWO","B","ONE","A","XOR","OR","NOR","NXOR","NA","NONE","NB","NTWO","NAND","TRUE" };
09:50 PM rue_mohr: this is the names of the gates that corrospond to the bits
09:50 PM rue_mohr: after those 4 lookups, only 1 or the 16 bits will be set
09:50 PM rue_mohr: zippo:/files/programming/c/4b7s/two# gcc main.c ; ./a.out
09:50 PM rue_mohr: XOR
09:50 PM rue_mohr: :)
09:50 PM rue_mohr: BUT
09:50 PM rue_mohr: whats important is that I can run a whack of values thru it
09:51 PM rue_mohr: in my table there are 10 rows
09:51 PM rue_mohr: if there are 0 bits left, it does not conform to a gate
10:17 PM rue_mohr: damnit I need 9 bits
10:18 PM rue_mohr: do I upgrade it all to 16?
10:38 PM VanUnamed: rue_mohr: did u see the iron/iron battery?
10:39 PM rue_mohr: no, what did they work out now?
10:39 PM VanUnamed: you can have batteries made with iron plates
10:40 PM rue_mohr: like lead
10:40 PM rue_mohr: so what is the one plate treated with?
10:40 PM VanUnamed: idk
10:41 PM rue_mohr: ok I have to ask the program this question in reverse
10:43 PM rue_mohr: I need to ask it, for 1 given input and an output, what the other input would have to be to conform to a logic gate
10:44 PM rue_mohr: but I need to ask it that for all the gates at once
10:55 PM rue_mohr: fire alarm at work, gtg