# DFF and BIT

4 messages
Open this post in threaded view
|

## DFF and BIT

 I hope you can help me understand the logic behind the bit chip. So i understand that i need a Mux and then combine it with a DFF. This is what i came up with my own. Mux(a=in, b=dffout, sel=load,out=muxout); DFF(in=muxout, out=dffout); It fails at line 9. However this does not work. I check online for answer. One solution is use two NOTs after the DFF? It just seems like they are just cancelling each other. Another solution is: that the DFF has two outs     DFF(in=x, out=out, out=y); I'm not sure they DFF has two out. This is correct? I also noticed that the Mux a and b is reverse to what i have i both cases. Is theres something special in this case.
Open this post in threaded view
|

## Re: DFF and BIT

 The first thing to recognize is that the diagram in the book does not label which Mux input is a and b. You have to determine what should be wired to a and b according to the chip specification. The one important connection missing from your implementation is that the output of Bit is not connected to any outputs of the internal chips.
 Administrator Don't think of HDL as steps in a procedure. DFF commands don't fetch values nor do you pipe values from one command into another.  HDL is a description of a circuit diagram.The circuit for the Bit, as shown in figure 3.1, consists of a Mux and a DFF. There is one wire in that diagram that does not have a name. Let's call it 'muxOut'. Then the HDL can be written directly from the diagram, except for which Mux input is 'a' and 'b'. ```Mux (sel=load, ?=in, ?=out, out=muxOut); // error: Can't connect gate's output pin to part DFF (in=muxOut, out=out); ```There is a problem with this HDL, though. The HardwareSimulator does not allow wires named in the OUT line to be connected to anything so we need to connect another wire to the DFF's 'out' so that we can connect it elsewhere in the part. (This is like soldering two wires to a physical part.) ```Mux (sel=load, ?=in, ?=dffOut, out=muxOut); DFF (in=muxOut, out=out, out=dffOut); ```I leave you to determine the a/b connections for the Mux. --Mark