1

I had an interview a few days back and this was the question they asked me in one of the rounds:

A mux which gives output a when select line is 1 and b when it is 0. The output is represented as C. This has to be implemented with and and not gates only.

I got it almost but was not sure how the output is received finally in combinational ckt. It is a very simple thing I missed here. I gave the select line to an and gate and input a and the select line and the input b through a not gate to another and gate so I got the output as A and B but how can we have one output alone? either a or b?

Ram
  • 547
  • 2
  • 4
  • 13

2 Answers2

1
 C = (A and not(S)) or (B and S)
   = not(not(A and not(S)) and not(B and S))
Anthony Blake
  • 5,328
  • 2
  • 25
  • 24
  • Hey only and gate and not gate. You have used "or" – Ram Nov 24 '11 at 00:12
  • I included the first line to show working. The second line is how to do it without the OR. – Anthony Blake Nov 24 '11 at 00:13
  • Basically it's a question to prove you know Demorgan's laws (often call theorems, but I'm not sure why). I remember it as 'Split the line, change the sign' (Where the line is the bar above showing inversion, and the sign is AND or OR). The next step is to do everything with NAND gates: http://www.wolframalpha.com/input/?i=demorgans+theorem – Paul S Nov 24 '11 at 12:58
  • 1
    @AnthonyBlake: I think your answer is slightly wrong. "A when select is 1" and you've got (A and not(S)), which is A when select is 0. – Paul S Nov 24 '11 at 13:06
  • Ahh OK -- I just copied the equation for a MUX off wikipedia and then applied demorgans laws. I didn't actually check to see if it was around the right way. Also, I vaguely remember that in practice, MUXes are usually implemented with transmission gates anyway. – Anthony Blake Nov 24 '11 at 13:12
0

A input 1, B input 2, S input select line, C output,

C = (A & S) | (A & ~S);

Its simple bro!

Prakash Darji
  • 990
  • 6
  • 13