# 4-Bit Divisor Implementation Using Logic Gates

Discussion in 'Electronic Design' started by Junaid Uppal, Oct 25, 2004.

1. ### Junaid UppalGuest

Hello Everyone,

I am currently working on a project to implement 4-bit division using
logic gates / registers etc ( Basic Level DLD Stuff ). I've been
searching online / offline for a lot of time now but haven't found
anything that can help me implement my circuit. Can anyone help me out
in making this circuit please? some pointers / logic diagrams or
anything.

Thanks & Regards

Junaid Uppal

Junaid Uppal, Oct 25, 2004

2. ### Andrew HolmeGuest

Junaid Uppal wrote:
> Hello Everyone,
>
> I am currently working on a project to implement 4-bit division using
> logic gates / registers etc ( Basic Level DLD Stuff ). I've been
> searching online / offline for a lot of time now but haven't found
> anything that can help me implement my circuit. Can anyone help me out
> in making this circuit please? some pointers / logic diagrams or
> anything.
>
> Thanks & Regards
>
> Junaid Uppal

Try something like

http://tima-cmp.imag.fr/~guyot/Cours/Oparithm/english/Divise.htm

Andrew Holme, Oct 25, 2004

3. ### petrus bitbyterGuest

"Junaid Uppal" <> schreef in bericht
news:...
> Hello Everyone,
>
> I am currently working on a project to implement 4-bit division using
> logic gates / registers etc ( Basic Level DLD Stuff ). I've been
> searching online / offline for a lot of time now but haven't found
> anything that can help me implement my circuit. Can anyone help me out
> in making this circuit please? some pointers / logic diagrams or
> anything.
>
> Thanks & Regards
>
> Junaid Uppal

Well,

Guess you're not supposed to find a divisor but to build one. Besides your
question is not very clear. A four bit divisor? To carry out a division you
need a dividend and a divisor to obtain a quotient. Are all of them four
bits? Then you make a truthtable with the dividend and the divisor on the
input side and the quotient on the output side. That table will have 2^8
entries. You can list the logic gate solution directly from that table but I
guess you're supposed to minimise the circuit by using Karnaugh maps, Quine
McClusky or some other tool.

In practice I'd write a little program (quick and dirty in Basic) to
calculate the required outputs and write them in an EPROM but I guess you're
not allowed to do it that way. A real modern approach is using programmable
logic.

As four bits divisors are not very practicle most of the times and this kind
of "table lookup" becomes quickly too large for even eight bit numbers, most
real divisors are made using shift registers and a subtractor. A good
textbook should treat this stuff. I have a (Dutch) one that has some
examples. May be you should not stick on the internet only but have a look
in a (technical) library as well.

petrus bitbyter

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.778 / Virus Database: 525 - Release Date: 15-10-2004

petrus bitbyter, Oct 25, 2004
4. ### Jonathan KirwanGuest

On 25 Oct 2004 12:02:06 -0700, (Junaid Uppal) wrote:

>I am currently working on a project to implement 4-bit division using
>logic gates / registers etc ( Basic Level DLD Stuff ). I've been
>searching online / offline for a lot of time now but haven't found
>anything that can help me implement my circuit. Can anyone help me out
>in making this circuit please? some pointers / logic diagrams or
>anything.

Should be plenty on the web for this, I'd imagine. Combinatorial methods would
use a set of compare and mux stages, one pair of these for each output result
bit, plus a little more stuff. Sequential methods would use a single
subtractor, shifter, and a little glue. But the methods are basic stuff. Have
you looked?

Jon

Jonathan Kirwan, Oct 26, 2004
5. ### Junaid UppalGuest

I actually need to implement *any* division algorithm for an input of
4bit binary numbers and yes i can use shift registers , counters and
all of them but not eproms and stuff. So do you have any pointer to
that , i am sorry,i've been trying a lot to look around , figure out
and implement a circuitory but wasnt successful at all even after
looking at books!

Regards

-uppal

"petrus bitbyter" <> wrote in message news:<K2efd.84650\$>...
> "Junaid Uppal" <> schreef in bericht
> news:...
> > Hello Everyone,
> >
> > I am currently working on a project to implement 4-bit division using
> > logic gates / registers etc ( Basic Level DLD Stuff ). I've been
> > searching online / offline for a lot of time now but haven't found
> > anything that can help me implement my circuit. Can anyone help me out
> > in making this circuit please? some pointers / logic diagrams or
> > anything.
> >
> > Thanks & Regards
> >
> > Junaid Uppal

>
> Well,
>
> Guess you're not supposed to find a divisor but to build one. Besides your
> question is not very clear. A four bit divisor? To carry out a division you
> need a dividend and a divisor to obtain a quotient. Are all of them four
> bits? Then you make a truthtable with the dividend and the divisor on the
> input side and the quotient on the output side. That table will have 2^8
> entries. You can list the logic gate solution directly from that table but I
> guess you're supposed to minimise the circuit by using Karnaugh maps, Quine
> McClusky or some other tool.
>
> In practice I'd write a little program (quick and dirty in Basic) to
> calculate the required outputs and write them in an EPROM but I guess you're
> not allowed to do it that way. A real modern approach is using programmable
> logic.
>
> As four bits divisors are not very practicle most of the times and this kind
> of "table lookup" becomes quickly too large for even eight bit numbers, most
> real divisors are made using shift registers and a subtractor. A good
> textbook should treat this stuff. I have a (Dutch) one that has some
> examples. May be you should not stick on the internet only but have a look
> in a (technical) library as well.
>
> petrus bitbyter
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.778 / Virus Database: 525 - Release Date: 15-10-2004

Junaid Uppal, Oct 26, 2004
6. ### Rich GriseGuest

On Mon, 25 Oct 2004 19:49:21 -0700, Junaid Uppal wrote:

> I actually need to implement *any* division algorithm for an input of
> 4bit binary numbers and yes i can use shift registers , counters and
> all of them but not eproms and stuff. So do you have any pointer to
> that , i am sorry,i've been trying a lot to look around , figure out
> and implement a circuitory but wasnt successful at all even after
> looking at books!
>

Well, you can achieve the same effect as an eprom look-up table with
some logic chips.

Are you allowed to use diode logic? Tell 'em you're going _really_
retro - then cheat.

Unfold a ROM.

Figuring out how do do this will add much more to your reasoning
power than having it shown to you.

There are two, four-bit inputs - how many possible sets of input
states are there? Could you translate each of these product terms
to a quotient and remainder with a few gating diodes?

You _do_ know how to build a diode AND gate, don't you? ;-)

Have Fun!
Rich

Rich Grise, Oct 26, 2004
7. ### Jonathan KirwanGuest

On 25 Oct 2004 19:49:21 -0700, (Junaid Uppal) wrote:

>So do you have any pointer to
>that , i am sorry,i've been trying a lot to look around , figure out
>and implement a circuitory but wasnt successful at all even after
>looking at books!

Look in "HDL Chip Design," as it includes both combinatorial and sequential
methods. (and their schematics)

Jon

Jonathan Kirwan, Oct 26, 2004
8. ### Andrew HolmeGuest

"Andrew Holme" <> wrote
> http://tima-cmp.imag.fr/~guyot/Cours/Oparithm/english/Divise.htm

These circuits generate the answer in 1 clock cycle.

Alternatively, you could do a sequential divider using registers,
counters, shift registers e.t.c. This is standard long division, as
you do it with pencil and paper, but in binary e.g.

00011
-------
0100 ) 01100
0100
----
00100
0100
----
0

You need shift registers, a binary subtractor (or comparator), and
counters.

Andrew Holme, Oct 26, 2004
9. ### MarlboroGuest

(Junaid Uppal) wrote in message news:<>...
> Hello Everyone,
>
> I am currently working on a project to implement 4-bit division using
> logic gates / registers etc ( Basic Level DLD Stuff ). I've been
> searching online / offline for a lot of time now but haven't found
> anything that can help me implement my circuit. Can anyone help me out
> in making this circuit please? some pointers / logic diagrams or
> anything.
>
> Thanks & Regards
>
> Junaid Uppal

Sound like school homework,

Marlboro, Oct 26, 2004
10. ### Jonathan KirwanGuest

On 26 Oct 2004 09:46:39 -0700, (Marlboro) wrote:

>Sound like school homework,

I think everyone posting in response realizes this, too, and has been a little
circumspect about providing a solution, while including some words for a search
or books for more study.

Jon

Jonathan Kirwan, Oct 26, 2004