This online calculator is designed to add subtraction as well as divide and multiply binary numbers online.
|Put LIKE||and share the link|| |
How to use this calculator: The calculator has two input fields for entering binary numbers. The first field is for the first number, the second is for the second, respectively.
Between these two fields, you need to choose which mathematical action you want to perform on them. You can add and subtract as well as multiply or divide fractional binary numbers.
You can use a period or a comma to enter a fractional binary number. After entering the numbers and choosing a mathematical operation on them, click the calculate button. And at the top of the page there will be information with the result of the calculation.
1. When adding numbers in binary the system the main thing to remember is that it has each two characters - 0 and 1. No other characters can be in it. Consequently, the addition of 2 units of 1 + 1 gives not 2, as in decimal the system , and 10, because 10 is the number following the unit in binary the system .Need to remember the simplest binary addition rules the system : 0 + 0 = 0, 1 + 0 = 0 + 1 = 1, 1 + 1 = 10. These rules are needed in order to add the numbers in binary the system in the column. As you can see, in the case of adding one to one, the unit goes to the next category. Apparently, adding zero to any binary number will not change this number.
2. Huge binary the numbers comfortably stacked in a column. Binary rules the system similar to the addition rules for addition in decimal the system .Let fold the numbers 1111 and 101. We write the number with a smaller number of bits 101 under the number 1111 - the digit of the discharge of one the numbers should be located above the digit of the same category of another the numbers . Now allowed to add these the numbers . In the first digit, 1 + 1 gives 10 - write 0 under the units in the first digit. A unit of 10 goes into the sum of the digits of the second category. In the second category, 1 + 0. Later, adding one from the first digit will also be 10. The unit moves closer to the 3rd digit, and in the second digit of the sum it will also be zero. In the third category, 1 + 1 + 1 (the unit went here!) Gives 11. In the third category, the sum will be 1, and another unit from the numbers 11 will go into the fourth category. The fourth digit has only the number 1111. 1 + 1 = 10. Thus, 1111 + 101 = 10100.
3. The considered example can be written in the column 1111 + 101 —– 10100
Lesson topic: "Arithmetic operations in positional number systems" Computer Science teacher Fedorchenko Marina ValentinovnaMOU Berezovskaya secondary school with Berezovka Taishet district Irkutsk region Let's remember with you: What is called the number system? What is called the base of the number system? What basis is the binary number system? Indicate which the numbers are written with errors and argue the answer: 1238, 30062, 12AAC0920, 1347610, What is the minimum base the number system should have, if numbers can be written in it: 10, 21, 201, 1201 Does an even binary number end? What digit ends an odd binary number?
The binary number system is similar to the usual decimal, except that instead of ten it uses base 2 and only two digits, 1 and 0. The binary system underlies the operation of computers. In binary codes, 1 and 0 are used in order to enable or disable certain processes. Like decimals, binary numbers can be added, and although there is nothing complicated, adding them at first may seem like a daunting task. Before proceeding with the addition of binary numbers, it is necessary to properly understand the concept of a numerical digit.
Draw a bit table consisting of two rows and four columns. In the binary system, base 2 is used, so instead of units, tens, hundreds and thousands in the decimal system (with base 10), the bit values in the binary system are units, deuces, fours and eights. Units will be located in the rightmost column of the table, and eights in the leftmost column.
Write a binary number on the bottom line of the table. In the binary system, only 1 < displaystyle 1> and 0 < displaystyle 0> are used to write numbers.
Consider the category of units. If this place is 0, the bit value is 0. If it is 1, the value is 1.
Consider the category of twos. If there is 0 in this category, the digit value is 0. If, in the category of two, it is 1, the digit value is 2.
Consider the category of fours. If there is 0 in this category, the digit value is 0. If in the fours category it is 1, the digit value is 4.
Consider the discharge of eights. If this digit is 0, the digit value is 0. If, however, it is 1 in the digit of eights, the digit value is 8.
Adding Binary Numbers Using Bit Values
Write the numbers in a column and add the corresponding numbers. Since two numbers add up, the sum of the individual digits can be 0, 1 or 2. If the sum is 0, write down the corresponding column 0. If the sum is 1, write 1. If the sum is 2, write down 0 and move 1 to the next column of twos.
Add up the numbers in the doubles column. When adding, it can turn out 0, 1, 2 or 3 (if you transferred 1 from the units column). If the sum is 0, write a 0 under the double in dashes. If the sum is 1, write down at the bottom of column 1. If the sum is 2, write under the bar 0 and transfer 1 to the fours column. If the sum is 3, write down 1 and transfer 1 to the fours column (3 deuces = 6 = 1 deuce and 1 four).
Add the numbers in the fours column. When adding, it can turn out 0, 1, 2 or 3 (if you transferred 1 from a column of twos). If the sum is 0, write under the line 0 in the category of fours. If the sum is 1, write down at the bottom of column 1. If the sum is 2, write under bar 0 and move 1 to the column of eights. If the sum is 3, write down 1 and transfer 1 to the column of eights (3 fours = 12 = 1 four and 1 eight).
Continue adding up the numbers in each column of digits until you get the final result. For convenience, you can remember that 0 = 0, 1 = 1, 2 = 10 and 3 = 11.
Unit transfer of binary numbers
Write the numbers in a column. Circle pairs of units (digits 1) in the category of units. Remember that the discharge of units is located on the right edge.
Consider the category of units. For each pair of digits 1, transfer 1 to the adjacent left column, which corresponds to the category of twos. If in the column of the category of units there is only one digit 1, or after the transfer of pairs there is one extra unit left, write under line 1. If all the units are in pairs or they were not at all, write at the bottom of column 0.
DIVISION OF BINARY NUMBERS
If multiplication is performed by multiple shifts and additions, then division, being the operation of inverse multiplication, is done by multiple shifts and subtractions.
(CORRECT FRACES WITHOUT WHOLE.)
When representing fixed-point numbers, division is possible if the dividend is modulo smaller than the divisor, otherwise the overflow of the bit grid will occur .
As in the case of “manual” division, the digits of the quotient when dividing numbers on the machine are determined (starting from the highest) by successively subtracting the divisor from the remainder obtained from the previous subtraction. However, here the subtraction operation is replaced by the operation of adding the remainder with a negative divisor represented in the reverse or additional code. The sign of the quotient is determined by adding modulo two codes of the signs of the dividend and divisor.
Let us first consider an example of division in the “manual” way.
Here, after each subtraction, the divisor shifts to the right with respect to the dividend. If the residue after subtraction turned out to be positive, 1 is written in the category of the quotient; if negative, zero. In practice, usually the negative remainder is not recorded, just the divider is additionally shifted one more digit to the right and subtracted from the positive remainder.
In machines, instead of shifting the divider to the right, the remainder is shifted to the left, which, in fact, does not change anything.
When dividing with restoring the remainder, the negative remainder is restored by summing with a positive divisor. The recovered residue is shifted to the left by one digit. The divisor is again subtracted from the shifted remainder. The sign of the received balance determines the number of the next category of private. The division process continues until a given number of digits is obtained, which ensures the necessary accuracy of the result.
Let's see how the previous example is solved by car.
The division process begins with a shift of the dividend to the left by one digit, after which a divider is added to it, which is presented, for example, in an additional modified code:
Obviously, when dividing with restoring the remainder in the worst case, for the formation of each category of quotient it is necessary to perform two operations: subtraction (addition in the additional or inverse code) and addition (restoration of the remainder). That is, the execution time of the division operation can be twice as long as the minimum possible.
To reduce the average execution time of the division operation, division is implemented without restoring the remainder, the algorithm of which is as follows.
1) Determine the sign by quotient modulo summation of the two contents of the sign digits of the dividend and the divisor.
2) Subtract the divisor from the dividend. If the remainder is negative, go to step 3. Otherwise, the calculation is completed (overflow has occurred).
3) Remember the remainder sign.
4) Move the remainder one digit to the left.
5) Assign the divisor a sign opposite the sign of the remainder stored in clause 2.
6) Add the shifted remainder and the divisor (taking into account the sign).
7) Assign the number to the quotient the opposite value to the remainder sign code.
8) Repeat steps 3-7 until the required accuracy of calculating the quotient is ensured.
The solution to the above example in this case is carried out according to the following scheme:
With floating point
When performing the division operation on numbers with FLOATING COMMAND, the quotient mantissa is defined as the result of dividing the divisor mantissa by the divisor mantissa, and the quotient order as a result of subtracting the divisor order code from the divisor order code, since
Division of integer non-zero n-bit (not including signed digits) numbers A: B, represented in the direct (for simplicity) code, yields an integer quotient C and an integer remainder 0, which is assigned the sign of the dividend, the sign of the quotient is calculated as the sum modulo two operands A and B.
The division is performed in the following sequence.
1) The divisor B is shifted to the left (normalized), so that there is 1 in the highest information category, the number of shifts S is calculated, the quotient of the division can be no more than (S + 1) bits that are not equal to zero.
2) A (S + 1) module division cycle is performed | A | on IB’l where B "is the normalized B, as a result there is a (S + 1) rank of private, starting with the eldest of (S + 1) junior.
3) The residue Rs + 1 obtained in the last division cycle, if positive, is shifted to the right by S digits, if Rs + 1