Digital Logic Division Algorithm

Thread Starter

bat1602

Joined Apr 3, 2011
3
So I'm supposed to design in a digital logic program a division algorithm that looks like this:


I have no idea where to start. I know that I'm dividing with 2 8 bit numbers (so I'm using 16 data latch flip flops for the the divisor and remainder//8 for the quotient). I don't know where to start. Like how many ALUs, how to switch commands of the ALU, and most importantly, how to initially set the numbers. I'm using switches to initially save it into the flip flops. The problem is that the flip flops obviously only take 1 input. So I'm assuming the use of logic gates might be needed so I can take in multiple inputs, but I don't know which gates to use.

I'd really appreciate anybody who could point me into the right direction.
 

Thread Starter

bat1602

Joined Apr 3, 2011
3
Yes this makes sense. But I was told to use that specific algorithm I posted (sorry I can't draw for my life and couldn't find a picture of the algorithm in hardware online).
 

Georacer

Joined Nov 25, 2009
5,182
It really depends on the program you will use. As a general rule, you can find registers in any software, but for the ALU, since you will always be subtracting, you can use a 2's complement module and an array of Full Adders.

But I think I will need an example of the algorithm, because I think I haven't fully understood it.
 

Thread Starter

bat1602

Joined Apr 3, 2011
3
So here is an example of a problem using the algorithm
So you have the initial values: with divisor being shifted to the left side of the register. The dividend is put into the remainder register. For each iteration there are 3 steps:
1. Remainder= Remainder-Divisor
2. If Remainder<0, then Add the divisor to the remainder(to get the old remainder), shift the quotient left, and the smallest digit of the quotient=0

IF Remainder>=0, then shift the quotient left, and the smallest digit of the binary number =1

3.Shift Divisor Right.

I don't know if that makes it any clearer.
I'd really appreciate any help

EDIT: I'm using mmlogic if that helps
 

Georacer

Joined Nov 25, 2009
5,182
I 'm not familiar with mmlogic and I 'm afraid I still can't follow your logic. The dividend is nowhere to be found too.

Can you give a simple example? For instance 8/3=2 and 1(thirds) or in binary 100/011=010 and 010(thirds).
 
Top