0
\$\begingroup\$

I am working on a circuit that has 8 buttons that need to hold the value once pressed. I'm currently using a 8 bit flip flop (74LS273 in the diagram).

The problem is that all bits get reset on the clocks (rising edge) when the buttons are not pressed. I think the circuit that I am using assumes that the bits are all passed at the same cycle.

How would I counteract this / what circuit would I need to store the particular bits (preferably without the use of a clock input). I need 8 bits input and 8 bits output, along with a way to reset all bits at once. I was looking at some latches but I can't seem to have many that just store the value as 8 bit output.

Any advice would be appreciated.

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ the circuit does not assume anything ... it latches the state of the 8 inputs ... think about what you are trying to do ... you want to latch a state when a button is pressed ... the clock input latches a state ... think about the similarity between the button and clock \$\endgroup\$ Commented Feb 6, 2022 at 3:38
  • \$\begingroup\$ By 'assume' I mean that the chip latches all inputs before the next clock cycle. I understand the the clock latches the state, but then proceeds to unlatch it next cycle, when the button(s) are off. This seems to be quite a simple little problem but I don't know enough on how to tackle this. I am new to this, so I would love to be corrected on my ignorance instead of cryptic answers \$\endgroup\$ Commented Feb 6, 2022 at 4:17
  • \$\begingroup\$ the buttons should generate the clock signal ... try a circuit that consists of eight flip-flops ... start with a single button \$\endgroup\$ Commented Feb 6, 2022 at 4:28
  • \$\begingroup\$ Or add some 'or' gates. D = PB | Q. A simple latch state machine. \$\endgroup\$ Commented Feb 6, 2022 at 5:50
  • 1
    \$\begingroup\$ 1) 12V will blow the guts out of a 74LS part. 2) Cheap hack would be to feed back each output to the input via a large (like 5K, or 100K for CMOS parts) resistor. That way it stores the previous output unless the switch overrides the resistor. (And the resistor protects the output from the switch) \$\endgroup\$ Commented Feb 6, 2022 at 13:15

1 Answer 1

3
\$\begingroup\$

I was looking at some latches but I can't seem to have many that just store the value as 8 bit output.

Your problem is that you don't want to 'just store the value', you want it to stay 'on' even after the input value (button) goes back to 'off'.

S/R latches are perfect for this job. All you have to do is connect each switch to the SET input of its latch, and the reset switch to the CLEAR input of all latches.

Logic ICs are produced to meet popular demand. Few circuits that work with 8 bit data need the functionality you are asking for, which is why you are having trouble finding an 8 bit IC to do it. However ICs that do fewer bits are available, such as the 74LS279 which has 4 SR latches. If that is a real problem for you then there are single chip solutions such as programmable logic (eg. ATF16V8) or a small MCU, but these are a lot more complicated to work with. So just accept that you will need two or more chips to create this circuit with TTL logic.

Your circuit also has a number of other problems:-

  • 5 V TTL logic can only withstand 5 V on inputs, not 12 V.

  • Normal LSTTL outputs can only source ~0.4 mA, but they can sink ~8 mA. Therefore it is better to arrange the LEDs to light up on logic 0 output, with a resistor in series to limit current to less than 8 mA.

  • You need 'pull down' or 'pull up' resistors on the switches to define the input voltage when they are off.

LSTTL inputs draw about 0.2 mA when pulled low and the input voltage needs to be 0.8 V or less, so the maximum acceptable 'pull down' resistance is ~4 kΩ. However they only draw ~40 μA when pulled up, so if you arrange the buttons to switch to Ground then a much higher value 'pull up' resistance can be used. Switching to Ground will also make the signals compatible with active low inputs.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for answering my question! You did a really good job explaining everything for me to understand, and good catch for the other problems as well. I will likely fix those problems and use 2 SR latches instead. Thank You again! \$\endgroup\$ Commented Feb 6, 2022 at 4:47

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.