Docsity

Decimal to Binary, Octal, and Hexadecimal Conversion Tutorial, Essays (university) of Digital Logic Design and Programming

Toggle sidebar
bg1
Prepared by: Ihsan Jabbar Lecture 2: Number Base Conversion
4
Logic Design
Lecture 2
"Number Base Conversion"
A. Conversion from Decimal system to another systems (Binary,
Octal, Hexadecimal, …)
If the number has a fraction part, then the number is separated into
an integer part and fraction part and the conversion of each part
done separately.
The fraction part is multiplied by the base of the new system to give
an integer and fraction, the new fraction multiplied again to give a
new integer and new fraction. The process is continued until the
fraction becomes 0. The coefficients of a new number are obtained
from the integers.
Ex: Convert decimal to binary.
0.6875 * 2 1. 375 ( )
0.375 * 2 0. 75 ( )
0.75 * 2 1. 5 ( )
0.5 * 2 1. 0 ( )
=
Ex: Convert decimal to binary.
0.625 * 2 1. 25
0.25 * 2 0. 5
0.5 * 2 1. 0
=
pf3
pf4
pf5

Partial preview of the text

Download Decimal to Binary, Octal, and Hexadecimal Conversion Tutorial and more Essays (university) Digital Logic Design and Programming in PDF only on Docsity!

Logic Design

Lecture 2

"Number Base Conversion"

A. Conversion from Decimal system to another systems (Binary,

Octal, Hexadecimal, …)

If the number has a fraction part, then the number is separated into an integer part and fraction part and the conversion of each part done separately.

The fraction part is multiplied by the base of the new system to give an integer and fraction, the new fraction multiplied again to give a new integer and new fraction. The process is continued until the fraction becomes 0. The coefficients of a new number are obtained from the integers.

Ex: Convert decimal to binary.

0.6875 * 2 1. 375 ( )

0.375 * 2 0. 75 ( )

0.75 * 2 1. 5 ( )

0.5 * 2 1. 0 ( )

=

Ex: Convert decimal to binary.

0.625 * 2 1. 25

0.25 * 2 0. 5

0.5 * 2 1. 0

=

Ex: Convert decimal to binary.

  1. The integer part:

remainder.

6 3 0

3 1 1

1 0 1

  1. The fraction part:

0.875 * 2 1. 75

0.75 * 2 1. 5

0.5 * 2 1. 0

=

Ex: Convert decimal to.

  1. The integer part:

remainder.

2 1 0

1 0 1

  1. The fraction part:

0.8 * 2 1. 6

0.6 * 2 1. 2

0.2 * 2 0. 4

0.4 * 2 0. 8

=

  1. The fraction part:

0.879 * 16 E. 064

0.064 * 16 1. 024

0.024 * 16 0. 384

0.384 * 16 6. 144

0.144 * 16 2. 3

0.3 * 16 4. 8

0.8 * 16 C. 8

=

B. Conversion from (Binary, Octal, Hexadecimal, …) to Decimal

system.

In this conversion the following rule is used:-

Ex: Convert decimal to.

= + + + + +

= 1 + 0 + 4 + 0 +16 + 32 = 53

=

Ex: Convert decimal to.

  1. The integer part:

= + + + +

= 0 + 2 + 0 + 8 +16 = 26

  1. The fraction part:

.11 = = + = + = 0.5 + 0.25 = 0.

=

Ex: Convert decimal to.

= + + +

= 4 + 16 + 384 + 1536 = 1940

=

Ex: Convert decimal to.

= + +

= 15 + 32 + 2560 = 2607 =

Ex: Convert decimal to.

= + + + +

= 1 + 6 + 9 + 54 = 70

=