How Does Modulo 2 Long Division Work with XOR Operations?

  • Thread starter Thread starter fran1942
  • Start date Start date
  • Tags Tags
    Division
Click For Summary
Modulo 2 long division uses XOR operations instead of traditional subtraction, focusing on the most significant bits of the divisor and the current remainder. In the example, 1101 is shown to "go into" 1011 because the leading coefficient of both numbers is 1, allowing for the division to proceed. The process aims to eliminate the highest bits in the remainder, preventing the creation of a longer bit number. Treating the numbers as polynomials in a finite field further clarifies that 1101 divides any number with a leading coefficient of 1. Understanding this concept is crucial for correctly applying modulo 2 long division.
fran1942
Messages
80
Reaction score
0
Hello, I am trying to understand the following modulo 2 long division.
I understand that 1101 goes into 1111, so you write a 1 on the top.
The next stage after 'XOR'ing is to bring down the 1.
Now, 1101 does not go into 101, so you write a 0 at the top. So far so so good.
Now you bring down another 1 and 1101 still does not go into 1011, so how come they wrote a 1 in the third position at the top ? Shouldn't that be a zero ?

If someone could please explain where I am going wrong, I would most grateful.
 

Attachments

  • difv.jpg
    difv.jpg
    27.6 KB · Views: 704
Physics news on Phys.org
Since modulo 2 math uses xor instead of add or subtract, then only the most sigificant bit of the divisor and current remainder / dividend matter, so 1101 "goes into" 1011 because you're using xor, not subtract. The goal during the division process is to zero out the most significant bit(s) of the current remainder / dividend.

Consider what would happen if you didn't treat 1101 as "going into" 1011, you'd be stuck with a 5 bit number (10110) and since there are no borrows when doing xor, you would never be able to clear that uppermost bit left in the remainder with an xor of 10110 and 1101.

Another way to look at these numbers is to consider them to be polynomials with 1 bit finite field (modulo 2) coefficients. This would mean that

1101 = 1 x3 + 1 x2 + 0 x + 1
1011 = 1 x3 + 0 x2 + 1 x + 1

So when doing modulo 2 division, then 1101 goes into any number where the x^3 coefficient is a 1.
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
816
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 6 ·
Replies
6
Views
13K