Binary-Encoded data Non-Binary Data Must be Encoded into Binary Text Integers(whole numbers) Decimal numbers Alternatives(North, South, East, or West, etc. Graphics Human voice Hel→11011001
6 Binary-Encoded Data • Non-Binary Data Must be Encoded into Binary – Text – Integers (whole numbers) – Decimal numbers – Alternatives (North, South, East, or West, etc.) – Graphics – Human voice – etc. Hello 11011001…
Binary-Encoded data Some data are inherently binary 48-bit Ethernet addresses 32-bit IP addresses Need no further encoding 11001o1o OIOI0I0I 001001010100100101( C OOOO、1 I0101001010001O 0101010I01oo1o、4 1001010000010111110 01011010100101O01
7 Binary-Encoded Data • Some data are inherently binary – 48-bit Ethernet addresses – 32-bit IP addresses – Need no further encoding
Figure 3-2: Arithmetic with Binary Numbers Binary Arithmetic for Whole Numbers(Integers) (Counting Begins with 0, not 1) Integer Binary 0 012345678 10 100 101 110 111 1000 There are 10 kinds of people- those who understand binary and those who dont 8
8 Figure 3-2: Arithmetic with Binary Numbers Binary Arithmetic for Whole Numbers (Integers) (Counting Begins with 0, not 1) Integer 0 1 2 3 4 5 6 7 8 Binary 0 1 10 11 100 101 110 111 1000 “There are 10 kinds of people— those who understand binary and those who don’t
Figure 3-2: Arithmetic with Binary Numbers, Continued Binary Arithmetic for Binary Numbers Basic Rules 000 +1 十 1+0 +1+1 =1=1=10=11 9
9 Figure 3-2: Arithmetic with Binary Numbers, Continued Binary Arithmetic for Binary Numbers 1 0 0 1 1 +1 +0 +1 +0 +1 +1 =0 =1 =1 =10 =11 Basic Rules
Figure 3-2: Arithmetic with Binary Numbers, Continued Exam ples Binary Decimal 1000 8 +1 十 =1001 =9 =1010 10 =1011 十 十 100 12 10
10 Figure 3-2: Arithmetic with Binary Numbers, Continued Binary Decimal 1000 8 +1 +1 =1001 =9 +1 +1 =1010 =10 +1 +1 =1011 =11 +1 +1 =1100 =12 Examples