Re: Please Help me Somebody with DEMUX Gate
Posted by
WBahn on
May 22, 2019; 5:18pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Please-Help-me-Somebody-with-DEMUX-Gate-tp4033175p4033199.html
michael1978 wrote
In Sel Out1 Out2
0 0 0 0
1 0 1 0
0 1 0 0
1 1 0 1
That's correct.
Now, take the outputs one at a time. Let's do the easy one, Out2, first.
In Sel Out2
0 0 0
1 0 0
0 1 0
1 1 1
Do you recognize this as one of the basic Boolean functions?
As for the second one, there is a simple way to build up the logic for any truth table. You take each row in which you want the output to be a 1 and you combine each of the input signals via an AND gate but first complementing any that happen to be 0. You then OR together the logic for each of the rows (which, in this case, is unnecessary since we only have one row that is a 1).
In Sel Out2
0 0 0
1 0 1
0 1 0
1 1 0
So here you want the output to be a 1 when In is 1 AND when Sel is 0.
Another way of saying this is that you want the output to be 1 when In is 1 AND NOT(Sel) is 1.
Out2 = In AND (NOT Sel)
Do you see how I got this?
Can you turn that into some HDL code?