Skip to main content

Questions tagged [computer-arithmetic]

Computer Arithmetic is the study of arithmetic algorithms and their hardware implementation. Use this tag when you ask questions on designing or verifying digital hardware for arithmetic functions.

Filter by
Sorted by
Tagged with
0 votes
1 answer
79 views

The division principle is simply \$D = Q \cdot V + R\$, where \$D\$ is a dividend, \$V\$ is a divisor, \$Q\$ is a quotient and \$R\$ is a remainder. The pen-and-paper binary division algorithm works ...
Ghungroo's user avatar
-1 votes
1 answer
251 views

I was currently reading this blog (highly recommended) about FPGA doing math (Doing fixed-point Math in FPGA). But I am having some doubts while reading the second example (named ...
Fc3 Fc3's user avatar
  • 11
3 votes
1 answer
325 views

Limiting this to the current generation of consumer NPU hardware going into new PCs: Can the NPU accelerator hardware being put in recent PCs practically be repurposed for non-AI tasks? And what ...
davolfman's user avatar
  • 238
0 votes
0 answers
84 views

TLDR You can skip to question section. Intro I know the analog computer was actually invented long ago. I don't know how analog computer architecture was, but I guess it was using active components. ...
Muhammad Ikhwan Perwira's user avatar
4 votes
5 answers
923 views

In digital computing, addition operations are commonly performed using circuits composed of logic gates, such as the full-adder circuit, which combines multiple bits to generate a sum along with a ...
Muhammad Ikhwan Perwira's user avatar
0 votes
2 answers
171 views

How does an FPGA synthesis tool decide how to implement arithmetic operations on the target hardware? For example, if I implement some integer multiplication and division operations directly in HDL ...
b7031719's user avatar
1 vote
1 answer
223 views

This question is related to article on rounding found here. The "Convergent rounding: Round half to even" code is written as follows: ...
quantum231's user avatar
  • 12.4k
0 votes
1 answer
79 views

My textbook (Harris and Harris, Digital Design and Computer Architecture) asks us to design a simplified (in that only positive numbers be considered, with NaN and infinities ignored) FP adder block. ...
EE18's user avatar
  • 1,259
0 votes
0 answers
260 views

If I understand it correctly, the Dadda multiplier adds the partial products in a similar way compared to the Wallace multiplier, but it doesn't reduce the partial product terms as much in its tree ...
Minecraft dirt block's user avatar
3 votes
2 answers
830 views

(This is all related to my trying to understand my question here.) Let's consider the addition of two n-bit integers, \$x = x_{n-1}...x_0\$ and \$y\$. Let their sum be \$s\$. For the addition of ...
EE18's user avatar
  • 1,259
0 votes
2 answers
646 views

I saw somewhere that if we have A (dividend) which is 2n-bits and B (divisor) which is n-bit, we can store the quotient in n-bits with a specific condition: the (n-1)th bit of the divisor has to be 1. ...
Emad Kheyroddin's user avatar
1 vote
2 answers
333 views

I am trying to solve an equation using a PIC 18F4520 but the result that I am getting is not matching to the accurate answer that I calculated with Matlab. The part of the equation is ...
newbie's user avatar
  • 25
-1 votes
1 answer
133 views

We know that two un/signed integers arithmetic operation using special circuit called full-adder to execute arithmetic operation in Arithmetic Logic Unit (ALU). The full-adder I mean is classical ...
Muhammad Ikhwan Perwira's user avatar
2 votes
1 answer
520 views

I understand the x86 operation to perform integer multiplication of two numbers (e.g. on 64 bits) is MUL. My question is, how is this operation generally ...
Weier's user avatar
  • 187
3 votes
1 answer
164 views

I was hoping I could get some help with a floating point adder I'm designing in verilog. The test case I am having trouble with is adding the following 2 numbers: ...
NoahWecoso's user avatar
1 vote
2 answers
160 views

I have a problem figuring out why the smallest negative number we can represent in 3 bits, using Signed-2's-Complement is -4. I understand that in S2C format, we can create numbers from 2x-1-1 (...
Ali A's user avatar
  • 11
1 vote
0 answers
55 views

Suppose you are implementing a BCD multiplier. Google says there are reasonably efficient known circuits for this. Say 8x8 -> 16 digits, and trying for a reasonable compromise between speed and ...
rwallace's user avatar
  • 563
4 votes
2 answers
236 views

Whenever I need to add two numbers, I just write a+b in VHDL. I never have to bother about what is synthesized, as long as timing and area constraint is met I think the objective is achieved. I have ...
quantum231's user avatar
  • 12.4k
4 votes
3 answers
3k views

For example, to add two 16-bit numbers on my 8 bit machine, I add the low bytes together, then the high bytes together, and then add the carry flag to the high byte of the output. This strategy falls ...
Max Zabarka's user avatar
1 vote
1 answer
103 views

Cpu or gpu making calculations and creating information (decrease in entropy) is converting 100% of energy it pulls from the wall into heat. How should we understand the created order in terms of ...
Ahmet Said AK's user avatar
1 vote
0 answers
558 views

I am trying to implement 8-bit twos complement addition. I am doing this by splitting the 8 bit inputs into 4 bit parts and then implementing 4 bit complement addition. A well known diagram is where ...
a6623's user avatar
  • 111
4 votes
1 answer
3k views

The context is: I have 16-bit registers v1 and v2. These contain signed (2's complement) 16-bit values, but I decided to stay ...
Cal-linux's user avatar
  • 2,264
1 vote
3 answers
2k views

Fixed point numbers can be in many different forms depending on the number of bits before and after the decimal expressed as Qm.n. Floating point numbers can be in many forms depending on the number ...
quantum231's user avatar
  • 12.4k
-1 votes
1 answer
60 views

I'm trying to implement the following substractor circuit in python: And below is my code for it: ...
theCursedPirate's user avatar
0 votes
0 answers
93 views

So I'm working with the following differences equation: $$y_n=\alpha y_{n-1}+(1-\alpha)x_n$$ I know this works with 16-fixed point arithmetic, and given some samples I'm trying to figure out how the ...
Granger Obliviate's user avatar
2 votes
1 answer
874 views

I've wrote a verilog code for Multiplier (8bit). I'm not getting the right result. Kindly tell me where i went wrong. ...
Kuchi Yashwanth's user avatar
3 votes
2 answers
946 views

My question is closely related to this one: How do computers understand decimal numbers? However, that question deals with rational numbers only. I was wondering if irrational numbers can be ...
Shashank V M's user avatar
  • 2,369
3 votes
4 answers
3k views

I'm performing some operations with fractional numbers in a 16-bit FIXED-POINT processor. I have to multiply the numbers \$ x=-6.35 \$, represented in \$ Q_{11} \$, and \$ y=-0.1 \$, represented in \$...
Granger Obliviate's user avatar
0 votes
0 answers
2k views

So I am working on this ALU, and I have made this 8-bit multiplier based on this design: . Is it possible to adapt this design into a binary divider by using Subtractors instead of Adders, and maybe ...
Jamie Engel's user avatar
0 votes
2 answers
284 views

I am trying to design a full subtractor in SystemVerilog. I searched on Wikipedia and I found this https://en.wikibooks.org/w/index.php?title=Microprocessor_Design/Add_and_Subtract_Blocks ...
Shashank V M's user avatar
  • 2,369
0 votes
1 answer
910 views

Hi i need help in understanding the binary division restoring method From -2, we stored the value to 5 by adding the divisor which is 7 After adding 7 to get 5, why does it automatically jump to 10? ...
Yogi Bear's user avatar
  • 101
0 votes
0 answers
476 views

I'm using the DSP unit (just a fancy name for the multiplier/accumulator unit) of the Gowin GW1N devices to do some fairly simple math. These units accept two 18 bit inputs for the multiplier adding ...
gnuarm's user avatar
  • 197
2 votes
2 answers
1k views

I am trying to multiply signed numbers on a Nexys A7-100T FPGA development board with VHDL. See Reference manual webpage link for the FPGA board hardware information. Also see this link (begins page ...
David777's user avatar
  • 1,615
2 votes
1 answer
496 views

What is the fastest (in clock cycles) division algorithm that will run on an ATMEGA1284? The dividend is an unsigned 16-bit number passed into the algorithm in a pair of 8-bit registers. The divisor ...
user4574's user avatar
  • 13.6k
2 votes
2 answers
602 views

So I was asked to perform the simple task of doing a 3-bit arithmetic shift of the number 1101 (-3 in 2's complement notation). Now this is easy and it goes as 1101 -> 1110 -> 1111 -> 1111. ...
Granger Obliviate's user avatar
0 votes
1 answer
132 views

I'm curious about the trade-offs that have been made in implementing different kinds of arithmetic in different models of computers, to which I'm trying to understand what the costs of various options ...
rwallace's user avatar
  • 563
1 vote
1 answer
255 views

The first chapter of my textbook on microcontroller theory has the following paragraph. Here is one of the examples provided. The book shows three such examples, but provides no explanation for why ...
elile's user avatar
  • 337
0 votes
2 answers
695 views

I have been given the task of designing a 12-bit pipelined adder: There are 4-bit adders connected by latches. Why are latches used between the 4-bit adders? Is it for synchronization?
Ashlesha Sunil Agate's user avatar
4 votes
2 answers
16k views

I'm studying Digital Design and Computer Architecture book, I'm stuck in the section of the carry-lookahead adder because there's something that I don't fully ...
abumandour's user avatar
17 votes
4 answers
17k views

I was looking for a way to calculate the square root of a given 8-bit number using only digital combination or sequential logic. Is this possible? One way may be to just use a look-up table since I'm ...
Rick_2047's user avatar
  • 3,917