Questions tagged [arithmetic-division]

Division of integer or floating-point numbers represented as bits. For analog division tag with [analog-computer] instead.

31 questions
45
votes
6 answers

Why does hardware division take much longer than multiplication?

Why does hardware division take so much longer than multiplication on a microcontroller? E.g., on a dsPIC, a division takes 19 cycles, while multiplication takes only one clock cycle. I went through some tutorials, including Division algorithm and…
Marko Gulin
  • 1,531
  • 2
  • 17
  • 32
29
votes
5 answers

How does division occur in our computers?

How does division occur inside digital computers? What is the algorithm for it? I have searched hard in google but haven't got satisfactory results. Please provide a very clear algorithm/flowchart for division algorithm with a sample illustration.
program-o-steve
  • 313
  • 1
  • 3
  • 5
13
votes
10 answers

Fastest way to get integer mod 10 and integer divide 10?

If a hardware doesn't support modulus or division operations, it takes many more CPU cycles to simulate modulus/division by software. Is there any faster way to calculate division and modulus if the operand is 10? In my project I frequently need to…
12
votes
10 answers

Efficient inverse (1/x) for AVR

I'm trying to find an efficient way of calculating an inverse on an AVR (or approximating it). I'm trying to calculate the pulse period for a stepper motor so that I can vary the speed linearly. The period is proportional to the inverse of the speed…
Peter Gibson
  • 1,800
  • 1
  • 12
  • 14
6
votes
1 answer

I want to implement a math equation in FPGA, should I describe a CPU or can I do it just by code?

For a school project I'm trying to implement an equation for example like this: (EDIT) B = ((A + 2) * |A - 10|) / (c * c) everything is unsigned binary values, absolute values always. The equation should be evaluated 57600 times per second for an…
sujeto1
  • 225
  • 2
  • 9
4
votes
1 answer

Why don’t most RISC ISAs write integer MULH/MUL or DIV/REM to two general-purpose registers?

Most hardware multiplication and division algorithms can compute the high and low words of a product of two integers, or both the quotient and remainder of the division of two integers, at the same time. In major RISC ISAs, there are many different…
Davislor
  • 181
  • 3
  • 10
4
votes
2 answers

Why does signed (2's complement) binary multiplication have different procedure than unsigned?

The 2's complement binary multiplication does not have same procedure as unsigned if the both operands do not have the same sign. What is the logic behind that? Does special consideration apply to division also when we carry out division with 2's…
quantum231
  • 11,218
  • 24
  • 99
  • 192
3
votes
2 answers

hardware implementation of division algorithm

I have tried hard but I don't understand how this algorithm is working.Please explain the flow chart. \$DVF\$ is the divide overflow flip flop. \$A_s\$ is the sign bit of \$A\$ \$B_s\$ is the sign bit of \$B\$ \$E\$ is the register that has a carry…
Suhail Gupta
  • 278
  • 1
  • 5
  • 14
3
votes
2 answers

Dividing numbers on an FPGA

I wrote a program for a Cyclone II FPGA that divides 2 64 bit numbers and returns if the remainder is 0 using the modulus (%) operation. When I compiled the program with 64 bit numbers for the divisor and dividend it used almost all of the logic…
Eric Johnson
  • 533
  • 1
  • 5
  • 19
2
votes
1 answer

System Generator: How to configure the CORDIC divider block. Understanding the block parameters

I have some dudes about the block parameters of the CORDIC DIVIDER. I would like to someone explain me the parameter called "Latency for each processing element". (See the parameters inside the red rectangle) I don't understand the notation that is…
2
votes
1 answer

How do computers understand decimal numbers?

Computers calculate numbers in 0s and 1s. A bit can be either but not in between. So if you enter 3/2 into a calculator, it should return either 1 or 2, right? Wrong! It gives you 1.5, the correct answer. Even on problems with more complexity, the…
Nip Dip
  • 281
  • 2
  • 10
2
votes
1 answer

Signed Integer Division Optimization

I've implemented a division algorithm on an FPGA using the long division algorithm. My implementation does not use pipelining, but works iteratively and requires very few logic elements since the algorithm mainly consists of a single subtraction and…
sebi707
  • 201
  • 1
  • 1
2
votes
1 answer

Why overflows are omitted in the non-restoring hardware binary division algorithm?

I'm reading a book about a non-restoring binary division algorithm, for example 52_octal divided by 41_octal: Round | Action | Divisor | Remainder(6 bits) appended Quotient(6 bits) …
Niing
  • 121
  • 3
2
votes
2 answers

SRT division vs Non restoring division

Assuming base b=2, is there a particular advantage in terms of performance when comparing SRT division to non restoring division? In Non restoring division, for each iteration, the output digits belong to the set {-1,1} which implies that an…
user8469759
  • 618
  • 1
  • 11
  • 25
1
vote
1 answer

How to implement division?

I'm creating an ALU for a simple calculator. I have made the addition, subtraction, and multiplication part of the ALU and with them I didn't have to initialize anything. I am attempting to create the division part but my inputs and outputs will not…
1
2 3