Professional Documents
Culture Documents
Binary Math
Binary Math
Binary Arithmetic
Addition
Subtraction
Multiplication
Division
0
0
1
1
+
+
+
+
0
1
0
1
=
=
=
=
0
1
1
0,
For example,
00011010 + 00001100 = 00100110
0
+ 0
0
0
1
0
0
1
1
0
1
1
0
1
1
0
0
0
carries
= 26(base 10)
= 12(base 10)
= 38(base 10)
0
+ 0
1
0
0
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
0
carries
= 19(base 10)
= 62(base 10)
= 81(base 10)
Note: The rules of binary addition (without carries) are the same as the truths of the XOR gate.
0
0
1
1
0
1
0
1
For example,
=
=
=
=
0
1,
1
0
0
0
0
1 10
0 1
0
0
1
0
0
0
1
1
borrows
= 37(base 10)
= 17(base 10)
0 1
= 20(base 10)
0
- 0
0
0
0 10
1 1
0 1
1
0 10
0 1
1
1
1
0
borrows
= 51(base 10)
= 22(base 10)
0 1
1 1
= 29(base 10)
0
0
0
0
1
0
0
0
1
0
0
1
0
1
1
0
0
1
0
0
0
1
0
1
0
0
0
0
0
0
1
0
1
0
0
1
0
0
= 246(base 10)
0
0
0
0
0
0
1
0
0
0
1
0
1
1
1
1
=
=
1
0
0
1
0
1
1
1
0
1
0
1
1
1
1
1
1
0
0
0
0
1
1
x
x
x
x
0
1
0
1
=
=
=
=
0
0
0
1,
For example,
00101001 00000110 = 11110110
=
=
41(base 10)
6(base 10)
23(base 10)
3(base 10)
carries
69(base 10)
Note: The rules of binary multiplication are the same as the truths of the AND gate.
Another Method: Binary multiplication is the same as repeated binary addition; add the multicand to itself the
multiplier number of times.
For example,
00001000 00000011 = 00011000
0
0
+ 0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
carries
= 8(base 10)
= 8(base 10)
= 8(base 10)
= 24(base 10)
Binary Division
Binary division is the repeated process of subtraction, just as in decimal division.
For example,
00101010 00000110 = 00000111
1
7(base 10)
=
=
42(base 10)
6(base 10)
1
1
0
1
borrows
0
1
1
0
1
1
1
1
0
0
0
1
-
= 135(base 10)
=
5(base 10)
1
1
1
0
0
1
1
1
0
1
1
1
0
1
1
27(base 10)
1
0