MICROPROCESSOR AND
INTERFACING
SUBJECT CODE: 2150707
Presented By:
Prof. Kumar Anand Singh
Deptt. Of ECE
MEFGI
Hexadecimal Addition
Decimal basic concepts:
• Decimal is base 10.
• There are 10 digits in counting (0, 1, 2, 3, 4, 5, 6, 7,
8, 9)
• When you reach 10, you carry a “1” over to the next
column
• The number after 9 is 10
Hexadecimal basic concepts:
• Hexadecimal is base 16.
• There are 16 digits in counting (0, 1, 2, 3, 4, 5, 6,
7, 8, 9, A, B, C, D, E, F)
• When you reach 16, you carry a “1” over to the
next column
• The number after F (decimal 15) is 10 in hex (or
16 in decimal)
Use the following steps to perform hexadecimal
addition:
1. Add one column at a time.
2. Convert to decimal and add the numbers.
3. If the result of step two is 16 or larger subtract the result
from 16 and carry 1 to the next column.
4. If the result of step two is less than 16, convert the
number to hexadecimal.
Example: (Use the color code in each step to see
what’s happening)
The problem:
You are to add these numbers:
A C 5 A 9
E D 6 9 4
Carry Over:
1. Add one column at a time
2. Convert to decimal & add (9 + 4 = 13)
3. Follow less than 16 rule
Decimal 13 is hexadecimal D
A C 5 A 9
E D 6 9 4
D
Carry Over: 1
1. Add next column
2. Convert to decimal & add (10 + 9 = 19)
3. Follow 16 or larger than 16 rule
(19 – 16 = 3 carry a 1)
A C 5 A 9
E D 6 9 4
3 D
Carry Over: 1
1. Add next column
2. Convert to decimal & add (1 + 5 + 6 = 12)
3. Follow less than 16 rule, convert to hex
Decimal 12 is hexadecimal C
A C 5 A 9
E D 6 9 4
C 3 D
Carry Over: 1
1. Add next column
2. Convert to decimal & add (12 + 13 = 25)
3. Follow 16 or larger than 16 rule
(25 – 16 = 9 carry a 1)
A C 5 A 9
E D 6 9 4
9 C 3 D
Carry Over: 1
1. Add next column
2. Convert and add (1 + 10 + 11 = 22)
3. Follow 16 or larger than 16 rule
(22 – 16 = 6 carry a 1)
A C 5 A 9
B D 6 9 4
6 9 C 3 D
Carry Over: 1
1. Add next column
2. Convert and add (1 + 0 + 0 = 1)
3. Follow less than 16 rule
0 A C 5 A 9
0 B D 6 9 4
1 6 9 C 3 D
F C B D 9
B A 5 0 4
Practice 1 C 3 A F
3 B 6 D F
1 A 0 8 A
D B C F 4
C C 9 A 9
F D 6 9 9
Thank You

Hexadecimal addition

  • 1.
    MICROPROCESSOR AND INTERFACING SUBJECT CODE:2150707 Presented By: Prof. Kumar Anand Singh Deptt. Of ECE MEFGI Hexadecimal Addition
  • 2.
    Decimal basic concepts: •Decimal is base 10. • There are 10 digits in counting (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) • When you reach 10, you carry a “1” over to the next column • The number after 9 is 10
  • 3.
    Hexadecimal basic concepts: •Hexadecimal is base 16. • There are 16 digits in counting (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) • When you reach 16, you carry a “1” over to the next column • The number after F (decimal 15) is 10 in hex (or 16 in decimal)
  • 4.
    Use the followingsteps to perform hexadecimal addition: 1. Add one column at a time. 2. Convert to decimal and add the numbers. 3. If the result of step two is 16 or larger subtract the result from 16 and carry 1 to the next column. 4. If the result of step two is less than 16, convert the number to hexadecimal.
  • 5.
    Example: (Use thecolor code in each step to see what’s happening) The problem: You are to add these numbers: A C 5 A 9 E D 6 9 4 Carry Over: 1. Add one column at a time 2. Convert to decimal & add (9 + 4 = 13) 3. Follow less than 16 rule Decimal 13 is hexadecimal D A C 5 A 9 E D 6 9 4 D
  • 6.
    Carry Over: 1 1.Add next column 2. Convert to decimal & add (10 + 9 = 19) 3. Follow 16 or larger than 16 rule (19 – 16 = 3 carry a 1) A C 5 A 9 E D 6 9 4 3 D Carry Over: 1 1. Add next column 2. Convert to decimal & add (1 + 5 + 6 = 12) 3. Follow less than 16 rule, convert to hex Decimal 12 is hexadecimal C A C 5 A 9 E D 6 9 4 C 3 D
  • 7.
    Carry Over: 1 1.Add next column 2. Convert to decimal & add (12 + 13 = 25) 3. Follow 16 or larger than 16 rule (25 – 16 = 9 carry a 1) A C 5 A 9 E D 6 9 4 9 C 3 D Carry Over: 1 1. Add next column 2. Convert and add (1 + 10 + 11 = 22) 3. Follow 16 or larger than 16 rule (22 – 16 = 6 carry a 1) A C 5 A 9 B D 6 9 4 6 9 C 3 D
  • 8.
    Carry Over: 1 1.Add next column 2. Convert and add (1 + 0 + 0 = 1) 3. Follow less than 16 rule 0 A C 5 A 9 0 B D 6 9 4 1 6 9 C 3 D F C B D 9 B A 5 0 4 Practice 1 C 3 A F 3 B 6 D F 1 A 0 8 A D B C F 4 C C 9 A 9 F D 6 9 9
  • 9.