6

First of all, this is not a duplicate question of this because it hasn't answered my questions below.

I searched for many resources and ended with no clear perception of how to perform signed number division using 2's complement, specifically for the case where one of the divisors or dividend or both are negative.

I read the Signed Number Division section from chapter 2 of Digital Fundamentals by Floyed and all of its examples and problems. I even read through internet resources that explain division, but they only used positive numbers (as explained below):

enter image description here

enter image description here enter image description here

, but what about 100/-25 or -100/25 or -100/-25? What are the rules to follow?

Can anyone give a simple explanation on, for example, how to divide 14 by -7?

Stev
  • 65
  • 1
  • 7
user2963216
  • 391
  • 2
  • 4
  • 11
  • 1
    You're misunderstanding the instructions, it clearly accounts for any of combination of signs. Just follow the instructions you posted. – Bob Oct 29 '15 at 11:50
  • 1
    is true uncomplemented form means the number in positive form – user2963216 Oct 29 '15 at 18:39
  • 2
    In the first image, it is given that, for division, the two numbers must be in uncomplemented form. So, in binary, 14 is `1110` and 7 is `0111`. And if you perform division, you will get 10 which is 2. Next, we have to determine what the sign of quotient will be. Here the divisor and dividend are of different sign. So, the quotient will be negative 2. Thus, we will perform the two's complement for 2 and we will get `1110` which is -2. So, the final answer will be -2. – Saravana Kumar Apr 13 '20 at 11:42

1 Answers1

-1

The rules states that if the numbers have different sign bits that the quotient and remainder gotten when both are divided(this is after the have both been turned positive) will be negative.So for 14/-7, they will have different sign bits when turned to binary so this means your quotient and remainder will be negative. Now you leave 14 in positive form and turn -7 to it's corresponding positive binary number and carry out the division with the positive forms of both numbers, when you get your quotient and remainder from dividing the positive form of both numbers you turn both the quotient and remainder negative.

guy777
  • 21
  • 3
  • **This answer is wrong**! The remainder retains the sign of the unmodified dividend. For `14/-7` the remainder is 0, but for `16/-7` you would not make the remainder (+2) negative like this answer tells you. – Sep Roland Jun 02 '23 at 16:58