Professional Documents
Culture Documents
Lecture2 Chapter1 - Number Base Conversions, Binary Arithmetic, and Determine Unknown Radix
Lecture2 Chapter1 - Number Base Conversions, Binary Arithmetic, and Determine Unknown Radix
Lecture2 Chapter1 - Number Base Conversions, Binary Arithmetic, and Determine Unknown Radix
Numbers
Lecture2- Number Base Conversions, Binary
Arithmetic and Determine Unknown Radix
Engr. Arshad Nazir, Asst Prof
Dept of Electrical Engineering
EE-221 Digital Logic Design Fall 2023 SEECS 1
Objectives
• Study Number Base Conversions
• Perform Binary Arithmetic
• Determine Unknown Radix
Hexadecimal
(base16)
EE-221 Digital Logic Design Fall 2023 5
Conversion Between Bases
Decimal
Binary, Octal,
Others
Hexadecimal
EE-221 Digital Logic Design Fall 2023 6
Decimal-r Conversion
• Conversion of a number in base r to decimal is done by expanding the number in a
power series and adding all the terms.
• For example, (C34D)16 is converted to decimal:
12 X 163 + 3 X 162 + 4 X 161 + 13 X 160 = (49997)10
• (11010.11)2 is converted to decimal:
1 X 24 + 1 X 23 + 0 X 22 + 1 X 21 + 0 X 20 + 1 X 2-1 + 1 X 2-2 = (26.757)10
• In general N=(Number)r = ( i = n −1
i =0
ai • r +
i
) (
j = −1
aj • r j
j =− m
)
Integer +Fractional
13/2 = 6 + ½ a0 = 1
6/2 = 3 + 0 a1 = 0
3/2 = 1 + ½ a2 = 1
1/2 = 0 + ½ a3 = 1
(37)10 = 1001012
(422)10 = (1A6)16
Carry in (Z) of 1: Z 1 1 1 1
X 0 0 1 1
+Y +0 +1 +0 +1
CS 01 10 10 11