I have a a 8-to-4 Multiplexer ICs (MM74hC4052N) and I want to use it as a 8-to-4 encoder or 8-to-3 encoder.

Is that possible? If it is, can drop me some hints on how to do that?

At one glance, I thought this 8-to-4 Mux works by taking inputs (in this case, 8 inputs) and using the select signal, it channels the inputs simultaneously into the 4 outputs.However, after reading the data sheet, I was getting confused. The truth table does not follow what I thought.

Practically, I have 8 switches representing 8 bits of a binary number, and I need to send a 4 bits signal to a microcontroller, representing the 8 bits binary number, using this 8-to-4 IC.

Link to datasheet : http://www.farnell.com/datasheets/89046.pdf

  • \$\begingroup\$ From 8 switches you should get a 3-bit signal, unless you are looking for some redundant coding scheme. The appropriate 74-series part would be the 74148... \$\endgroup\$
    – user16324
    Jan 17, 2013 at 22:21
  • \$\begingroup\$ that would be the ideal case. But I'm stuck with this ICs at this moment \$\endgroup\$ Jan 18, 2013 at 9:19

1 Answer 1


First of all, the 74HC4052 is not an 8-to-4 multiplexer, it is a dual 4-to-1 multiplexer with common select inputs.

If I understand correctly, you want to connect a total of 8 switches, four at a time, to your microcontroller. You would need two of these chips in order to do that.

However, you could connect them two at a time to your microcontroller with just one of these chips.

  • \$\begingroup\$ Actualy, it is not the switches to be connected to the microcontroller, but merely a coded 4 bits representing one of the 8 switches \$\endgroup\$ Jan 17, 2013 at 21:20
  • \$\begingroup\$ In that case, this chip is not a good fit for the application. It would actually be easier to have firmware on the microcontroller read in the switches two at a time and then encode the value, than to build a hardware encoder with this chip. \$\endgroup\$
    – Dave Tweed
    Jan 17, 2013 at 21:47
  • \$\begingroup\$ I just figured it out.. If I connect 4 switches at the inputs (of 1 4-to-1 Mux) that has 2 outputs (pick one out of that two at a time) and 4 other switches with the same configuration, I could actually have 8 switches encoded into 4 bits. 4-to-1(one out of two, the non active is LOW) 4-to-1(one out of two, the non active is LOW) Then it hits me, can I make the the output of MUX both 0? checking the Truth Table, I then found out that both Mux are sharing two input A & B, and not 2 pairs of A & B, and thus the implementation is not possible.... Is this correct? \$\endgroup\$ Jan 18, 2013 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.