Please Help me Somebody with DEMUX Gate

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

Please Help me Somebody with DEMUX Gate

michael1978
Hello,

my name is michael,

i am building the hack computer

but i have one big problem


i done in LOGISIM, is very simple, but now i have to buy a demux gate, but i have no idea
how to build, like i did in logisim
here is my circuit



is my first time with DEMUX gate,

please can somebody help me, how to build DEMUX gate, please
i stay all day and night, i DONT KNOW, is now working my brain
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
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.
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
Hello,
thanks for answer

i know MUX,
 i use chip 74LS157

 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?
thnx.
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
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.

Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
Hi

i look on internet so i build in logisim
here 1:2 / 1:4


but i dont know how to build 16 bit, 4 way, can you show one example please

thanks  … for help.
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
I think the problem is that you are looking for ready-made solutions on the Internet instead of designing circuit to solve the problem yourself -- and that's what N2T is all about.

Do you understand either of those two circuits and HOW they work so as to achieve the desired functionality? Do you even know what each of the inputs is on the right-hand circuit?

If so, then seeing how to combine them to make a multi-bit gate is quite apparent. But if not, then it would be very difficult to see how to so.

Let's focus on how to DESIGN the circuit, now how to find it on some website someplace.

You want a 1:2 DeMux in which the input is echoed to exactly one of the outputs with all other outputs being LO. Which output receives the input is determined by the select input.

Let's say that our input is called 'in' and the select input is called 'sel'. Our outputs are 'a' and 'b'. Note that these match the authors' signal names, I prefer out0 and out1 myself.

If 'sel' = 0, the the input is echoed to output 'a', otherwise it is echoed to output 'b'.

Since you have two outputs, you have two truth tables. What are the truth tables for each output in terms of the 'in' signal and the 'sel' signal?
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
hi
sorry for late answer

  In   Sel    Out1    Out2
   0     0       0         0
   1     0       1         0
   0     1       0         0
   1     1       0         1      


i look for help,  if i know i will ask










Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
if i know, i will not ask for help
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
In reply to this post by michael1978
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?
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
In reply to this post by michael1978
michael1978 wrote
if i know, i will not ask for help
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.
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
Hey me friend


i find the solution....

i was playing with demux 1:2 in logisim,

and i was think in, how is possible i have to buy a lot of demux gate
think think my brain was not working

soooo

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


thank you man....
Greetings.
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
It sounds like you have it -- thought just to be sure, you have 17 inputs -- the sixteen data inputs and the one select input.

It may be a bit before I can respond further. I've been in the hospital for nearly a week and just got out of surgery, so I'm not of much use to anyone right now. Perhaps tomorrow.
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
hello mr wbhan i hope you are fine

sorry for my late answer...

i know thanks


mr wbahn i have very big problem

can you please help me please?


i dont know, how to connect physical keyboard and display

for example a keyboard have pin ground, pin vcc, pin data(how to connect ? i have no idea)
and screen i see vga red, green, blue, hsync, vhsync pins(how to connect ? i have no idea)


can you please tell with wich pins to connect(addres memory(is 16bit so 16 wires or write memory or i dont know?
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
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.
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
hi,

its vga and pc/2,
i search on internet tutorial but i cant find nothing
 
do exist any chip ic for vga and pc/2 keyboard
or what i need to build? i dont know man, where can i learn for protocols of vga pc/2 do you know any book or tutorial in internet


thanks
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
michael1978 wrote
hi,

its vga and pc/2,
i search on internet tutorial but i cant find nothing
 
do exist any chip ic for vga and pc/2 keyboard
or what i need to build? i dont know man, where can i learn for protocols of vga pc/2 do you know any book or tutorial in internet


thanks
There are lots of places where you can find out about the VGA signal characteristics.

https://en.wikipedia.org/wiki/Video_Graphics_Array#Technical_details

Is as good a place to start at any.

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).

Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
HI,,
Wbhan do you think maybe to make DAC after to generate hsync a vhsync signal for video?
Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
michael1978 wrote
HI,,
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:

https://javiervalcarce.eu/html/vga-signal-format-timming-specs-en.html





Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

michael1978
HI

THANK YOU
no no is for black and white

so it means i have to build DAC(simple like you say resistor devider) right?


Reply | Threaded
Open this post in threaded view
|

Re: Please Help me Somebody with DEMUX Gate

WBahn
Administrator
michael1978 wrote
HI

THANK YOU
no no is for black and white

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).

12