Specialisation_digitale.gif

  Complement of a number  Recalls on the basic operations  Decimal addition
Binary addition Decimal subtraction Binary subtraction
Decimal multiplication Binary multiplication Decimal division
Binary division    
  Return to the synopsis To contact the author Low of page

Created it, 06/09/09

Update it, 06/09/20

N° Visitors  

apasrule.gif

Reception

4. - VALUE, SIGN, COMPLEMENT OF A NUMBER

With numeration, we saw the figures and the most current manner to organize them to constitute the numbers.

It however remains to specify certain terms relating to these numbers.

4. 1. - ABSOLUTE NUMERICAL VALUE

The absolute numerical value is one of the possible determinations of a variable quantity.

We saw that in the numeration of position, each graphics used has a significance in itself and, according to his row in the writing order of the number, one affects a given weight to him.

This double “weighing” constitutes the absolute numerical value of the number.

4. 2. - SIGN OF A NUMBER

The absolute value of a number is preceded by the sign + (more), when this number is higher than zero.

If this number is lower than zero, the absolute value is preceded by the sign - (less).

The numbers accompanied by the sign + will be called : positive numbers.

Those which are preceded by the sign - include : negative numbers.

The whole of the positive and negative numbers takes the overall name of the relative numbers.

By convention, the positive numbers are not represented with their sign +.

To summarize :

  the absolute value of a number is the value which is affected to him by the adopted numbering system and taking account of its sign. This value is represented between 2 vertical indents :

For more precision and in order to dissociate the sign of the number and that of the operations which one can carry out with the relative numbers, the latter should be represented by their absolute value and their sign between brackets.

Example (+ 256), (- 128).

In current calculations, by simplification, one omits, wrongly, the brackets.

HIGH OF PAGE 4. 3. - COMPLEMENT OF A NUMBER

The complement of a number is the number which it is necessary to add to the first to obtain from it a third, indicated by advance and being used to some extent as reference.

Example :

The complement of number 75 compared to the numerical value 87, indicated by advance is:

87 - 75 = 12

Importance of the ones complement an arbitrary value (as in this example : 87) is not obvious, except in the case of the subtraction.

There exists, on the other hand, of the particular cases, like the 10 or nines complements (in decimal system), as well as the complements with 1 or 2 (in binary system), which will be useful to us for the realization of the operations in the numerical systems (subtraction and division).

Obviously, in these systems which use the binary notation, they are the complements with 1 and 2, but for a better approach of this process, we will start with the complements in numeration at base 10.

4. 3. 1. - COMPLEMENT A9

Let us consider a number, made up of n figures, the nines complement of this number is that which is composed of the continuation obtained by the subtraction of each one of these n figures, of figure 9.

Example :

      The complement A9 of number 128 is :

999 - 128 = 871

871 is the complement A9 of number 128.

It is necessary, consequently, to understand by complement to 9, the complement of each figure composing this number compared to 9.

This term is intended to define the numerical value which it is necessary to add to a number indicated to obtain the power immediately above than this number, in the base used, less the unit.

Example :

Let us take again number 128.

The power or value of the row, immediately above than this number, in base 10 is :

      103 or 1000

The higher power minus the unit is :

1000 - 1 = 999

The complement with this value is :

999 - 128 = 871

The complement to 9 presents the following characteristic :

      The subtraction of the two terms (999 and 128) does not generate any loan, or retained, in the column of higher weight.

4. 3. 2. - COMPLEMENT A 10

There still, it is about a term which is intended to define the numerical value that it is necessary to add to a number indicated to obtain the power immediately above than this number, in the base used.

Consequently, it is the complement to 9 which one adds 1.

Example :

Let us seek the complement with 10 of number 128.

      the power immediately above is : 1000 (103).

      the complement with 1000 of 128 is : 1000 - 128 = 872.

Another way :

Let us take again the complement to 9 previously obtained and add 1 :

871 + 1 = 872

872 is the complement with 10 of 128.

The figures 11-a and 11-b represent the 9 and complements to 10 for the numbers from 1 to 9.

Complements_a_9_et_a_10.gif

4. 3. 3. - COMPLEMENT A 1

It is not any more question of the decimal system but binary system.

The complement with 1 is the binary equivalent of the nines complement to 9 decimal.

Figure 9 is the last graphic symbol used bases 10 of them before passing to the higher power (or row of higher weight).

In the same way, bases 2 of them, graphics 1 is the last symbol used before passing to the row of higher weight.

To summarize, the complement with 1 of a binary number is the numerical value which it is necessary to add to this number to obtain the numerical value immediately below than that of the higher power.

Example :

That is to say to find the complement with 1 of 1010.

Let us pose the operation :

Complement_a_1.gif

The binary number 0101 is the complement with 1 of 1010. If these two numbers are added, one obtains : 1111.

It should be noted that it is enough to replace the 0 by 1 and vice versa to find the complement with 1 of a binary number, the procedure is thus very simple.

4. 3. 4. - COMPLEMENT A 2          (Return)

It is the binary equivalent of the complement with 10 decimal, that we know already.

Since it is about the numerical value which it is necessary to add to a given number to obtain the value of the power immediately above, one can obtain it by taking the complement with 1 and by adding 1 to him.

Example :

That is to say to find the complement with 2 of 1010:

Complement_a_2.gif

One can also find it by withdrawing the number 1010 of the numerical value corresponding to the power immediately above :

Complement_a_2 (1) .gif

In the numerical systems, it is the preceding way which is used because it is easier to obtain.

This complement is called : True complement.

A fast way to find the complement with 2 a binary number, consists in enumerating this number on the basis of the line (the weakest weights) and all the 0 met until first 1 are transcribed like this first 1, without change, then, systematically, one reverses all the symbols Symboles_inverses.gif

This complement will use to us to carry out the operations in the numerical systems.

HIGH OF PAGE 5. - RECALLS ON THE BASIC OPERATIONS

In the explanations which relate to the binary complements with 1 and 2, we had to carry out some binary operations without you being informed of the rules which govern them.

These rules are the object of this chapter and always by preoccupation with a better approach, we will describe these operations in decimal system, then in binary system.

Before approaching these operations, it is advisable to point out the rules which the signs assigned to the operations and the numerical values of the numbers obey.

The basic operations that one is brought to implement in the numerical systems are :

      the sum, or addition and the operation reverses which is the difference or subtraction.

      the product, or multiplication and the operation reverses which is the quotient or division.

      rise with a power nième and its opposite operation, the extraction of root nième.

When one writes these operations which relate to numbers, one must distinguish them from/to each other by conventional symbols which are as follows :

The signs of the operators summons and produced will not have to be confused with those frequently employed for the logical operations corresponding to the union and the intersection (one will employ preferably, for the logical operations, the following symbols : È for the union and Ç for the intersection).

The relative numbers are represented by an absolute numerical value associated a positive sign (+) or negative (-) according to whether they are larger or less large than zero.

This relative sign, related to this absolute value, not to be confused with the sign of the operator, is placed, as well as the absolute value, between two brackets.

The sign of the operator, placed in front of these brackets, can, according to the operation, to modify the relative sign allotted to the absolute numerical value, in the following way :

      If the brackets are preceded by the sign of the sum (+ : more), the sign of the absolute value contained between these brackets is not modified.

Example :

Parentheses.gif

      If the brackets are preceded by the sign of the difference (- ; less), the sign of the absolute value contained between these brackets, must be changed.

Example :

      In the case of the product of two relative numbers, the absolute value of the result is positive (+) if the two numbers are of the same sign.

Example :

      The absolute value of the product of two relative numbers is negative, if these two numbers are signs opposite.

Example :

      The absolute value of the quotient of two relative numbers is positive, if the two numbers are same signs.

Example :

The quotient can be also noted in the following way:

Quotient.gif

The writing on only one line with the inclined bar, symbol of the quotient, is a more convenient notation from the typing point of view.

      The absolute value of the quotient of two relative numbers, is negative, if these two numbers are contrary signs.

Example :

HIGH OF PAGE 5. 1. - DECIMAL ADDITION

In general, for the addition or the subtraction, one registers the first term, then in lower part, the following terms, while placing in the same columns the figures assigned to identical weights.

For the addition, more than two terms the ones in lower part can be laid out of the others.

We will add then the figures with the column on the right (of the weakest weight).

In the decimal system, any result higher than 9 generates a carryforward in the following column of immediately higher weight.

One adds then the figures aligned in the second column, plus the carryforward if there exists and so on to the last occupied column.

One positions, in the row of higher weight, the carryforward of the last column, if there is one of them.

Figure 12 represents the table of the decimal addition. One indicates the first term (on the left lines and in heavy type), then the second term (in heavy type, higher column). The result is given in the box being to the intersection of the line and the column corresponding under the selected terms. in the part in cyan, the sum of terms 1 and 2 imposes a carryforward in the column of higher weight.

The result of this operation is a total.

Table_de_l_addition_decimale.gif

Example : That is to say to add 75 and 46 : figure 13 gives the procedure.

Addition_decimale (4) .gif

The sum or addition is not limited to the positive numbers, as we saw at the beginning of this chapter, but to the whole of the relative numbers.

Generally, it gives for result the sum of the absolute values when the numbers are of the same sign and the difference if they are contrary signs.

The sign of the result is the same one as that of the two numbers which with the greatest absolute value.

Example :

HIGH OF PAGE 5. 2. - BINARY ADDITION          (Return)

It is carried out same manner as the decimal addition.

Numeration being at base 2, any result higher than 1 generates a carryforward in the following column.

Figure 14 represents the table of the binary addition. The use of this table is carried out same manner as for that of the decimal addition of figure 12. In the part in cyan, the sum of terms 1 and 2 generates a carryforward. One will note the great simplicity of this table compared to that of the decimal addition.

Table_addition_binaire.gif

Example: That is to say to add 1310 and 510.

Let us carry out the transformation of each number into binary.

Figure 15 shows the process of addition of these two binary numbers.

 Addition_binaire.gif

One obtains as follows: 100102 Þ 1810

The same rules of signs apply the binary operations also in the case of.

HIGH OF PAGE 5. 3. - THE DECIMAL SUBTRACTION OR DIFFERENCE

As for any operation, it will be advisable to proceed with order.

The first term is posed, then one aligns in top the second term, while making coincide, in the columns, the identical weights.

One begins the subtraction with the column on the right (of the weakest weight) while taking as result the complement with the withdrawn figure, of the figure subtracter.

The withdrawn figure is that which belongs to the withdrawn number ; this last corresponds to the first term.

The figure subtracter is that which belongs to the subtracter number ; this last corresponds to the second term.

If the figure withdraws has a numerical value lower than that of the figure subtracter, there is generation of a loan in the column of weight immediately higher, that one defers in the form of reserve in this same column, by cutting off this reserve than the withdrawn figure.

Figure 16 indicates the table of decimal subtraction. In the part in cyan, the withdrawn term having a numerical value lower than that of the subtracter term, the operation generates a loan in the column of higher weight. The result of this operation is a difference.

Table_de_la_soustraction_decimale.gif

Example : That is to say to withdraw 46 of 75.

Figure 17 shows the process of this subtraction into decimal.

Soustraction_decimale.gif

While starting with the weakest column of the weight, one notes, in this example, which one cannot cut off a more large number, of a more low number. One will have to practice a loan in the column immediately above.

Thus, we can carry out the subtraction, the withdrawn number is not more 5, but : 10 + 5 is 15, to which we can cut off 6. The difference is 9.

This loan of a unit in the column of tens, it should now be cut off in this same column, without what the withdrawn number (75) would see its modified numerical value (it would become equal to 85).

Once this reserve carried out, the subtraction can continue to the last occupied column.

The result or difference, is the complement of the subtracter number compared to the withdrawn number.

If the result and the subtracter number are added, the withdrawn number is found.

If the number withdraws has a numerical value more raised or equal to the subtracter number, the operation is possible and the result is positive or null.

If the number withdraws has a lower numerical value, to carry out the operation, an artifice is used. There is several, simplest consists in reversing the terms :

When this inversion is carried out, one assigns to the numerical value of the result the negative sign (-).

This is a fast and practical method, because one can also use the loan in the column immediately above. In this case, one obtains the complement with 100 of the result.

One can also proceed by addition of the complement of the subtracter number to the number withdraws as we will see it in the chapter devoted to the operations in the numerical machines (the machine term is used here to indicate a system working with numerical signals).

HIGH OF PAGE 5. 4. - THE BINARY SUBTRACTION 

Dune general way, the decimal or binary operations obey the same rules.

One cuts off, in the weakest column of the weight, the figure subtracter of the withdrawn figure, in other words one takes the complement of the figure subtracter compared to the withdrawn figure.

If the figure withdraws has a numerical value lower than that of the figure subtracter, there is loan at the end withdrawn column of immediately higher weight.

One proceeds thus of column in column until the last one representing the highest weight.

Just as for the decimal subtraction, if the term withdraws has a numerical value lower than the subtracter term, one reverses the operators and one assigns to the result the sign (-).

Figure 18 represents the binary table of subtraction, the box in cyan corresponds to a loan at the end withdrawn column of immediately higher weight.

There still, one notes a great simplicity in this table compared to that of the decimal subtraction.

Table_de_la_soustraction_binaire.gif

Example : That is to say to withdraw 510 of 1110.

Let us carry out the transformation into binary :

Figure 19 shows the course of the binary subtraction.

Soustraction_en_binaire.gif

The loan generated by the operation of the column 22 is deferred in the form of reserve to the number of the column of weight immediately above (either 23).

Same remarks that for the decimal subtraction can also apply in this case.

HIGH OF PAGE 5. 5. - THE PRODUCT OR DECIMAL MULTIPLICATION

The multiplication is a succession of additions. For example, if one wants to multiply 15 x 5, it is enough to add five times number 15 with itself to obtain the result.

The multiplication tables are made to avoid us these continuations of additions.

The number which represents the quantity that one must multiply names the multiplicand.

The second term of the product names the multiplier.

Thus, in the preceding example, 15 are the multiplicand and 5 the multiplier.

Figure 20 represents the multiplication table.

Table_de_multiplication.gif

The reading of the result is carried out in the box corresponding to the intersection of the line of the multiplicand with the column of the multiplier.

The part in cyan generates a carryforward which will have to be added to the following product.

To carry out this operation, one calculates the product of the figure occupying least low row of the multiplier with each figure assigned to the various weights of the multiplicand, while starting with the weakest weight.

When one of these products generates a carryforward, this one will be added with the following product.

When these products are carried out, they constitute the first partial result.

The second partial result is obtained by making the product of the second figure of the multiplier with each figure of the multiplicand like previously.

This second partial result will be positioned under the first and by shifting it of a row towards more raised weights, because it is about a product obtained with the figure of the multiplier occupying the row of weight 101.

If there is, the other partial results will be laid out under the precedents, by respecting the shift due to the row of the multiplying figure.

The final result will be expressed by making the sum of the partial results.

It should be noted that there are as many partial results there are figures with the multiplier.

Example : That is to say to multiply 75 by 406.

Figure 21 described this multiplication.

Multiplication_decimale.gif

The sign of the product is given according to the rules stated at the beginning of this chapter, because the product applies to the relative numbers (not only with the positive numbers as in our example). We point out below these rules which also apply to the binary operations :

HIGH OF PAGE 5. 6. - THE BINARY PRODUCT             (return)

Binary system, based on two elements, rises a simplification from calculation. This simplification is even more sensitive with the multiplication. Indeed, this operation does not generate any carryforward nor loan. Figure 22 represents the binary multiplication table.

Table_du_produit_binaire.gif

As for the system at base 10, the multiplication by 0 involves a result equal to 0. The multiplication by 1 involves the recopy of the multiplicand.

The procedure of obtaining the result is identical to that of the decimal multiplication (or for any other multiplication in another numbering system).

Example: That is to say to multiply 1110 per 2010.

Let us transform its two numbers into binary.

Figure 23 represents this binary multiplication.

Multiplication_binaire.gif

The result of this product is thus 110111002, which is equivalent to the decimal number 22010.

HIGH OF PAGE 5. 7. - DIVISION OR DECIMAL QUOTIENT

The quotient, which is the opposite operation of the product, is consequently, a succession of differences or subtractions (the product being a continuation of addition).

The rules of signs stated at the beginning of the chapter apply to the decimal or binary quotient.

The quotient is composed of a number to divide, which one names the dividend, of a divisor number, that one names dividing.

The number of times that one can withdraw the divider of the dividend, until that is not possible any more, gives us the quotient. If the last subtraction indicates a null result, the quotient is known as entirety (or exact).

If on the contrary, there is a remainder, the quotient is known as approximate.

Example : That is to say to divide 75 by 15.

Figure 24 exposes a possible method.

Methode_des_Soustractions_successives.gif

We can withdraw five times number 15 of number 75, consequently, the quotient is 5 and since the last result is null, the quotient is whole.

The multiplication of the quotient by the divider, addition with the remainder if there exists, gives again the dividend.

The procedure of obtaining the result, in practice, is not carried out according to this method of successive subtractions which is too long. So this operation is a little more delicate than the others.

One starts by seeking how much time the divider is contained entirely in the number consisted the figures occupying the rows of the highest weights of the dividend.

This number constitutes the first partial dividend. The number of times that the divider is contained in this first partial divider, constitutes the first affected figure with the highest weight of the quotient.

One withdraws then the product of the divider by this partial quotient, of the first partial dividend and this difference (larger or equalizes to zero) constitutes, with the figure occupying the following weight of the dividend, the second partial dividend.

One seeks, again, how much time the divider is contained in this second partial dividend and the product of the divider by the second quotient is withdrawn to him.

One carries out these operations until the dividend does not have any more significant figure, if the last difference is equal to zero, the quotient is known as exact, (the dividend is a multiple entirety of the divider).

If it is not thus, the quotient known as is approached and division comprises a remainder.

Example : That is to say to divide 405 by 3.

For more facility, one can lay out the operation in the following way :

Operation_division.gif

Figure 25 gives the procedure adopted to carry out this division.

Procedure_pour_effectuer_cette_division.gif

We are in the presence of an exact quotient (135), the last difference being equal to zero. Number 405 is a multiple of 3.

This procedure implies two operations:

These operations are described in chapters 5.5 and 5.3 as well as the corresponding tables.

These operations are easier to carry out than to enumerate, because we acquired automatisms.

There is no question of calling into question these automatisms, but they sometimes make forget the elementary processes which we use for frequent tasks.

By pointing out them, the similarity between the decimal and binary operations appears better and the procedures used in the numerical machines will appear more familiar to you.

HIGH OF PAGE 5. 8. - THE BINARY QUOTIENT

The advance for obtaining the result is identical to that of decimal division. Consequently, we will pass to an example.

The practical procedure implies two operations:

These operations are familiar for us, their tables are represented in figures 22 and 18.

That is to say to divide 101012 (2110) by 112 (310).

Figure 26 represents the procedure used which is completely similar to the method employed into decimal.

Division_binaire.gif

Division stops there, because the remainder is equal to zero and there is no more figure, with the dividend, to combine with the remainder.

The result of division is thus 1112 is 710.

Click here for the following lesson or in the synopsis envisaged to this end. Haut de page High of page
Preceding page Following page

 

     

Daniel