You are on page 1of 10

Digital Electronics and Microprocessors Technology (DEMT)

2nd Semester 2011-12 , IIT Rajasthan

Decimal,Binary,Octal,Hexadecimal number representation (generic form and inter-conversion


Abhinav Dadhich J09001

Instructor: Ashutosh Dwivedi

Office R.N. 1109, AB-I (First Floor) Ph: 231 (internal) Mail: ashudwi@

Number Representation
Any numbering system will consist of a number of symbols with each symbol representing specific elementary (face) values. The Arabic system that we commonly use consists of exactly ten symbols: 0 1 2 3 4 5 6 7 8 9

The exact value of a symbol is determined by the position (place) it occupies. This is the basis of a positional numbering system.

The total value of a number is then the sum of face values multiplied by their place values.
2

Decimal Numbering System


The Arabic numbering system uses ten symbols and is a base ten numbering system. In any numbering system the base is raised to consecutive powers to determine positional (place) values.

103 1000

102 100 2 4 8

101 10 3 1 6

100 1 1 3 0

basepowers place values

Computer Representation
Binary System
At the hardware level computers must store numbers using either the presence or absence of a voltage. Then there are only two states (symbols) available for number representation. So base 2 (binary) is a suitable system for computers. 26 64 25 32 24 16 23 8 22 4 21 2 20 1 basepowers place values

Octal number representation


Just as each digit in decimal represent a number multiplied to a base 10 to some power Same in octal number is number multiplied to base 8 to some power

84

83

82
64

81
80

80
1

basepowers
place values

4096 512

Hexadecimal representation
It is Base 16 representation(0,1,2.9,A,B,C,D,E,F)

Decimal Binary Conversion

Successive Division
a) b) Divide the decimal number by 2; the remainder is the LSB of the binary number. If the quotation is zero, the conversion is complete. Otherwise repeat step (a) using the quotation as the decimal number. The new remainder is the next most significant bit of the binary number.

Decimal Octal Conversion


The Process: Successive Division Divide the decimal number by 8; the remainder is the LSB of the octal number . If the quotation is zero, the conversion is complete. Otherwise repeat step (a) using the quotation as the decimal number. The new remainder is the next most significant bit of the octal number. Example: Convert the decimal number 9410 into its octal equivalent.
11 8 94 1 8 11 0 8 1
8

r 6 LSB r 3 r 1 MSB

9410 = 1368

To get back the decimal number from octal form Multiply each bit of the Octal Number by its corresponding bitweighting factor (i.e., Bit080=1; Bit-181=8; Bit282=64; etc.). Sum each to get decimal value

Decimal Hexadecimal Conversion


The Process: Successive Division Divide the decimal number by 16; the remainder is the LSB of the hexadecimal number. If the quotation is zero, the conversion is complete. Otherwise repeat step (a) using the quotation as the decimal number. The new remainder is the next most significant bit of the hexadecimal number. Example: Convert the decimal number 9410 into its hexadecimal equivalent. To get back the decimal number
5 16 94 0 16 5
9

r E LSB r 5 MSB

9410 = 5E16

from octal form Multiply each bit of the hexadecimal number by its corresponding bit-weighting factor (i.e., Bit-0160=1; Bit1161=16; Bit-2162=256; etc.). Sum each to get decimal value

Binary Octal Hex Shortcut


Because binary, octal, and hex number systems are all powers of two (which is the reason we use them) there is a relationship that we can exploit to make conversion easier.

1 0 1 1 0 1 0 2 = 132 8 = 5A H
To convert directly between binary and octal, group the binary bits into sets of 3 (because 23 = 8). You may need to pad with leading zeros.

0 0 1 0 1 1 0 1 0 2= 1
1 3 2

28

001 011 010

To convert directly between binary and hexadecimal number systems, group the binary bits into sets of 4 (because 24 = 16). You may need to pad with leading zeros.

0 1 0 1 1 0 1 0 2= 5
10

A 16
10

0101 1 010

You might also like