Electronic – How to use multiple BCD switches as a single binary input

digital-logic

I'm trying to convert a 4-digit (decimal) number to binary. My input is a BCD switch (this one). I've been looking to see if I can find either a logic-based circuit or a specific decoder IC to convert the values off of the switch array into a single binary number. I don't seem to be having much luck though.
Is there a good way to do this wither with some sort of converter or with logic? I'd appreciate your thoughts.
Thanks!

Best Answer

As you're very unlikely to find an off the shelf chip that solves a specific (but not very common) problem the chances are you will have to build something. The conversion of the BCD to binary is a simple but repetitive task and is suited to a small micro controller but the number of input/output pins required is quite large so converting the code to a serial stream with an external shift register - parallel in/serial out for reading the BCD switches and a serial in/parallel out for the output binary number will help out. You should be able to control everything with no more than 6 i/o pins on the controller (fix operation mode with a pull up/down resistor)

enter image description here

You'll need 14 bits to display the maximum value of the bcd (9999). The uC can just about be anything. Input through 74F676 16-Bit Serial/Parallel-In, Serial-Out Shift Register and output through 74F675A 16-Bit Serial-In, Serial/Parallel-Out Shift Register

Expanding the number of BCD switches involves adding extra shift registers and a small change in the program.