The sign of the operator, placed in front of these parentheses, can, according to the operation, modify the relative sign attributed to the absolute numerical value, in the following way :
If the parentheses are preceded by the sign of the sum (+ : plus), the sign of the absolute value contained between these parentheses is not modified.
Example :
If the parentheses are preceded by the sign of the difference (- ; minus), the sign of the absolute value between these parentheses 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 :
-
(+ 5) x (+ 5) = (+ 25)
-
(- 5) x (- 5) = (+ 25)
The absolute value of the product of two relative numbers is negative, if these two numbers are of opposite signs.
Example :
The absolute value of the quotient of two relative numbers is positive, if the two numbers are of the same signs.
Example :
-
(+ 12) / (+ 3) = (+ 4)
-
(- 12) / ( - 3) = (+ 4)
The quotient can also be noted as follows :
Single-line writing with the slanted bar, the quotient symbol, is a more convenient notation from a typing point of view.
The absolute value of the quotient of two relative numbers is negative, if these two numbers are of opposite signs.
Example :
-
(+ 12) / (- 3) = (- 4)
-
(- 12) / (+ 3) = (- 4)
5. 1. - DECIMAL ADDITION
As a general rule, for the addition or for the subtraction, the first term is entered, then below, the following term or terms, by placing in the same columns the digits assigned to identical weights.
For the addition, more than two terms can be arranged one below the other.
We will then add the digits of the rightmost column (lowest weight).
In the decimal system, any result greater than 9 generates a carry in the next column of immediately higher weight.
Then add the numbers aligned in the second column, plus the report if it exists and so on until the last column occupied.
Position the highest column of the last column if there is one.
Figure 12 shows the table of the decimal addition. The first term is designated (to the left of the lines and in bold type), then the second term (in bold, upper column). The result is given in the box at the intersection of the row and the column corresponding to the chosen terms. in the cyan part, the sum of the terms 1 and 2 imposes a carry over in the column of higher weight.
The result of this operation is a total.
Example : Or to add 75 and 46 : Figure 13 gives the procedure.
The sum or addition is not limited to positive numbers, as we saw at the beginning of this chapter, but to the set of relative numbers.
In a general way, it gives the result of the sum of absolute values when the numbers are of the same sign and the difference if they are of opposite signs.
The sign of the result is the same as that of the two numbers which has the greatest absolute value.
Example :
5. 2. - BINARY ADDITION
(Return)
It is done in the same way as the decimal addition.
Since the count is based on 2, any result greater than 1 generates a carry over to the next column.
Figure 14 shows the table of the binary addition. The use of this table is carried out in the same way as for that of the decimal addition of Figure 12. In the cyan part, the sum of the terms 1 and 2 generates a carry. Note the great simplicity of this table compared to that of the decimal addition.
Example : Or to add 1310
and 510.
Let's transform each number into binary.
Figure 15 shows the process of adding these two binary numbers.
We obtain : 100102
→
1810
The same sign rules also apply in the case of binary operations.
5. 3. - DECIMAL SUBTRACTION
OR DIFFERENCE
As with any operation, it will be necessary to proceed with order.
The first term is placed, and then the second term is aligned, making the identical weights coincide in the columns.
We start the subtraction by the rightmost column (of the lowest weight) by taking as a result the complement of the subtracted figure.
The subtracted figure is the one that is part of the subtracted number ; the latter corresponds to the first term.
The subtractor is the number that is part of the subtractor number ; the latter corresponds to the second term.
If the digit subtracted from a numeric value lower than that of the subtractor, a loan is generated in the next higher weight column, which is carried forward as a hold in this same column, subtracting this deduction from the subtracted figure.
Figure 16 shows the decimal subtraction table. In the cyan part, the subtracted term has a lower numeric value than the subtractor term, the operation generates a loan in the higher weight column. The result of this operation is a difference.
Example : Either to subtract
46 of 75.
Figure 17 shows the process of this subtraction in decimal.
Beginning with the lowest column of weight, we see in this example that we can not reduce a larger number by a smaller number. We will have to practice a loan in the next higher column.
Thus, we can realize the subtraction, the subtracted number is no longer 5, but : 10 + 5 is 15, to which we can subtract 6. The difference is 9.
This borrowing of a unit in the tens column, we must now subtract it in this same column, otherwise the number subtracted (75) would see its numerical value modified (it would become equal to 85).
Once this deduction has been made, the subtraction can continue to the last column occupied.
The result or difference, is the complement of the subtractor number with respect to the subtracted number.
If we add the result and the subtractor number, we find the number subtracted.
In the case where the number subtracted has a numerical value greater than or equal to the subtractor number, the operation is possible and the result is positive or zero.
In the case where the number subtracted has a lower numerical value, to perform the operation, a device is used. There are several, the simplest is to reverse the terms :
When doing this inversion, the negative value (-) is assigned to the numerical value of the result.
This is a quick and convenient method, because you can also use the loan in the next higher column. In this case, we obtain the complement to 100 of the result.
One can also proceed by adding the complement of the subtractor number to the subtracted number as we will see in the chapter on operations in digital machines (the term machine is used here to denote a system working with digital signals).
5. 4. - BINARY SUBTRACTION
In general, decimal or binary operations follow the same rules.
In the lowest weight column, we subtract the subtractor from the subtracted figure, that is, we take the complement of the subtracter in relation to the subtracted figure.
If the digit subtracted from a numeric value lower than that of the subtractor, borrowing from the subtracted subtraction of the next higher weight column.
This is done from a columnar column to the last one representing the highest weight.
As with decimal subtraction, if the term subtracts from a smaller numerical value than the term subtractor, the operators are reversed and the (-) sign is assigned to the result.
Figure 18 represents the binary subtraction table, the cyan box corresponds to a borrowing at the subtracted term from the next higher weight column.
Again, there is a great simplicity in this table compared to that of the decimal subtraction.
Example : Either to subtract
510
of 1110.
Let's make the transformation into binary :
10112
510
→ 1012
Figure 19 shows the progress of the binary subtraction.
→
610
The loan generated by the transaction in column 22
is carried forward as a holdback to the next higher weight column (either 23).
The same remarks as for decimal subtraction can also apply in this case.
5. 5. - THE PRODUCT OR DECIMAL
MULTIPLICATION
Multiplication is a series of additions. For example, if you want to multiply 15 x 5,
simply add five times the number 15 with itself to get the result.
Multiplication tables are made to avoid these additions.
The number that represents the quantity that must be multiplied is called the multiplicand.
The second term of the product is called the multiplier.
Thus, in the previous example, 15 is the multiplicand and 5 is the multiplier.
Figure 20 shows the multiplication table.
The result is read in the box corresponding to the intersection of the multiplicand line with the multiplier column.
The cyan part generates a report that will have to be added to the next product.
To perform this operation, the product of the digit occupying the lowest rank of the multiplier is calculated with each digit assigned to the different weights of the multiplicand, starting with the lowest weight.
When one of these products generates a report, it will be added to the next product.
When these products are made, they constitute the first partial result.
The second partial result is obtained by making the product of the second digit of the multiplier with each multiplicand digit as before.
This second partial result will be positioned under the first and shifted one rank to the higher weights, since it is a product obtained with the multiplier figure occupying the weight rank 101.
If there are, the other partial results will be arranged under the previous ones, respecting the offset due to the rank of the multiplier figure.
The final result will be expressed as the sum of the partial results.
It should be noted that there are as many partial results as there are numbers to the multiplier.
Example : Either multiply 75 by 406.
Figure 21 describes this multiplication.
-
The product of 0 by a number N is equal to
0.
-
The product of a number N
by 0 does not make sense, but if we apply commutativity, we go back to the previous case and the result is equal to 0.
The sign of the product is determined by the rules at the beginning of this chapter because the product applies to relative numbers (not just positive numbers as in our example). We recall below these rules, which also apply to binary operations :
-
a positive number multiplied by a positive number gives a positive product.
-
a negative number multiplied by a negative number gives a positive product
-
a negative number multiplied by a positive number gives a negative product (the opposite gives the same result when the sign).
5. 6. - THE
BINARY PRODUCT
(Return)
The binary system, based on two elements, results in a simplification of the calculation. This simplification is even more sensitive with multiplication. Indeed, this operation does not generate any transfer or loan. Figure 22 shows the binary multiplication table.
As for the 10-based system, the multiplication by 0 causes a result equal to 0. The multiplication by 1 causes the copying of the multiplicand.
The procedure for obtaining the result is identical to that of the decimal multiplication (or for any other multiplication in another numbering system).
Example : Either multiply
1110
by 2010.
Let's turn its two numbers into binary.
10112
2010
→ 101002
Figure 23 shows this binary multiplication.
The result of this product is therefore 110111002,
which is equivalent to the decimal number 22010.
5. 7. - DIVISION OR QUOTIENT DECIMAL
The quotient, which is the inverse operation of the product, is therefore a sequence of differences or subtractions (the product being a continuation of addition).
The sign rules at the beginning of the chapter apply to the decimal or binary quotient.
The quotient is composed of a number to divide, which is called the dividend, of a divisor number, which one names divisor.
The number of times we can subtract the divisor from the dividend, until this is no longer possible, gives us the quotient.
If the last subtraction indicates a null result, the quotient is called integer (or exact).
If, on the contrary, there is a remainder, the quotient is said to be approximate.
Example : Either divide 75
by 15.
Figure 24 outlines a possible method.
We can subtract the number 15 from the number 75 five times, so the quotient is 5 and since the last result is zero, the quotient is integer.
The multiplication of the quotient by the divisor, added to the rest if it exists, restores the dividend.
The procedure for obtaining the result, in practice, does not take place according to this method of successive subtractions which is too long. As a result, this operation is a little more delicate than the others.
We begin by looking for how many times the divisor is contained entirely in the number constituted by the digit or numbers occupying the highest ranks of the dividend.
This number constitutes the first partial dividend. The number of times the divisor is contained in this first partial divisor is the first digit assigned to the highest weight of the
du quotient.
Subsequently, the product of the divisor is subtracted by this partial quotient, the first partial dividend, and this difference (larger or equal to zero) constitutes, with the figure occupying the next weight of the dividend, the second partial dividend.
Once again, we look for how many times the divisor is contained in this second partial dividend and the product of the divisor by the second quotient is subtracted from it.
These operations are carried out until the dividend no longer has a significant number, if the last difference is equal to zero, the quotient is said to be exact (the dividend is an integer multiple of the divisor).
If it is not so, the quotient is said to be approached
and the division comprises a remainder.
Example : Let divide 405 by 3.
For convenience, the operation can be arranged as follows :
Figure 25 gives the procedure adopted to perform this division.
We are in the presence of an exact quotient (135), the last difference being equal to zero. The number 405 is a multiple of 3.
This procedure involves two operations :
-
the multiplication
-
the subtraction.
These operations are described in Chapters 5.5 and 5.3 and the corresponding tables.
These operations are easier to perform than to enumerate, because we acquired automatisms.
There is no question of calling into question these automatisms, but they sometimes forget the basic processes that we use for frequent tasks.
Reminding them, the similarity between decimal and binary operations appears better and the procedures used in digital machines will seem more familiar to you.
5. 8. - THE BINARY QUOTIENT
The path to obtain the result is identical to that of the decimal division. Therefore, we will move to an example.
The practical procedure involves two operations :
These operations are familiar to us, their tables are shown in Figure 22 and Figure 18.
Either to divide 101012 (2110)
by 112 (310).
Figure 26 shows the procedure used which is quite similar to the method used in decimal.
The division stops there, because the rest is equal to zero and there is no more digit, the dividend, to combine with the rest.
The result of the division is therefore 1112
whether 710.