NUMBER SYSTEM CONVERTING, Exercises of Digital Systems Design

CONVERTING NUMBER SYSTEM BASE SYSTEM

Typology: Exercises

2017/2018

Uploaded on 03/12/2018

meet-my-pakistan
meet-my-pakistan ๐Ÿ‡ต๐Ÿ‡ฐ

5

(2)

2 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
3/10/2018 Number System Conversion
https://www.tutorialspoint.com/cgi-bin/printpage.cgi 1/5
https://www.tutorialspoint.com/computer_logical_organization/number_system_conversion.htm Copyright ยฉ tutorialspoint.com
NUMBER SYSTEM CONVERSION
There are many methods or techniques which can be used to convert numbers from one base to another. We'll
demonstrate here the following โˆ’
Decimal to Other Base System
Other Base System to Decimal
Other Base System to Non-Decimal
Shortcut method โˆ’ Binary to Octal
Shortcut method โˆ’ Octal to Binary
Shortcut method โˆ’ Binary to Hexadecimal
Shortcut method โˆ’ Hexadecimal to Binary
Decimal to Other Base System
Steps
Step 1 โˆ’ Divide the decimal number to be converted by the value of the new base.
Step 2 โˆ’ Get the remainder from Step 1 as the rightmost digit of new base number.
Step 3 โˆ’ Divide the quotient of the previous divide by the new base.
Step 4 โˆ’ Record the remainder from Step 3 as the next digit of the new base number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes zero in Step 3.
The last remainder thus obtained will be the Most Significant Digit of the new base number.
Example โˆ’
Decimal Number: 2910
Calculating Binary Equivalent โˆ’
Step Operation Result Remainder
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7 / 2 3 1
Step 4 3 / 2 1 1
leastsignificantdigit
totheleft
MSD
pf3
pf4
pf5

Partial preview of the text

Download NUMBER SYSTEM CONVERTING and more Exercises Digital Systems Design in PDF only on Docsity!

https://www.tutorialspoint.com/computer_logical_organization/number_system_conversion.htm Copyright ยฉ tutorialspoint.com

NUMBER SYSTEM CONVERSION

There are many methods or techniques which can be used to convert numbers from one base to another. We'll demonstrate here the following โˆ’

Decimal to Other Base System

Other Base System to Decimal

Other Base System to Non-Decimal

Shortcut method โˆ’ Binary to Octal

Shortcut method โˆ’ Octal to Binary

Shortcut method โˆ’ Binary to Hexadecimal

Shortcut method โˆ’ Hexadecimal to Binary

Decimal to Other Base System

Steps

Step 1 โˆ’ Divide the decimal number to be converted by the value of the new base.

Step 2 โˆ’ Get the remainder from Step 1 as the rightmost digit of new base number.

Step 3 โˆ’ Divide the quotient of the previous divide by the new base.

Step 4 โˆ’ Record the remainder from Step 3 as the next digit of the new base number.

Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes zero in Step 3.

The last remainder thus obtained will be the Most Significant Digit of the new base number.

Example โˆ’

Decimal Number: 29 10

Calculating Binary Equivalent โˆ’

Step Operation Result Remainder

Step 1 29 / 2 14 1

Step 2 14 / 2 7 0

Step 3 7 / 2 3 1

Step 4 3 / 2 1 1

leastsignificantdigit

totheleft

MSD

Step 5 1 / 2 0 1

As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order so that the first remainder becomes the Least Significant Digit and the last remainder becomes the Most Significant Digit.

Decimal Number โˆ’ 29 10 = Binary Number โˆ’ 11101 2.

Other Base System to Decimal System

Steps

Step 1 โˆ’ Determine the column value of each digit .

Step 2 โˆ’ Multiply the obtained column values by the digits in the corresponding columns.

Step 3 โˆ’ Sum the products calculated in Step 2. The total is the equivalent value in decimal.

Example

Binary Number โˆ’ 11101 2

Calculating Decimal Equivalent โˆ’

Step Binary Number Decimal Number

Step 1 (^111012) ((1 ร— 2^4 ) + (1 ร— 2^3 ) + (1 ร— 2^2 ) + (0 ร— 2^1 ) + (1 ร— 2^0 )) 10

Step 2 (^111012 )

Step 3 (^111012 )

Binary Number โˆ’ 11101 2 = Decimal Number โˆ’ 29 10

Other Base System to Non-Decimal System

Steps

Step 1 โˆ’ Convert the original number to a decimal number.

Step 2 โˆ’ Convert the decimal number so obtained to the new base number.

Example

Octal Number โˆ’ 25 8

Calculating Binary Equivalent โˆ’

LSD MSD

positional thisdependsonthepositionofthedigitandthebaseofthenumbersystem

inStep 1

base 10

Step Binary Number Octal Number

Step 1 101012 010 101

Step 2 (^101012 28 )

Step 3 (^101012 )

Binary Number โˆ’ 10101 2 = Octal Number โˆ’ 25 8

Shortcut method - Octal to Binary

Steps

Step 1 โˆ’ Convert each octal digit to a 3 digit binary number .

Step 2 โˆ’ Combine all the resulting binary groups into a single binary number.

Example

Octal Number โˆ’ 25 8

Calculating Binary Equivalent โˆ’

Step Octal Number Binary Number

Step 1 (^258 210 )

Step 2 (^258 0102 )

Step 3 (^258 )

Octal Number โˆ’ 25 8 = Binary Number โˆ’ 10101 2

Shortcut method - Binary to Hexadecimal

Steps

Step 1 โˆ’ Divide the binary digits into groups of four.

Step 2 โˆ’ Convert each group of four binary digits to one hexadecimal symbol.

Example

Binary Number โˆ’ 10101 2

theoctaldigitsmaybetreatedasdecimalforthisconversion

of 3 digitseach

startingfromtheright

Calculating hexadecimal Equivalent โˆ’

Step Binary Number Hexadecimal Number

Step 1 101012 0001 0101

Step 2 (^101012 110 )

Step 3 (^101012 )

Binary Number โˆ’ 10101 2 = Hexadecimal Number โˆ’ 15 16

Shortcut method - Hexadecimal to Binary

Steps

Step 1 โˆ’ Convert each hexadecimal digit to a 4 digit binary number .

Step 2 โˆ’ Combine all the resulting binary groups into a single binary number.

Example

Hexadecimal Number โˆ’ 15 16

Calculating Binary Equivalent โˆ’

Step Hexadecimal Number Binary Number

Step 1 (^1516 110 )

Step 2 (^1516 00012 )

Step 3 (^1516 )

Hexadecimal Number โˆ’ 15 16 = Binary Number โˆ’ 10101 2

thehexadecimaldigitsmaybetreatedasdecimalforthisconversion

of 4 digitseach