Professional Documents
Culture Documents
Rules of Binary Addition
Rules of Binary Addition
0+0=0
0+1=1
1+0=1
1+1=0,andcarry1tothenextmoresignificantbit
Forexample,
00011010+00001100=00100110 1 1
carries
0 0 0 1 1 0 1 0 =26(base10)
+ 0 0 0 0 1 1 0 0=12(base10)
0 0 1 0 0 1 1 0 =38(base10)
00010011+00111110=01010001
1 1 1 1 1
carries
0 0 0 1 0 0 1 1 =19(base10)
+ 0 0 1 1 1 1 1 0=62(base10)
0 1 0 1 0 0 0 1 =81(base10)
RulesofBinarySubtraction
00=0
01=1,andborrow1fromthenextmoresignificantbit
10=1
11=0
Forexample,
0010010100010001=00010100 0
borrows
0 0 1 10 0 1 0 1=37(base10)
0 0 0 1 0 0 0 1 =17(base10)
0 0 0 1 0 1 0 0 =20(base10)
0011001100010110=00011101
0 10 1
borrows
0 0 1 1 0 10 1 1 =51(base10)
0 0 0 1 0 1 1 0 =22(base10)
0 0 0 1 1 1 0 1 =29(base10)
RulesofBinaryMultiplication
0x0=0
0x1=0
1x0=0
1x1=1,andnocarryorborrowbits
Forexample,
0010100100000110=11110110
0 0 1 0 1 0 0 1= 41(base10)
0 0 0 0 0 1 1 0= 6(base10)
0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 1
0 0 1 0 1 0 0 1
0 0 1 1 1 1 0 1 1 0=246(base10)
0001011100000011=01000101
0 0 0 1 0 1 1 1= 23(base10)
0 0 0 0 0 0 1 1= 3(base10)
1 1 1 1 1
0 0 0 1 0 1 1 1
0 0 0 1 0 1 1 1
carries
0 0 1 0 0 0 1 0 1= 69(base10)
AnotherMethod:Binarymultiplicationisthesameasrepeatedbinaryaddition;add
themulticandtoitselfthemultipliernumberoftimes.
Forexample,
0000100000000011=00011000 1
carries
0 0 0 0 1 0 0 0= 8(base10)
0 0 0 0 1 0 0 0= 8(base10)
+ 0 0 0 0 1 0 0 0= 8(base10)
0 0 0 1 1 0 0 0=24(base10)
BinaryDivision
Binarydivisionistherepeatedprocessofsubtraction,justasindecimaldivision.
Forexample,
0010101000000110=00000111
110
) 0 0
1 1 1=
7(base10)
0 1 0= 42(base10)
0 1 1= 27(base10)
1 1 1=135(base10)
= 6(base10)
borrows
1
1
0
0 1
1
1 0
1
1
0
1 1 0
1000011100000101=00011011
101
) 1 0
1
1
1
0
0
1
1
1
1
1
0
1 1
0 1
1 0 1
1 0 1
0
5(base10)
Notes
BinaryNumberSystem
SystemDigits:0and1
Bit(shortforbinarydigit):Asinglebinarydigit
LSB(leastsignificantbit):Therightmostbit
MSB(mostsignificantbit):Theleftmostbit
UpperByte(ornybble):Therighthandbyte(ornybble)ofapair
LowerByte(ornybble):Thelefthandbyte(ornybble)ofapair
BinaryEquivalents
1Nybble(ornibble)=4bits
1Byte=2nybbles=8bits
1Kilobyte(KB)=1024bytes
1Megabyte(MB)=1024kilobytes=1,048,576bytes
1Gigabyte(GB)=1024megabytes=1,073,741,824bytes