Simple Question Regarding Sequential Logic

Discussion in 'Homework Help' started by liftingshadows, Mar 6, 2010.

  1. liftingshadows

    Thread Starter New Member

    Mar 6, 2010
    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:
    Code ( (Unknown Language)):
    2. CHIP Bit {
    4.     IN  in, load; //input pins
    5.     OUT out;    //output pin
    7.     PARTS:
    8.     Mux(a=in, b=out, sel=load, out=Din);
    9.     DFF(in=Din, out=out);    
    10. }
    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.

    Last edited: Mar 6, 2010