binary system
TRANSCRIPT
![Page 1: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/1.jpg)
Binary System
![Page 2: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/2.jpg)
Bits, Bytes, and Buzzwords
Common terms might describe file size or memory size:
Bit: smallest unit of information
Byte: a grouping of eight bits of information
K: (kilobyte); 1024 bytes equals 1K of storage.
![Page 3: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/3.jpg)
Bits, Bytes, and Buzzwords
MB: (megabyte); about 1 million bytes of information
GB: (gigabyte); about 1 billion bytes of information
TB: (terabyte); about 1 million megabytes of information
![Page 4: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/4.jpg)
• Numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ...
• Use 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
• We know that 5304 = 5*103+3*102+0*101+4*100
• Base 10
Decimal System
![Page 5: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/5.jpg)
• BINARY numbers: 0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001,
1010, 1011, .... • Written with only 2 digits: "0" and "1" • In the same way as for decimal, 1011 (binary)
= 1*23+0*22+1*21+1*20= 11 (decimal) • Base 2 • Converting from binary to decimal is simple,
just as for 1011 above.
Binary System
![Page 6: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/6.jpg)
• How to know if 1011 is in binary or in decimal? Subscripts are used to show the base: 10112 (binary number), 101110
(decimal number)
Binary System
![Page 7: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/7.jpg)
Negative Binary Integers
Decimal integer Binary integer -1 (255) 11111111 -10 (246) 11110110 -20 (236) 11101100 -30 (226) 11100010
……….. ……………
-128 (128) 10000000
From 255 to 128 are treated as negative decimal Number From -1 to 128
![Page 8: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/8.jpg)
Decimal Binary 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 11 1011
Positive Binary Integers
![Page 9: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/9.jpg)
Decimal
Binary
÷ 2 * 2
![Page 10: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/10.jpg)
(35)10 = ( … )2
17
35
4
8
÷2
÷2
÷2
÷2
1
1
0
0
1
2
÷2
÷2
1
0
(110001)2
NO
Example 1 Convert Decimal to binary
![Page 11: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/11.jpg)
Example 2 Convert Decimal to binary(45)10 = ( … )2
22
45
5
11
÷2
÷2
÷2
÷2
0
1
1
1
1
2
÷2
÷2
1
0
(101101)2
NO
![Page 12: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/12.jpg)
Example 3 Convert Decimal to binary(55)10 = ( … )2
27
55
6
13
÷2
÷2
÷2
÷2
1
1
0
1
1
3
÷2
÷2
1
1
(110111)2
NO
![Page 13: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/13.jpg)
Example 4 Convert Decimal to binary
(72)10 = ( … )2
36
72
9
18
÷2
÷2
÷2
÷2
0
0
1
0
2
4
÷2
÷2
0
0
(1001000)2
NO÷2 11
![Page 14: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/14.jpg)
Example 5 Convert Decimal to binary
(85)10 = ( … )2
42
85
10
21
÷2
÷2
÷2
÷2
0
1
0
1
2
5
÷2
÷2
0
1
(1010101)2
NO÷2 11
![Page 15: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/15.jpg)
Example 6 convert binary to decimal
( 100101)2 = (….)10
1*20+0*21+1*22+0*23+0*24+1*25
= 37
![Page 16: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/16.jpg)
Example 7 convert binary to decimal
( 111101)2 = (….)10
1*20+0*21+1*22+1*23+1*24+1*25
= 61
![Page 17: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/17.jpg)
Example 8 convert binary to decimal
( 111111)2 = (….)10
1*20+1*21+1*22+1*23+1*24+1*25
= 63
![Page 18: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/18.jpg)
Example 9 convert binary to decimal
( 1100000)2 = (….)10
0*20+0*21+0*22+0*23+0*24+1*25+1*22
= 96
![Page 19: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/19.jpg)
Example 10 convert binary to decimal
( 1101001)2 = (….)10
1*20+0*21+0*22+1*23+0*24+1*25+1*22
= 105
![Page 20: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/20.jpg)
Example 11 Convert decimal fraction into binary
(0.125)10 = ( … )2
0.250
0.125
0.50
2
2
20.50
0.250
0
1
0***
integer
1
.001
![Page 21: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/21.jpg)
Example 12 Convert decimal fraction into binary
(0.0625)10 = ( … )2
0.1250
0.0625
0.2500
2
2
20.2500
0.1250
0
0
0***
integer
0.5000
.0001
0.5000 * 2 1 1
![Page 22: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/22.jpg)
Example 13 Convert decimal fraction into binary
(0.03125)10 = ( … )2
0.06250
0.03125
0.12500
2
2
2
0.12500
0.06250
0
0
0*
*
*
integer
0.25000
.00001
0.25000 * 2 0.5000 0
0.5000 * 2 1 1
![Page 23: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/23.jpg)
Example 14 convert fraction binary to decimal
( .0001)2 = (….)10
0*2-1 + 0*2-2 +0*2-3+ 1*2-4
= 1/16 =0.0625
0.0625
![Page 24: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/24.jpg)
Example 15 convert fraction binary to decimal
( .0011)2 = (….)10
0*2-1 + 0*2-2 +1*2-3+ 1*2-4
0.0625
1875016
1
8
1.
![Page 25: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/25.jpg)
Example 16 Convert decimal into binary
(35.125)10 = ( … )2
17
35
4
8
2
2
2
2
1
1
0
0
1
2
2
2
1
0
NO
0.250 *2
0.125 *2
0.50 *2
0.50
0.250
1
integer
1
0
0
100011.001
.001
100011
![Page 26: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/26.jpg)
Example 17 Convert decimal into binary
(42.125)10 = ( … )2
21
42
5
10
2
2
2
2
1
0
1
0
1
2
2
2
1
0
NO
0.250 *2
0.125 *2
0.50 *2
0.50
0.250
1
integer
1
0
0
101010.001
.001
101010
![Page 27: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/27.jpg)
Example 18 Convert decimal into binary
(39.125)10 = ( … )2
19
39
4
9
2
2
2
2
1
1
0
1
1
2
2
2
1
0
NO
0.250 *2
0.125 *2
0.50 *2
0.50
0.250
1
integer
1
0
0
100111.001
.001
101010
![Page 28: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/28.jpg)
1 + 0 = 10 + 1 = 10 + 0 = 01 + 1 = 0 carry 1
Addition
![Page 29: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/29.jpg)
Example 19
11000 + 1100 100100
1
![Page 30: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/30.jpg)
Example 20
11000 + 1 1100 110100
1
![Page 31: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/31.jpg)
Example 21
1011000 + 111100 10010100
111
![Page 32: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/32.jpg)
Example 22
100100.000 + 1111101.001 10100001.001
111
![Page 33: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/33.jpg)
Example 23
1 100101.000 + 1111101.001 11100010.001
111
![Page 34: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/34.jpg)
1 - 1 = 0 1 - 0 = 10 - 0 = 00 - 1 = 1 borrow 1
Subtraction
![Page 35: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/35.jpg)
Ex 24
11000 - 1100 1100
borrow 1
![Page 36: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/36.jpg)
Ex 25
1111101.000 - 100100.001 1011000.111
borrow 1
![Page 37: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/37.jpg)
Ex 26
11110 - 1101 10001
borrow 1
![Page 38: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/38.jpg)
Ex 27
11111.000 - 110.001 11000.111
borrow 1
![Page 39: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/39.jpg)
1 * 0 = 00 * 1 = 00 * 0 = 01 * 1 = 1
Multiplication
![Page 40: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/40.jpg)
Example 28
11000 * 110 00000
11000 11000
1001000
![Page 41: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/41.jpg)
Example 29
11111 * 11
11111 11111
1011101
![Page 42: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/42.jpg)
1101.1 * 110.01 11011
00000 00000
1101111011
1010100.011
Example 30
![Page 43: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/43.jpg)
11111 * 11101 11111
00000 11111
1111111111
1110000011
Example 31
![Page 44: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/44.jpg)
11.1 * 1.11 111
111 111100.001
Example 32
![Page 45: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/45.jpg)
Exercises
1- Convert Decimal to binary
(25)10 = ( … )2
(80)10 = ( … )2
(59.125)10 = ( … )2
(31.0625)10 = ( … )2
(125)10 = ( … )2
![Page 46: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/46.jpg)
Exercises
2- Convert binary to Decimal
(…..)10 = ( 0.01)2
(…..)10 = ( 0.001)2
(…..)10 = ( 0.0001)2
(….)10 = ( 0.1)2
![Page 47: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/47.jpg)
Exercises
3- Convert Decimal to binary
(0.125)10 = ( … )2
(0.0625)10 = ( … )2
(0.03125)10 = ( … )2
(0.5)10 = ( … )2
![Page 48: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/48.jpg)
Exercises
4- binary addition
11011 + 111
1111001 + 111111
10001 + 100001
0.1101 + 0.101
0.010001+ 0.0101 + 0.010111
![Page 49: Binary System](https://reader033.vdocuments.mx/reader033/viewer/2022061117/5467cdf1b4af9f42298b4a30/html5/thumbnails/49.jpg)
Exercises
5- binary multiplication
11011 * 111
11001 * 11101
1001 * 1001
0.101 * 0.01
0.0111 * 0.0101