Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
LOGO
DEE 1224
DIGITAL ELECTRONICS
CHAPTER 2
Number Systems and
Codes
www.company.com
Company
LOGO
TOPICS
• Number Systems
2.1 • Decimal, Binary, Octal, Hexadecimal
• Numbering Code
2.3
• Alphanumeric Code
2.4
• Signed Number
2.5
www.company.com
Company
LOGO
LEARNING OUTCOMES
www.company.com
Company
LOGO
Decimal Number
System
• Represented by 10 digits (0-9)
• Base-10 system
• Value for each digit is determined by its digit
multiplied by 10 to the power of its position.
www.company.com
Company
LOGO
Decimal Number
System
(1x100) = 110
(4x101) = 4010
(3x102) = 30010
(2x103) = 200010
234110
www.company.com
Company
LOGO
Binary Number System
www.company.com
Company
LOGO
Binary Number System
www.company.com
Company
LOGO
Binary Number System
www.company.com
Company
LOGO
Octal Number System
www.company.com
Company
LOGO
Hexadecimal Number
System
www.company.com
Company
LOGO Number Systems
www.company.com
Company
LOGO
Conversion Between
Number Systems
1. Conversions to 3. Binary conversions
decimal i. Binary to Octal
i. Binary to Decimal ii. Binary to Hex
ii. Octal to Decimal 4. Octal conversions
iii. Hex to Decimal i. Octal to Binary
2. Decimal 5. Hex conversions
conversions i. Hex to Binary
i. Decimal to Binary
ii. Decimal to Octal
iii. Decimal to Hex
www.company.com
Company
LOGO
Conversions to
Decimal
From binary, octal and hexadecimal
www.company.com
Company
LOGO
Binary to Decimal
(11101)2
= 2 +2 +2 +0+2
4 3 2 0
= 16 + 8 + 4 + 1
= (29)10
www.company.com
Company
LOGO
Octal to Decimal
(362)8
= 3´ 8 + 6 ´ 8 + 2 ´ 8
2 1 0
= 192 + 48 + 2
= (242)10
www.company.com
Company
LOGO
Hexadecimal to
Decimal
(19B)16
= 1´ 16 + 9 ´ 16 + 11´ 16
2 1 0
= 256 + 144 + 11
= (411)10
www.company.com
Company
LOGO
Try These…..
www.company.com
Company
LOGO
Decimal
Conversions
From decimal to binary, octal and
hexadecimal using Repeated Division
www.company.com
Company
LOGO
Decimal to Binary
LSB
50 2 0
25 2 1
12 2 0
6 2 0
3 2 1
1 1
MSB
= 1 1 0 0 1 0 2
www.company.com
Company
LOGO
Decimal to Octal
50 8 2
6 6
= 6 2 8
www.company.com
Company
LOGO
Decimal to
Hexadecimal
50 16 2
3 3
= 3 2 16
www.company.com
Company
LOGO
Try this
www.company.com
Company
LOGO
Binary
Conversions
Converting Binary number to Octal or
Hexadecimal by grouping the number of
bits.
www.company.com
Company
LOGO
Binary to Octal
3 7 2 = 3728
www.company.com
Company
LOGO
Binary to Hexadecimal
2 A F = 2AF16
www.company.com
Company
LOGO
Try these
www.company.com
Company
LOGO
Octal to Binary
Octal 0 1 2 3 4 5 6 7
3 7 2 = 3728
www.company.com
Company
LOGO
Hexadecimal to Binary
Hex 0 1 2 3 4 5 6 7 8 9 A B C D E F
Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
2 A F = 2AF16
www.company.com
Company
LOGO
Try these
www.company.com
Company
LOGO
Arithmetic
Operations of the
Number Systems
How we perform arithmetic operations for
Binary, Octal and Hexadecimal Numbers.
www.company.com
Company
LOGO
Binary Addition
Carry Carry
1 1
e.g: 11+1 0 1 1
+ 0 0 1
1 0 0
www.company.com
Company
LOGO
Binary Subtraction
Borrow
0 1
e.g: 101-011 1 0 1
- 0 1 1
0 1 0
www.company.com
Company
LOGO
Binary Multiplication
e.g: 101x111 1 1 1
x 1 0 1
1 1 1
Partial
0 0 0
products
+ 1 1 1
1 0 0 0 1 1
www.company.com
Company
LOGO
Binary division
e.g: 110/11 1 0
1 1 1 1 0
1 1
0 0 0
www.company.com
Company
LOGO
Octal Addition
Carry Carry
e.g: (165)8+(143)8 1 1
1 6 5
+ 1 4 3
3 3 0
www.company.com
Company
LOGO
Octal Subtraction
Borrow
e.g: (137)8-(64)8 0 1
1 3 7
- 0 6 4
0 5 3
www.company.com
Company
LOGO
Hexadecimal Addition
Carry
e.g: (A10)16+(1F2)16 1
A 1 0
+ 1 F 2
C 0 2
www.company.com
Company
LOGO
Hexadecimal
Subtraction
Borrow
e.g: (137)16-(B4)16 0 1
1 3 7
- 0 B 4
0 8 3
www.company.com
Company
LOGO
www.company.com
Company
LOGO
Numbering Code
BCD, Gray Code, Alphanumeric Code
www.company.com
Company
LOGO
Code and Encode
Numbers,
letters or Encode Code
words
www.company.com
Company
LOGO
Binary-Coded-Decimal
(BCD) Code
www.company.com
Company
LOGO
BCD Code
www.company.com
Company
LOGO
BCD Code
www.company.com
Decimal
Company Binary Octal Hex BCD
LOGO
0 0000 0 0 0000
1 0001 1 1 0001
2 0010 2 2 0010
3 0011 3 3 0011
4 0100 4 4 0100
5 0101 5 5 0101
6 0110 6 6 0110
7 0111 7 7 0111
8 1000 10 8 1000
9 1001 11 9 1001
10 1010 12 A 0001 0000
11 1011 13 B 0001 0001
12 1100 14 C 0001 0010
13 1101 15 D 0001 0011
14 1110 16 E 0001 0100
15 1111 17 F 0001 0101
www.company.com
Company
LOGO
BCD Code
Binary BCD
• number system • not a number system
www.company.com
Company
LOGO
BCD Code
Decimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
www.company.com
Company
LOGO
Try these…
www.company.com
Company
LOGO
Gray Code
www.company.com
Company
LOGO
Gray Code
DECIMAL BINARY GRAY CODE
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
www.company.com
Company
LOGO
Gray Code Conversion
www.company.com
Company
LOGO
Try this..
www.company.com
Company
LOGO
Gray Code Application
An eight-position,
three-bit shaft
encoder
www.company.com
Company
LOGO
Alphanumeric Codes
www.company.com
Company
LOGO
ASCII – American Standard Code
for Information Interchange
www.company.com
Company
LOGO
Alphanumeric Codes
Signed Number
Handling positive and negative numbers of
binary numbers.
www.company.com
Company
LOGO
Representation of
Signed Numbers
www.company.com
Company
LOGO
Sign-Magnitude
www.company.com
Company
LOGO
Sign-magnitude
0 0 1 0 1 1 0 0
Sign bit (+)
Magnitude = 4410
1 0 1 0 1 1 0 0
Sign bit (-)
Magnitude = -4410
www.company.com
Company
LOGO
1’s complement
0 0 1 0 1 1 0 0
1 1 0 1 0 0 1 1
www.company.com
Company
LOGO
1’s complement
www.company.com
Company
LOGO
2’s complement
www.company.com
Company
LOGO
2’s complement
A
Binary number 0 0 1 0 1 1 0 0
1's complement form 1 1 0 1 0 0 1 1 B
+1
2's complement form 1 1 0 1 0 1 0 0
www.company.com
Company
LOGO
Signed Numbers
www.company.com
Company
LOGO
Arithmetic Operations with Signed Numbers
Examples:
00011110 = +30 00001110 = +14 11111111 = -1
00001111 = +15 11101111 = -17 11111000 = -8
00101101= +45 11111101 = -3 1 11110111 = -9
Discard carry
Floyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All
Rights Reserved www.company.com
Company
LOGO
Arithmetic Operations with Signed Numbers
Floyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All
Rights Reserved www.company.com
Company
LOGO
Any question?
www.company.com