0
\$\begingroup\$

I am working on a simple counter that takes start, stop and increment values as decimal inputs. Here's the circuitry of the start value input of my counter: enter image description here What the whole counter does is count from whatever start value you input by whatever increment you set and should stop if the count value is over the stop value. What I'm having trouble with is getting the inputs to get read as 8-bit values by the adder. My inputs are represented by switches, each switch represents the decimal numbers 1-9. The switches are organized in 2 columns, the first column represents the MSB and the second column represents the LSB.
Switches1-9
On the above picture, the display is currently showing 11, switch one in column 1 is switched 'on' and switch one in column 2 is switched 'on' as well. The issue I have is, when I input the data into an 8-bit adder, the outputs it as 2. The adder reads them as two separate 4bit binary numbers. I know that using a 16-bit adder would work, but is there any other way to get the 8-bit adder to read the input values as 8-bit values or do I need a 16-bit adder?

\$\endgroup\$
  • \$\begingroup\$ I had a hard time reading exactly what was going on. So let me take a shot at it. You have a total of 36 switches used to represent two numbers: a start value wasting 18 switches to make two BCD-coded values from 00 to 99 and an increment value using another 18 switches for two BCD-coded values also from 00 to 99. (This already sounds switch-crazy as those things are expensive.) So you need a way to cause two BCD-coded digits to be fused into a single binary 7-bit value before presenting the current value and the increment to an adder. Is that about it? \$\endgroup\$ – jonk May 25 '19 at 5:34
  • \$\begingroup\$ eeeguide.com/decimal-adder-bcd-adder \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 May 25 '19 at 5:59
1
\$\begingroup\$

You need a 2 digit BCD (Binary Coded Decimal) to binary converter. Here's a way to do it using 4 bit adders:-

enter image description here

Alternatively you might consider leaving the inputs in BCD, and processing them directly using a BCD adder and BCD counter.

If you intend to actually build this circuit then you could also eliminate the BCD encoder logic and reduce the number of physical switches by using BCD rotary switches.

\$\endgroup\$
  • \$\begingroup\$ I see. So when I enter the number 11, its 00010001 in the 8 bit BCD and then when it goes through the BCD to binary converter it becomes 0001011 right? \$\endgroup\$ – AugieJavax98 May 25 '19 at 6:49
  • 1
    \$\begingroup\$ Yes. That is correct. \$\endgroup\$ – Bruce Abbott May 25 '19 at 9:01
  • \$\begingroup\$ I need the outputs to be 8-bit binary though. \$\endgroup\$ – AugieJavax98 May 26 '19 at 17:49
  • 1
    \$\begingroup\$ With 2 decimal digits the highest possible number is 99, which is less than 128 so bit 7 is always low. \$\endgroup\$ – Bruce Abbott May 26 '19 at 23:40
  • \$\begingroup\$ If I connect this to 7seg display, it should work right? \$\endgroup\$ – AugieJavax98 May 27 '19 at 6:05

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.