Math and Arithmetic

Who performs arithmetic operation on numerical data stored in registers?

345

Answer

User Avatar
Wiki User
04/28/2010

Arithmetic operations are performed by using Boolean Gates in a register.

A register consists of 32 or 64 bits usually.

For eg we want to add two single bits A and B.

We have

A B Sum Carry

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

Now, clearly

Sum = A (xor) B; and

Carry = A (and) B

If you are adding more than one bit (8 bit, say).

Then you need 8 such operations.

Carry from one bit will be forwarded to another bit and would be taken into consideration.

Then

Sum = A (xor) B (xor) Cprev

Carry(new) = A (and) B + B (and) Cprev + A (and) Cprev

+ = (or)

. = (and)