Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Dividing a BCD signal using logic ICs only (no microprocessors)

Status
Not open for further replies.

tummychow

New Member
If I have a multi-digit (let's say 3 digits) number coded in BCD or in pure binary (whichever is more convenient), what is the easiest way to divide that number by an integer (for example, dividing 12 by 3) using only logic ICs? I've seen the 4018/4059/4522 ICs, but their datasheets mystify me, and I'm not sure how to just "cut to the chase". The pinouts confuse the heck out of me, so if someone could explain those for me that would already be fantastic. I do want to try to solve this problem by myself but the chips are just too complicated (and I find TI makes nearly illegible datasheets).

Also, I know a microprocessor could do this job really easily. Obstinate of me as it is, I am not interested in a microprocessor solution of any kind. Strictly logic ICs only. I think the 4018/4059/4522 are obsolete, but I've found suppliers, and a solution using other ICs would also be good.
 
Post deleted.
 
Last edited:
Thanks for the quick reply!

That explains a lot; I was wondering what it meant by frequency divider. What pins would I use to set up the divider IC? I've seen truth tables in the datasheets; they make a bit more sense now but I think I'm still a bit confused. For example, TI CD4059 datasheet has a complicated truth table describing the divison mode that the IC will go into when its control inputs Ka, Kb and Kc are set to various configurations. It then goes into the process of setting division to any N, by changing the "preset" that is jammed into the counters...

Actually I think after reading the publications a bit more, I think I understand better. Let me try and write the process out, and tell me if this seems reasonable:
The CD4059 has 24 pins. 3 of these pins are Ka, Kb and Kc. Based on the truth table in the datasheet, these pins set the basic count modulus to a selection of basic values D: by 1, 2, 4, 5, 8 or 10. Then, to divide by any N, you first find what N/D is. You encode the whole number part of N/D into a set of preset pins, and then encode the remainder of N/D onto another set of preset pins. Then, you feed a clock signal into the 4059's clock pin, and on the out pin, a signal will come out such that for every N pulses of the input clock, one pulse will come out.

Is this correct? Also, pin 2 of the 4059 is labeled L. What exactly does this pin do? Either way, thanks for giving me that initial *push* towards understanding.

EDIT: i see now, pin 2 is the latch
 
Last edited:
I think this should work (but haven't tried it).
Use pre-settable down-counters A,B. Connect the 'carry/borrow' output of B to the preset-enable input of B and to the clock input of an up-counter C. Reset C. Put the dividend in A and the divisor in B. Clock A and B simultaneously until the A count reaches zero. C will then contain the quotient.
 
Okay, now I have another, related question. How can I multiply a BCD-coded number by any arbitrary natural number? I've been thinking about stretching the clock pulses out and using them to turn on an astable multivibrator, but that seems rather awkward. I am going to be looking at methods based on logic gates, but I suspect that for a BCD number of arbitrary size, that's rapidly going to get out of hand. Again, no microprocessor-based suggestions. Thanks.

EDIT: hmm, perhaps I could reverse the logic of that division circuit? preset A and B to the multiplicands, and then clock A down and C up simultaneously. connect the carry out of A to its own preset enable, and to the clock of B. when B clocks down to zero, C=A*B?
sounds like it should work. thanks for solving both of my problems!
 
Last edited:
perhaps I could reverse the logic of that division circuit? preset A and B to the multiplicands, and then clock A down and C up simultaneously. connect the carry out of A to its own preset enable, and to the clock of B. when B clocks down to zero, C=A*B?
sounds like it should work.
I agree; seems logical. BTW I ran a simulation for the division strategy and it works. Asc file attached if you want to play.
 

Attachments

  • Divider.asc
    4.2 KB · Views: 1,679
Hi,

Hey i got an idea, why not just use a microprocessor? he he, just kidding :)
 
EDIT: hmm, perhaps I could reverse the logic of that division circuit? preset A and B to the multiplicands, and then clock A down and C up simultaneously. connect the carry out of A to its own preset enable, and to the clock of B. when B clocks down to zero, C=A*B?
sounds like it should work. thanks for solving both of my problems!

it will work, you have to hold the system when both counters become to zero simultaneously, the total clock pulses passed through during this period is the result A*B. so a third counter with display or anything will count the primary clocks till it gets a hold signal and the result can be displayed. i did such a multiplication table for 12x12 numbers only using counters & fundamental logic gates. see the attached snap.
 

Attachments

  • project-4.JPG
    project-4.JPG
    275.2 KB · Views: 191
  • project-3.JPG
    project-3.JPG
    332.7 KB · Views: 207
it will work, you have to hold the system when both counters become to zero simultaneously, the total clock pulses passed through during this period is the result A*B. so a third counter with display or anything will count the primary clocks till it gets a hold signal and the result can be displayed. i did such a multiplication table for 12x12 numbers only using counters & fundamental logic gates. see the attached snap.

Hi,

Very nice. No schematic?
 
Hi again,

Oh ok good, or else scan it or take a good high res picture maybe.

It's interesting to see stuff like this for me too, because i used to build and work with equipment that was made with lots and lots of discrete IC chips like TTL, etc. I worked for a company once where we made a CPU out of discrete chips simply because they didnt make CPU's yet.

Also for my own use, i built a frequency counter long time ago with regular 7400 series TTL chips. I wanted 8 digits so i ended up using 8 counters, 8 latches, 8 gates for multiplex LEDs, 8 7 seg LED's, plus some other glue logic. What a mess, but it worked great. Took over 1 amp to power it at 5v though, but back in the 1990's i upgraded it a little using the more modern 74LS00 series which takes much less current. All i had to do was swap out the chips. Reduced total current draw to less than 750ma so it was easier to power with a wall wart.

I guess i can still appreciate stuff like that because i was involved with it for a long time. Still, i love to use micro controllers now because you can do so much with just one little tiny chip. It's so hard to reproduce that functionality with TTL and related.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top