Binary Arithmetic
BINARY ARITHMETIC
The arithmetic
operations—addition, subtraction, multiplication and division, performed on the
binary numbers is called binary
arithmetic. In computer, the basic arithmetic operations performed on the
binary numbers is—
·
Binary
addition, and
·
Binary subtraction.
In the following subsections, we
discuss the binary addition and the binary subtraction operations.
Binary Addition
Binary addition involves addition
of two or more binary numbers. The binary
addition rules are used while performing the binary addition. Table1 shows the binary addition rules.
Binary Addition Rules 2-Input |
Binary addition of three inputs
follows the rule shown in Table 2.
Binary Addition Rules 3-Input |
Addition of the binary numbers
involves the following steps—
1. Start addition by adding the bits in unit column
(the right-most column). Use the rules of
binary addition.
2. The result of adding bits of a column is a sum
with or without a carry.
3. Write the sum in the result of that column.
4. If a carry is present, the carry is carried-over
to the addition of the next left column.
5. Repeat
steps 2–4 for each column, i.e., the tens column, hundreds column and so on.
Let us now understand binary
addition with the help of some examples.
Example 1: Add 10 and 01. Verify the answer with the help of
decimal addition.
When we add 0 and 1 in the unit
column, sum is 1 and there is no carry. The sum 1 is written in the unit column
of the result. In the tens column, we add 1 and 0 to get the sum 1. There is no
carry. The sum 1 is written in the tens column of the result.
Example 2: Add 01 and 11. Verify the answer with the help of
decimal addition.
When we add 1 and 1 in the unit
column, sum is 0 and carry is 1. The sum 0 is written in the unit column of the
result. The carry is carried-over to the next column, i.e., the tens column. In
the tens column, we add 0, 1 and the carried-over 1, to get sum 0 and carry 1.
The sum 0 is written in the tens column of the result. The carry 1 is
carried-over to the hundreds column. In the hundreds column, the result is 1.
Example 3: Add 11 and 11. Verify the answer with the help of
decimal addition.
Example 4: Add 1101 and 1111. Verify the answer with the help of
decimal addition.
Example 5: Add 10111, 11100 and 11. Verify the answer with the help
of decimal addition.
Binary Subtraction
Binary subtraction involves
subtracting of two binary numbers. The binary
subtraction rules are used while performing the binary subtraction. The
binary subtraction rules are shown in Table 3, where “Input 2” is subtracted from
“Input 1.”
Binary Subtraction Rules |
The steps for performing
subtraction of the binary numbers are as follows—
1.
Start subtraction by subtracting the bit in the
lower row from the upper row, in the unit
column.
2.
Use the binary subtraction rules. If the bit in
the upper row is less than lower row, borrow 1 from the upper row of the next
column (on the left side). The result of subtracting two bits is the difference.
3.
Write the difference
in the result of that column.
4.
Repeat steps 2 and 3 for each column, i.e., the
tens column, hundreds column and so on.
Let us now understand binary
subtraction with the help of some examples.
Example 1: Subtract 01 from 11. Verify the answer with the help of
decimal subtraction.
When we subtract 1 from 1 in the
unit column, the difference is 0. Write the difference in the unit column of
the result. In the tens column, subtract 0 from 1 to get the difference 1.
Write the difference in the tens column of the result.
Example 2: Subtract 01 from 10. Verify the answer with the help of
decimal subtraction.
When we subtract 1 from 0 in the
unit column, we have to borrow 1 from the left column since 0 is less than 1.
After borrowing from the left column, 0 in the unit column becomes 10, and, 1
in the left column becomes 0. We perform 10-1 to get the difference 1. We write
the difference in the unit column of the result. In the tens column, subtract 0
from 0 to get the difference 0. We write the difference 0 in the tens column of
the result.
Example 3: Subtract 0111 from 1110. Verify the answer with the help
of decimal subtraction.
When we do 0–1 in the unit column,
we have to borrow 1 from the left column since 0 is less than 1. After
borrowing from the left column, 0 in the unit column becomes 10, and, 1 in the
left column becomes 0. We perform 10-1 to get the difference 1. We write the
difference in the unit column of the result. In the tens column, when we do
0-1, we again borrow 1 from the left column. We perform 10-1 to get the
difference 1. We write the difference in the tens column of the result. In the
hundreds column, when we do 0-1, we again borrow 1 from the left column. We
perform 10-1 to get the difference 1. We write the difference in the hundreds
column of the result. In the thousands column, 0–0 is 0. We write the
difference 0 in the thousands column of the result.
Example 4: Subtract 100110 from 110001. Verify the answer with the
help of decimal subtraction.
Casino site review - LuckyClub
ReplyDeleteRead luckyclub.live Casino site review - Online gambling in India - Safe & Secure online casinos The casino features a very popular welcome bonus. The casino was founded Rating: 4.9 · Review by LuckyClub