I am building a 1-bit register using a DFF:
simulate this circuit – Schematic created using CircuitLab
The problem I have is that I think it should be saving whether D is high or low when the clock pulses and outputting that to Q. How do I go about doing that?
Best Answer
I'm understanding your question to be asking: why can I only store a high bit, no matter where I switch SW2 to?
If I've got that right...
SW2 correctly puts 5 V onto D when switched on. But it leaves D floating (undriven) when SW2 is switched off. The input stage of some 5 V logic families will cause them to see a high on floating inputs.
Try connecting a pull-down resistor between the D pin and GND. A 10 K resistor is a good start but for LS you might need (say) 2K2.