I'm currently building a 16 bit ALU using Logisim (ie logic gates only), and am stuck on a division process. I am currently just using the simple standard "division algorithm loop" (as shown below):
- Read input values;
- Compare input values. Wait until comparison process has finished;
- If A<B go to step 10. If A≥B, go to next step;
- Subtract B from A;
- Wait until subtraction process has finished;
- Add one to count;
- Wait until counting process has finished;
- Write value from subtraction process to input;
- Go to step 1;
- Answer is count remainder A
This, however, takes a very long time for processes with large answers (repeating a 300 tick cycle 65,000 times isn't fun). I'm just wondering if there are similar algorithms which are quicker (that exclusively use addition and/or subtraction and/or multiplication and any boolean logic) that could be implemented using logic gates. Any help or ideas would be greatly appreciated! Fraser