I think you're making your decode logic much more complicated than it needs to be. But there are several approaches and any approach that works is valid. You might consider just looking at what each control signal needs to be for each type of instruction -- you will find that many of them don't care what type of instruction it is (or, more specifically, they care about one instruction type but not the other type).
As for the DeMux gate, look at it for what it is -- the reverse of a Mux gate. So you have a single input and depending on the select input you either echo the input to that output or you make the output all zero.
i read a lot on internet for DEMUX, like i understand is D input(wich must be ON) and S line
and Output, the result depends on Input of S lines
but can you please tell me, what to USE how to build the circuits(because i have no information and also
i am a beginner i watch the videos of Ben Eater, after i learn Nand2Tetris)
i make more than HALF of HACKCOMPUTER,
but now i make crazy, i dont know how to go further…..because i dont know how to make this circuit
but i dont know i thougt to use 8 of chips MUX, to build i dont know how to solve? what do you think? how to solve this problem?
Saying that you used a particular Mux part from the Multisim library of parts is not the same as knowing how to implement a multiplexer.
Have you implemented the Hack hardware in the Nand2Tetris HDL and gotten it to work? If so, then just implement the DeMux in Multisim using the same design strategy. Build your parts up the same way, starting with just two-input Nand gates.
If you haven't, then it might be a good idea to take a step back and do so.
If you aren't willing to do that, then start with a 1-bit, 2-way demultiplexer. You have two inputs (data and select) and two outputs (channel1 and channel2). What is the truth table for channel1? What circuit will implement that truth table? Now do the same for channel2. You're done.
Now see how you might implement a 1-bit, 4-way demux. There are a couple of fairly obvious routes you might choose. Try seeing if you can do one that is based on using your 1-bit, 2-way multplexers.
Now combined sixteen of those to make a 16-bit 4-way demultiplexer.
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.
Patience. Sometimes it takes quite a bit of detective work to find out what it is that you really don't know and need help on.
Believe it or not, we just made a breakthrough. Your problem has nothing to do with DMux gates, it has to do with very basic Boolean logic. All the discussions about DMux gates was hiding that. Now that we've identified that you need to improve your basic skills, we can work on that and then you will be able to move on in the project on your own.
Had I simply given you the solution for the specific gate you couldn't design today it would not have help you much at all, you would simply have gotten stuck when working with the next gate and been looking for someone to spoon feed you that solution because you would still have lacked the basic skills. Now we can get those basic skills where they need to be.
and i was think in, how is possible i have to buy a lot of demux gate
think think my brain was not working
i take gate demux 1:2, and i make sixtieen bit
so 16 inputs and 32 outputs
i just connect all Selector together,
after i get 2 output the same…. that is all, do you see my circuits
so the last bit change the Selector
so that is, is working i play in logisim
i think this the solution, of you know better?
so now i need 32 wires for output, and 16 wires for inputs
Connecting a physical keyboard and display is not nearly as simple as just connecting the pins to points in your existing circuit.
You need to look up and understand the protocols for interfacing to each. It depends very much on the type of interface, too. Is it a USB keyboard? A PS/2 keyboard? It is a VGA monitor? An HDMI connector?
Once you understand the protocol, you need to design a circuit that implements that protocol and that has two sides to it -- the side that the device is on and the side that your CPU memory is on.
It's not a trivial undertaking -- but it can be a very rewarding journey.
You can Google for things like "VGA video signal generation" or "interfacing to PS/2 keyboard" and just start seeing what is out there. You will probably find that you need to get bits and pieces from various sites in order to find out everything you happen to need.
But those will only address the device side of the interface. You also need to address the CPU side of the interface and that's going to be largely up to you (unless you happen to to find a site by someone that has already done this, which there are probably several out there).
Wbhan do you think maybe to make DAC after to generate hsync a vhsync signal for video?
I'm not exactly sure what you mean here.
Are you trying to get color, or just monochrome to match the basic Hack hardware?
Generally a simple resistive voltage divider is sufficient to get an acceptable signal level and if you only want two bits of color depth per color a two-resistor network works fine. Three-bits is also pretty easy to achieve. More than that and you probably want to start considering a DAC.
I ran across this which has some useful info on timing and signal levels:
so it means i have to build DAC(simple like you say resistor devider) right?
It's been about 20 years since I played with direct VGA generation, but IIRC the sync signals are intended for 5 V TTL logic but should work with 3.3 V logic as long as you get above 2.7 V.
The RGB signals are from 0 V to 0.7 V, so for monochrome just use a diode and a suitable resistor to get those levels.
I seem to recall that to work with some monitors you had to embed the sync signals in the green channel. But I suspect that you probably don't for most monitors with the D-shell VGA connector (could be wrong).