Hey guys, I have this very basic problem that I can't seem to figure out. I'm taking this course where we're learning from the book "The Elements of Computing Systems", and in it they use a language called HDL in order to simulate hardware.
Anyways, I'm trying to build a 1-bit binary cell using it (this is for a lab we did last week, and I didn't know how to do this then, so I figured I'd get it clarified now), and I don't understand how you can actually code it so that the input of the multiplexor is the input, AND the output of the circuit.
Basically, what I have coded is simple too:
However when I try to run that, the simulator tells me that I can't load the Mux chip using the out pin as input, since it hasn't actually "made" that yet. In a real circuit, I realize that if you're just turning this on for the first time, out would be 0 (or low), and therefore wouldn't matter, but I can't just say that while coding.
Thanks.
Anyways, I'm trying to build a 1-bit binary cell using it (this is for a lab we did last week, and I didn't know how to do this then, so I figured I'd get it clarified now), and I don't understand how you can actually code it so that the input of the multiplexor is the input, AND the output of the circuit.
Basically, what I have coded is simple too:
Rich (BB code):
CHIP Bit {
IN in, load; //input pins
OUT out; //output pin
PARTS:
Mux(a=in, b=out, sel=load, out=Din);
DFF(in=Din, out=out);
}
Thanks.
Last edited: