DFF and BIT

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

DFF and BIT

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

Re: DFF and BIT

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

Re: DFF and BIT

Jane Wu
Hi,Mark
i know that the value of Bit in time t+1 is computed by the current value of DFF in time t.But when I fetch the value of the DFF , I use this command

DFF(in = false,out = cur),

we must put some data into the pin In,and base on cur to get the next value,which value should i pipe in the DFF?

I set the pin In with false, and after the computation i have get the next value called step1 .then I need to pipe the step1 into the pin In using this

DFF(in = step1,out = out)

it does not work, i know that in every Bit there only needs one DFF, but i don't know how to use one DFF to express loop.

Jane
Reply | Threaded
Open this post in threaded view
|

Re: DFF and BIT

cadet1620
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