Mux - alternative implementations to canonical

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Mux - alternative implementations to canonical

rgravina
I was able to successfully implement the Mux by translating the canonical representation of the truth table to HDL. Great!

Before doing this I noticed something interesting, but struggled to make it into a working Mux...

If sel == 0, then out should == a OR sel
If sel == 1, then out should == b AND sel

I figured if I could "choose" which of these two paths to use based on the value of sel, then it would work. But I couldn't figure out how to do this.

Was I on to something, or just noticed something interesting but not relevant?
 
Reply | Threaded
Open this post in threaded view
|

Re: Mux - alternative implementations to canonical

cadet1620
Administrator
rgravina wrote
... I noticed something interesting, but struggled to make it into a working Mux...

If sel == 0, then out should == a OR sel
If sel == 1, then out should == b AND sel

I figured if I could "choose" which of these two paths to use based on the value of sel, then it would work. But I couldn't figure out how to do this.
Seeing patterns like this is very powerful, and can be quite useful when thinking about more complex circuits. You will want to use the "choose between these options" idea in later circuits.

There is an easy way to make this choice, but it can't be used to build the Mux, because it is the Mux.

Consider this: you can make Xor by using 'a' to choose between 'b' and Not(b).

--Mark