Help with project please (Divider)

Status
Not open for further replies.

BobZee

New Member
I have to make a divider for my first class in Electronics,
basically is a 7 bit number / 2 bit number, the result should
go into two hex or two 7 segment display.

Example:
1111/10 = 111 and the display shows 07

Can be done not using PIC? Only decoders, counters,
multiplexers, flip flops, etc. Thanks.
 
Being that your divisor is two bits, it can only have four states. 00, 01, 10, 11. So we could have four different modules of the circuit, and use a multiplexor to pass the output from the correct module to your display.

00 is the easiest case, you return some kind of error code, as you can't divide by zero. Maybe turn on a single LED that has "error" written on a piece of tape beside it in your breadboard.

01 is the next easiest. Anything divided by 1 is itself. So you just take whatever was input, and pass it straight to the output.

10 is the first one that requires modifying the input. Pretty much all you need to do with that one is use a shift register to bit shift right one place.

11 gets fun. ^_~ Have you done truth tables and Karnough maps? Perhaps even the dreaded Quine McKlusky may be needed for table correction. 7 bit input will give a 128 row table. Ok that's not a good idea. Hmmm I can't think of a really good simple idea for this one immediately.
 
Displaying E for error isn't such a great idea, since you wish to display the result for all the other divisions in hex on the 7 segment displays.

Say you have a bit pattern 101010, and divide that by 11. The answer is 1110, which in hex is E.
 
How about this long and sloppy method for dividing.

Create a high frequency pulse, using something like a 555 timer, and feed that into two separate groups of counters. Since you're only going to have to count up to a maximum of 128, if your pulse is going at 128 Hz, it would only take a second to work. Anything higher would make it even faster.

Anyway, on one group of counters, it increments on every pulse. On the other group of counters, it increments every three pulses. That gives you the divide by three. Use logic gates to determine when the first group of counters has reached the input bit pattern. The output of the second group of counters is now equal to that quantity divided by three. At this point, stop the pulse and output the answer.
 
You can digital division just like you would do long division by hand. I'll walk you through the divide by 11 case.

1101/11:
expand by one bit to 01101
First most significant 2 bits (|01|101): 01/11 = 0 --Answer MSB
bitshift right one and repeat (0|11|01): 11/11 = 1
bitshift and repeat (01|10|1): 10/11 = 0
bitshift and repeat (011|01|): 01/11 = 0 --Answer LSB

Your answer is 0100.

for a small syncronous circuit all you need to do is make a bitshifter, a counter, and a 2 bit divide circuit. The only complicated one is the 2 bit divide circuit and it is small enough to just make a truth table and do some boolean algebra to get a circuit.

If you want a combinatorial circuit you just do all the steps at one time with a bunch of div2 circuits. Just connect the right input bits and output bit to each div2 circuit.
 
Thanks a lot guys for your replys, I really mean it.

The problem is, I have tried everything to put together the circuit in circuitmaker but is not working, I can't make it. :cry:
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…