Im attempting to make a 8 bit binary calculator that displays on multiple seven segment displays. Can double dabble be done with logic gates. If so, how?

  • \$\begingroup\$ You should write more. It's hard for me to know what you really would look back on as a good answer for you from so little writing about what's going on in your mind. \$\endgroup\$ – jonk Nov 13 '18 at 17:57
  • \$\begingroup\$ There's really no reason to use binary arithmetic in a calculator at all. Calculators from time immemorial have used BCD arithmetic throughout. Since electronics is so much faster than humans are, doing everything 4 bits at a time is not a problem. \$\endgroup\$ – Dave Tweed Nov 13 '18 at 18:04
  • \$\begingroup\$ I would say you have a two-part question. The double-dabble logic, and then getting the result displayed. I'd go with a microcontroller, send the results to a MAX7219 to drive the display. Then you could also use the display to enter the interim parts of your data entry, + and - signs and what not. The microcontroller will also let you play with added functionality way easier than logic gates that can only do 1 function. But, to each his own ... \$\endgroup\$ – CrossRoads Nov 13 '18 at 18:07

Any computable function can be implemented with enough logic gates if their implementation permits looping outputs back to inputs to construct flip flops, as most real ones do.

However, the key thing to realize is that because your algorithm of interest is iterative it is stateful rather than combinatorial - it requires memory elements such as registers feeding and fed by the combinational logic gates.

This would generally make implementing it with only logic gates (some in loop connection to create flip-flops) inadvisable; you probably want a mixture of logic gates and compatible-logic-family register ICs.

And more realistically there is no reason other than hobby enjoyment to build this with discrete parts at all. You could for educational purposes build it in a programmable logic device (FPGA, or simply a simulator).

But because it is driving a display, ie, something that operates at only human speed, the usual "needs to be blindingly fast and/or parallel" justification for using dedicated logic rather than a small microcontroller isn't really there. So pretty much any modern, "real problem" implementation would do this in software.

  • \$\begingroup\$ (On second thought, it is perhaps possible that you could unroll the iterations into one absurdly long and expensive combinatorial path; it would take more time looking at the algorithm to know for sure. But this would not be sensible, especially if wiring up distinct 74xx series ICs, as you'd need to another copy of the logic to implement each of what is usually an iteration of the same operation) \$\endgroup\$ – Chris Stratton Nov 13 '18 at 17:54
  • 1
    \$\begingroup\$ Great answer for an overly short and vague question that was difficult to get a bead on. \$\endgroup\$ – jonk Nov 13 '18 at 17:55
  • \$\begingroup\$ @jonk I personally think their is enough for the answer i wanted. ( I did leave alot to the imagination :) ) ((sorry)) \$\endgroup\$ – Karl Streitz Nov 14 '18 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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