Binary Introduction

Download Report

Transcript Binary Introduction

Chabot College
ELEC 99.05
Binary Introduction
CISCO NETWORKING ACADEMY
Binary and Computing
• To make it easier to work with a computer’s
states of “on” and “off,” we use a numbering
system that only has two possible values.
• This numbering system is called “base 2,” or
“binary.”
CISCO NETWORKING ACADEMY
Binary Numbering System
In the binary numbering system, each digit
has two possible values:
0 or 1
CISCO NETWORKING ACADEMY
One Bit
Therefore, with 1 digit or “bit”,
we can have two possible combinations:
0
1
1 bit: 21 = 2 values
CISCO NETWORKING ACADEMY
Two Bits
With 2 digits or “bits”, we can have four possible
combinations:
0
0
0
1
1
0
1
1
2 bits: 22 = 4 values
CISCO NETWORKING ACADEMY
Three Bits
3 bits: 23 = 8 possible values :
CISCO NETWORKING ACADEMY
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
1 - 8 Bits
1 bit:
2 bits:
3 bits:
4 bits:
5 bits:
6 bits:
7 bits:
8 bits:
21 = 2 possible values
22 = 4 possible values
23 = 8 possible values
24 = 16 possible values
25 = ?
26 = ?
27 = ?
28 = ?
CISCO NETWORKING ACADEMY
Binary Numbering System
Each value is a binary digit, or bit for short.
01111000
Eight bits together make a unit called a byte.
In IP addresses, bytes are called octets
(group of eight).
CISCO NETWORKING ACADEMY
Not exactly…
• Eight bits together make a unit called a byte,
BUT…
• Seven bits grouped together are also,
sometimes, referred to as a byte.
Example: 7-bit ASCII characters.
• “Octet” is used to be unambiguous.
CISCO NETWORKING ACADEMY
Special Binary Values
Bits
Values
Use/Signpost
4
24 = 16
Hex numbers (0 - F)
7
27 = 128
ASCII characters
8 (byte)
28 = 256
“octet”, extended ASCII
10
210 = 1,024
“K”, “kilo” thousand
16 (2 bytes)
216 = 65,536
64“K”
20
220 = 1,024K
“meg” (210 x 210) million
24 (3 bytes)
224 = 16,384K
“16 megs”(24 x 210 x 210)
30
230
“gig”(210 x 210 x 210) billion
CISCO NETWORKING ACADEMY
Binary Numbering System
In decimal, each place value is a power of
ten.
103
102
101
100
1000
100
10
1
2
3
4
2
We read the number 2342 as
two-thousand three-hundred forty-two.
CISCO NETWORKING ACADEMY
Binary Numbering System
In binary, each place value is a power of two.
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
1
1
0
0
1
1
1
1
The byte 11001111 is equivalent to 207 in
decimal.
CISCO NETWORKING ACADEMY
Practice Slide
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
?
?
?
?
?
?
?
?
CISCO NETWORKING ACADEMY
Binary Blitz Contest
Gameplay: You are blue and the
computer is red.
Click START. A random target
number from 1 to 255 will be
displayed at the right.
Use the mouse to toggle the blue zeros and ones until
they are the binary equivalent of the decimal number
target.
Show your screen to the instructor for bonus credit
when your score = 10. Double credit for score > 20.
Get Binary Blitz free at http://ganns.com
CISCO NETWORKING ACADEMY