• No results found

Decimal to Other Three (Base =2, 8, 16, etc.)

N/A
N/A
Protected

Academic year: 2022

Share "Decimal to Other Three (Base =2, 8, 16, etc.) "

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

Number Systems

(2)

Conversion Among Bases (Fraction)

• The possibilities: 12

Hexadecimal

Decimal Octal

Binary

(3)

Decimal to Other Three (Base =2, 8, 16, etc.)

Technique

Multiply the fraction with the base and Accumulate the Integers

If fraction is zero --- stop

If fraction is not zero after many multiplication, If the digits are repeating,

Use bar notation

If the digits are not repeating and non-terminating, Mention digits based on accuracy

After completion-

First integer is MSB in fraction

Last integer is LSB in fraction

(4)

Decimal to Other Three (Base =2, 8, 16)

(0.625)

10

= (?)

2

= (?)

8

= (?)

16

Integer

0.625*2 = 1.250 1 MSB

0.25*2 = 0.5 0

0.5*2 = 1.0 1 LSB

(0.625)10 = (0.101)2

In this example, the fraction becomes zero.

(5)

Decimal to Other Three (Base =2, 8, 16)

(0.479)10 = (?)8

Integer

0.479*8 = 3.832 3 MSD

0.832*8 = 6.656 6 0.656*8 = 5.248 5 0.248*8 = 1.984 1

….….

(0.479)10 = (0.3651…)8

In this example, the fraction is non-terminating and non- repeating .

(6)

Decimal to Other Three (Base =2, 8, 16)

(0.479)10 = (?)16

Integer

0.479*16 = 7.664 7 MSD

0.664*16 = 10.624 10(A) 0.624*16 = 9.984 9

0.984*16 = 15.744 15(F)

….….

(0.479)10 = (0.7A9F…)16

In this example, the fraction is non-terminating and non- repeating .

(7)

Decimal to Binary

𝐴 = 0.000110011

(0.1)10 = (?)2

In this example, fraction is non-terminating and repeating .

(8)

Other (Base =2, 8, 16 etc.) to Decimal

Technique

– Multiply each bit by (base) -m, where m is the “weight” of the fraction bit

– The weight is the position of the fraction bit (after point), starting from -1 and decreasing on the right

– Add the partial results

(9)

Other (Base =2, 8, 16) to Decimal

(0.10101)

2

=1 x 2

-1

= 0.5 0 x 2

-2

= 0.0

1 x 2

-3

= 0.125 0 x 2

-4

= 0.0

1 x 2

-5

= 0.03125

= (0.65625)

10

(10)

Other (Base =2, 8, 16) to Decimal

(0.703)

8

= 7 x 8

-1

= 0.875 0 x 8

-2

= 0.0

3 x 8

-3

= 0.005859375

=(0.880859375)

10

(11)

Other (Base =2, 8, 16) to Decimal

(0.F21)16 = 15 x 16-1 = 0.9375

2 x 16-2 = 0.0078125

1 x 16-3 = 0.000244140625

= (0.944869140625)10

(12)

Octal to Binary (Fraction)

Hexadecimal

Decimal Octal

Binary

(13)

Octal to Binary

•Technique

Replace each octal digit by a 3-bit binary equivalent representation.

OR Convert to decimal number

Convert decimal number to binary.

Example:

(657.137)8 =(110 101 111 . 001 011 111)2

(14)

Binary to Octal

Hexadecimal

Decimal Octal

Binary

(15)

Binary to Octal

Technique

➢Group bits in threes

For integer, form groups from right to left For Fraction, form groups from left to right

➢Replace each group by its corresponding octal digit

Example:

(10101.11011)2 = (010 101.110110)2

= (25.66)8

(16)

Hexadecimal to Binary

Hexadecimal

Decimal Octal

Binary

(17)

Hexadecimal to Binary

•Technique

Replace each hexadecimal digit by a 4-bit binary equivalent representation OR

Convert to decimal number

Convert decimal number to binary

Example:

(AB5.1A3)16 =(1010 1011 0101 . 0001 1010 0011)2

(18)

Binary to Hexadecimal

Hexadecimal

Decimal Octal

Binary

(19)

Binary to Hexadecimal

Technique

Form groups consisting of four bits

For integer, form groups from right to left

For Fraction, make groups from left to right

Convert each group of four bits by its corresponding hexadecimal digits

Example:

(10101.11011)2 = (0001 0101.11011000)2

= (15.D8)16

(20)

Octal to Hexadecimal

Hexadecimal

Decimal Octal

Binary

(21)

Octal to Hexadecimal

Technique

Use binary as an intermediary Octal to Binary

Binary to Hexadecimal Example-

(657.137)8 = (110 101 111 . 001 011 111)2

= (110101111 .001011111)2

= (0001 1010 1111 .0010 1111 1000)2

= (1A F .2F8)16

(22)

Hexadecimal to Octal

Hexadecimal

Decimal Octal

Binary

(23)

Hexadecimal to Octal

•Technique

Use binary as an intermediary Hexadecimal to Binary Binary to Octal

Example-

(6A57.1B37)16 = (0110 1010 0101 0111 . 0001 1011 0011 0111)2

= (0110101001010111. 0001101100110111)2

= (0 110 101001 010 111. 000 110 110011011 100)2

= (6 5 1 2 7 . 0 6 6 3 3 4)

8

(24)

Exercise – Integer + Fraction

Decimal Binary Octal Hexadecimal 29.8

101.1101

3.07

C.82

Problem

(25)

Exercise – Convert …

Decimal Binary Octal Hexadecimal 29.8 11101.110011… 35.63… 1D.CC…

101.1101

3.07

C.82

Answer

(26)

Exercise – Convert …

Decimal Binary Octal

Hexadecimal

29.8 11101.110011… 35.63… 1D.CC…

5.8125 101.1101 5.64 5.D

3.07

C.82

Answer

(27)

Exercise – Convert …

Decimal Binary Octal

Hexadecimal

29.8 11101.110011… 35.63… 1D.CC…

5.8125 101.1101 5.64 5.D

3.109375 11.000111 3.07 3.1C C.82

Answer

(28)

Exercise – Convert …

Decimal Binary Octal Hexadecimal 29.8 11101.110011… 35.63… 1D.CC…

5.8125 101.1101 5.64 5.D

3.109375 11.000111 3.07 3.1C 12.5078125 1100.10000010 14.404 C.82

Answer

References

Related documents

❖ Decimal values of negative numbers are determined by assigning a negative value to the weight of the sign bit, summing all the weights where there are 1s, and adding 1 to

➢ Binary coded decimal means that each decimal digit, 0 through 9, is represented by a binary code of four bits.. ➢ The 8421 code is the predominant BCD code, and when we refer to

A number which can neither be expressed as a terminating decimal nor as a repeating decimal is called an irrational number, For

Write all the three-digit numbers where the digit in the hundreds place is 3 times in the digit the units place and the digit in the tens place is 2 times the digit in the ones

Write all the three-digit numbers where the digit in the hundreds place is 3 times in the digit the units place and the digit in the tens place is 2 times the digit in the ones

The comprehensive introduction giving a brief overview of D.D.C., explaining its conceptual framework, notational pattern, principle of hierarchy, explanation of different notes

The accumulation of partial products generated using single digit multipliers is done by an array of multi-operand BCD adders for an (n-digit x n-digit) multiplication..

This include simulation results of Double Digit Decimal Multiplier, BCD digit multiplier, fixed point multiplier using RPS algorithm, parallel decimal fixed point multipliers,