Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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... – Brian Drummond Jan 17 '13 at 22:21
that would be the ideal case. But I'm stuck with this ICs at this moment – CacheMemory Jan 18 '13 at 9:19

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.

share|improve this answer
Actualy, it is not the switches to be connected to the microcontroller, but merely a coded 4 bits representing one of the 8 switches – CacheMemory Jan 17 '13 at 21:20
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. – Dave Tweed Jan 17 '13 at 21:47
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? – CacheMemory Jan 18 '13 at 3:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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