4 bits --> 16 outputs

More
02 Apr 2021 17:29 #204537 by pferrick
Hi all-

What is the recommended method to take 4 7i76 input bits and make one of 16 gcode subroutines happen?

It seems as though I need the HAL equivalent of a BCD-to-decimal chip. I originally thought that weighted_sum would do it, but I haven't been able to figure out how to use the output to trigger MDI commands in my ini file.

Thanks in advance for any suggestions!

regards,
Patrick

Please Log in or Create an account to join the conversation.

More
02 Apr 2021 18:39 #204541 by PCW
Replied by PCW on topic 4 bits --> 16 outputs
There is such a component but only for 8 outputs: select8
it should be possible to combine 2 of these ( one enabled by /bit3 and
the other by bit3) to get a 1/16 decoder

Please Log in or Create an account to join the conversation.

More
02 Apr 2021 18:43 #204542 by roland
Replied by roland on topic 4 bits --> 16 outputs
Hi Patrick,

i do this with a component i wrote for it.

--
Roland

File Attachment:

File Name: bitsel16.comp
File Size:1 KB
Attachments:
The following user(s) said Thank You: pferrick

Please Log in or Create an account to join the conversation.

More
02 Apr 2021 18:45 #204543 by Henk
Replied by Henk on topic 4 bits --> 16 outputs
Hi.
mux16 does this...but it gives float/s32 output values, not bits

If it was me, I would probably just use classic ladder

You could use match8 with a count of 16 (I think) and connect the a bits to your inputs and setp the b bits for each instance...

There may be better ways though

H

Please Log in or Create an account to join the conversation.

More
02 Apr 2021 18:53 #204545 by pferrick
Replied by pferrick on topic 4 bits --> 16 outputs
Thanks very much Roland....I was just getting ready to (finally) learn how to write a new component, but now all I have to do is learn how to install yours! One step at a time....

Patrick

Please Log in or Create an account to join the conversation.

Time to create page: 0.119 seconds
Powered by Kunena Forum