0% found this document useful (0 votes)
9 views33 pages

Lecture1 Chapter1- Number Base Conversions, Binary Arithmetic, and Determine Unknown Radix

The document covers the fundamentals of digital systems, focusing on number base conversions, binary arithmetic, and determining unknown radices. It includes methods for converting between various number systems such as binary, decimal, octal, and hexadecimal, along with examples of arithmetic operations in different bases. Additionally, it provides exercises for practice and solutions to demonstrate the concepts discussed.

Uploaded by

liabamurtaza005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views33 pages

Lecture1 Chapter1- Number Base Conversions, Binary Arithmetic, and Determine Unknown Radix

The document covers the fundamentals of digital systems, focusing on number base conversions, binary arithmetic, and determining unknown radices. It includes methods for converting between various number systems such as binary, decimal, octal, and hexadecimal, along with examples of arithmetic operations in different bases. Additionally, it provides exercises for practice and solutions to demonstrate the concepts discussed.

Uploaded by

liabamurtaza005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Chapter1: Digital Systems and Binary

Numbers
Lecture1- Number Base Conversions, Binary Arithmetic and
Determine Unknown Radix
Engr. Arshad Nazir, Asst Prof
Dept of Electrical Engineering
EE-223 Digital Logic Design Spring 2025 SEECS 1
Objectives
• Study Number Base Conversions
• Perform Binary Arithmetic
• Determine Unknown Radix

EE-223 Digital Logic Design Spring 2025 2


EE-223 Digital Logic Design Spring 2025 3
EE-223 Digital Logic Design Spring 2025 4
EE-223 Digital Logic Design Spring 2025 5
Conversion between bases
• To convert from one base to other:
➢Convert the integer portion
➢Convert the fraction portion
➢Join the two with radix point
Octal (base 8)

Binary (base 2) Decimal (base 10)

Hexadecimal
(base16)
EE-223 Digital Logic Design Spring 2025 6
EE-223 Digital Logic Design Spring 2025 7
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.75
• In general N=(Number)r =
( i = n −1
i =0
ai • r i + ) ( j = −1
j =− m
a j • r j
)
(Integer Portion) + (Fraction Portion)

EE-223 Digital Logic Design Spring 2025 8


Decimal-r Conversion
• If a decimal number has a radix point, it is necessary to separate the
number into an integer part and a fraction part.
• The conversion of a decimal integer into a number in base-r is done by
dividing the number and all successive quotients by r and accumulating
the remainders in reverse order of computation.
• For example, to convert decimal 13 to binary:
Integer Remainder Coefficient
Quotient

13/2 = 6 + ½ a0 = 1
6/2 = 3 + 0 a1 = 0
3/2 = 1 + ½ a2 = 1
1/2 = 0 + ½ a3 = 1

Answer (13)10 = (a3 a2 a1 a0)2 = (1101)2

EE-223 Digital Logic Design Spring 2025 9


Decimal to Binary Conversion

EE-223 Digital Logic Design Spring 2025 10


Decimal to Binary Conversion Example
• Convert (37)10 to binary

(37)10 = 1001012

EE-223 Digital Logic Design Spring 2025 11


Decimal-r Conversion (Converting
Fractions)
• To convert the fraction portion repeatedly multiply the fraction by the
radix and save the integer digits that result. The process continued until
the fraction becomes 0 or the number of digits have sufficient accuracy.
The new radix fraction digits are the integer digits in computed order.
• For example, convert fraction (0.6875)10 to base 2
0.6875 * 2 = 1.3750 integer = 1
0.3750 * 2 = 0.7500 integer = 0
0.7500 * 2 = 1.5000 integer = 1
0.5000 * 2 = 1.0000 integer = 1
Answer = (0.1011)2

EE-223 Digital Logic Design Spring 2025 12


Converting Fractions Cont…
• When converting fractions, we must use multiplication rather than
division. The new radix fraction digits are the integer digits in
computed order.

EE-223 Digital Logic Design Spring 2025 13


Another example:
• Convert 0.8125 decimal to binary.
➢ To convert the decimal 0.8125
to binary, we multiply by the
radix 2.
➢ (0.1101)2

EE-223 Digital Logic Design Spring 2025 14


Decimal to Octal Conversion
• In converting decimal to octal we must divide integer part by 8 till
quotient becomes lesser than divisor.

EE-223 Digital Logic Design Spring 2025 15


Converting Fractions (Decimal to Octal)
• Decimal to Octal fraction conversion takes the same approach but it
multiplies by the base 8.

EE-223 Digital Logic Design Spring 2025 16


Converting Decimal to Hexadecimal
• The conversion of a decimal integer into hexadecimal is done by
dividing the number and all successive quotients by 16 and
accumulating the remainders in reverse order of computation.

(422)10 = (1A6)16

EE-223 Digital Logic Design Spring 2025 17


Binary, Octal and Hexadecimal
• Conversions between binary, octal and hexadecimal have an easier
conversion method.
➢Each octal digit represents 3 binary digits.
➢Each hexadecimal digit represents 4 binary digits.

EE-223 Digital Logic Design Spring 2025 18


Binary to Octal and back
• Binary to Octal:
➢Group the binary digits into three-bit groups starting at the radix
point and going both ways, padding with zeros as needed (at the
ends).
➢Convert each group of three bits to an equivalent octal digit.
• Octal to Binary:
➢It is done by reversing the preceding procedure
➢Restate the octal as three binary digits
➢Start at the radix point and go both ways, padding with zeros as
needed.

EE-223 Digital Logic Design Spring 2025 19


Examples
• Convert (10110001101011.11110000011)2 to Octal
= 010 110 001 101 011 . 111 100 000 110
= 2 6 1 5 3 . 7 4 0 6
= (26153.7406)8
• Convert (673.124)8 to binary
= 110 111 011 . 001 010 100
= (110111011.001010100)2
• Convert (11010100011011) 2
to Octal

EE-223 Digital Logic Design Spring 2025 20


Binary to Hexadecimal and back
• Binary to Hexadecimal:
➢Group the binary digits into four-bit groups starting at the radix
point and going both ways, padding with zeros as needed (at the
ends)
➢Convert each group of four bits to an equivalent hexadecimal digit
• Hexadecimal to Binary:
➢It is done by reversing the preceding procedure
➢Restate the hexadecimal as four binary digits
➢Start at the radix point and go both ways, padding with zeros as
needed

EE-223 Digital Logic Design Spring 2025 21


Examples
• Convert (10110001101011.11110010)2 to hexadecimal
= 0010 1100 0110 1011 . 1111 0010
= 2 C 6 B . F 2
= (2C6B.F2)16
• Convert (306.D)16 to binary
= 0011 0000 0110. 1101
= (001100000110.1101)2
• Convert (11010100011011) 2 to hexadecimal

EE-223 Digital Logic Design Spring 2025 22


Your Turn
• Convert (757.25)10 to Binary, Octal, Hexadecimal, and Base6.
• Find Decimal Equivalent of the following:-
➢ (1011.11)2
➢ (147.3)8
➢ (A2F)16
➢(3301.13)6
• Convert (231.3)4 to Base7
• Convert (175.6)8 to Hexadecimal

EE-223 Digital Logic Design Spring 2025 23


Solution
• Convert (757.25)10 = (1011110101.01)2
= (1365.2)8
= (2F5.4)16
= (3301.13)6
• Decimal Equivalent is:-
➢ (1011.11)2 = (11.75)10
➢ (147.3)8 = (103.375)10
➢ (A2F)16 =(2607)10
➢(3301.13)6 =(757.25)10
• Convert (231.3)4 =(63.5151…)7
• Convert (175.6)8 = (7D.C)8
EE-223 Digital Logic Design Spring 2025 24
Base-r Arithmetic
• Arithmetic operations with numbers in base r follow the same rules as
for decimal numbers.
• When a base other than 10 is used, one must remember to use only
the r-allowable digits.
• The following are some examples:

EE-223 Digital Logic Design Spring 2025 25


Arithmetic Rules
• The sum of two digits are calculated as expected but the digits of the
sum can only be from the r-allowable coefficients.
• Any carry in a sum is passed to the next significant digits to be
summed.
• In subtraction the rules are the same but a borrow adds r (where r is
the base) to the minuend digit.
• The examples of addition and subtraction of binary numbers are
presented in the next slides.

EE-223 Digital Logic Design Spring 2025 26


Binary Addition Rules
Given two binary digits (X,Y), a carry in (Z) we get
the following sum (S) and carry (C):
Carry in (Z) of 0: Z 0 0 0 0
X 0 0 1 1
+Y +0 +1 +0 +1
CS 00 01 01 10

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

EE-223 Digital Logic Design Spring 2025 27


Binary Multiplication
• Multiplication table
0x0=0
0x1=0
1x0=0
1x1=1
1 0
1 1 1
X 1
0 1 0
-----------------------
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0
EE-223 Digital Logic Design Spring 2025 28
Binary Division
• Binary division is similar to decimal division

EE-223 Digital Logic Design Spring 2025 29


Determine Unknown Radix
Example: Determine the base of the number for the following operation to
be correct
54/4=13
Solution: Both sides of the given expression carry unknown radices that we
must determine. Convert both sides into decimal as we have learned
previously
5xr1+4xr0/4xr0=1xr1+3xr0
=5r+4/4=r+3
=5r+4=4r+12
Simplification gives
r=8
After you substitute r=8 in the given expression LHS=RHS. So the
required radix is 8.

EE-223 Digital Logic Design Spring 2025 30


Your Turn
Example: Determine the unknown radix for the following
operation to be correct
(365)r =(194)10

EE-223 Digital Logic Design Spring 2025 31


Solution
LHS of the given expression carries unknown radix that we must determine
whereas RHS is known here. Convert LHS into decimal as we have learned
previously
3xr2+6xr1+5xr0=194
=3r2+6r1-189=0
Simplification gives
r=7 & r=-9 ; Discard r=-9 since radix can’t be –ve.
After you substitute r=7 in the given expression LHS=RHS. So the required
radix is 7.

EE-223 Digital Logic Design Spring 2025 32


The End

EE-223 Digital Logic Design Spring 2025 33

You might also like