Binary Number System
Binary Number System
MEMORY DEVICES
A memory device is a gadget that helps you
record information and recall the information at
some later time.
MEMORY DEVICES
• Requirement of a memory device:
A memory device must have more than 1 states
(Otherwise, we can't tell the difference)
0 = single
1 = married
2 = divorced
3 = in relationship
REPRESENTING NUMBERS USING A ROW OF
SWITCHES
Example:
THE BINARY NUMBER SYSTEM
The binary number system uses 2 digits to encode a number:
• 0 = represents no value
• 1 = represents a unit value
That means that you can only use the digits 0 and 1 to write a
binary number
What is bit?
What is byte?
2016 15
BRIDGING THE DIGITAL DIVIDE
Decimal-to-
Binary
Conversion
Binary-to-Decimal
Conversion
16
WHY USE BINARY?
At the lowest level, computers are based on billions of electrical
elements that have only two states, (usually low and high voltage). By
interpreting these as 0 and 1, it’s very easy to build circuits for storing
binary numbers and doing calculations with them. While it’s possible to
simulate the behavior of decimal numbers with binary circuits as well,
it’s less efficient. If computers used decimal numbers internally, they’d
have less memory and be slower at the same level of technology.
COMMON NUMBER SYSTEMS
Used by Used in
System Base Symbols humans? computers?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa- 16 0, 1, … 9, No No
decimal A, B, … F
QUANTITIES/COUNTING (1 OF 3)
Hexa-
Decimal Binary Octal decimal
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
QUANTITIES/COUNTING (2 OF 3)
Hexa-
Decimal Binary Octal decimal
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
QUANTITIES/COUNTING (3 OF 3)
Hexa-
Decimal Binary Octal decimal
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17
CONVERSION AMONG BASES
The possibilities:
Decimal Octal
Binary Hexadecimal
QUICK EXAMPLE
Base
BINARY TO DECIMAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
1010112 => 1 x 20 = 1
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
4310
BINARY TO OCTAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
10110101112 = ?8
1 3 2 7
10110101112 = 13278
BINARY TO HEXADECIMAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
10101110112 = ?16
10 1011 1011
2 B B
10101110112 = 2BB16
OCTAL TO DECIMAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
7248 =>
4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
OCTAL TO BINARY
Decimal Octal
Binary Hexadecimal
EXAMPLE
7058 = ?2
7 0 5
7058 = 1110001012
OCTAL TO HEXADECIMAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
10768 = ?16
1 0 7 6
2 3 E
10768 = 23E16
HEXADECIMAL TO DECIMAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
Binary Hexadecimal
EXAMPLE
10AF16 = ?2
1 0 A F
10AF16 = 00010000101011112
HEXADECIMAL TO OCTAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
1F0C16 = ?8
1 F 0 C
1 7 4 1 4
1F0C16 = 174148
DECIMAL TO BINARY
Decimal Octal
Binary Hexadecimal
EXAMPLE 2 125
2 62 1
12510 = ?2 2 31 0
2 15 1
2 7 1
2 3 1
2 1 1
0 1
12510 = 11111012
DECIMAL TO OCTAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
123410 = ?8 8 1234
8 154 2
8 19 2
8 2 3
0 2
123410 = 23228
DECIMAL TO HEXADECIMAL
Decimal Octal
Binary Hexadecimal
EXAMPLE
123410 = ?16
16 1234
16 77 2
16 4 13 = D
0 4
123410 = 4D216