0
\$\begingroup\$

Circuit so farI'm trying to implement a total sum that looks like this.

TOTAL = TOTAL + INPUT

I'm using binary adders to add and D flip flops to store TOTAL. However, whenever the TOTAL updates, it again updates because the equation is recursive. How can i make it so that whenever i get an INPUT, it only updates TOTAL once. TOTAL and INPUT are both 6 bits and INPUT returns to 0 after any value is passed to it.

Edit: REF are just outputs. The D flip flops are level triggered and are set to 0 at the start.

\$\endgroup\$
5
  • \$\begingroup\$ Implement a clocking system. \$\endgroup\$
    – Andy aka
    Commented Apr 23, 2020 at 9:40
  • \$\begingroup\$ Could you elaborate a little more? \$\endgroup\$
    – terrabyte
    Commented Apr 23, 2020 at 9:54
  • \$\begingroup\$ Could you elaborate with a logic diagram? \$\endgroup\$
    – Andy aka
    Commented Apr 23, 2020 at 9:55
  • \$\begingroup\$ Added a diagram \$\endgroup\$
    – terrabyte
    Commented Apr 23, 2020 at 10:09
  • \$\begingroup\$ Where is the clock input on your D type flip flops. \$\endgroup\$
    – Andy aka
    Commented Apr 23, 2020 at 10:23

1 Answer 1

0
\$\begingroup\$

You'll notice that your math teacher would have looked very sternly at your "equation"

TOTAL = TOTAL + INPUT

because if \$a=a+b\$, then \$b=0\$, or something's wrong.

What you mean is "the value of TOTAL in the next time step is the value of TOTAL now, plus the value of INPUT now".

What that implies is a temporal variation of your circuit's state: you can't build this out of combinatorial logic alone. Something has to store the "old" total while you compute the new.

In fact, this even kind of implies you need a clocked system, with registers (usually implemented through flipflops) holding values.

That is really all I think I can tell you without solving your "homework" (or whatever that is) for you – this gets easier if you imagine you have an external signal "clock" that goes high whenever there's a new INPUT.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.