data r epresentation

12
DATA REPRESENTATION BY- Ravi Sharma

Upload: sanjeev-patel

Post on 28-Jan-2015

105 views

Category:

Education


3 download

DESCRIPTION

Sanjeev Patel 4x

TRANSCRIPT

Page 1: Data r epresentation

DATA REPRESENTATI

ONBY-

Ravi Sharma

Page 2: Data r epresentation

Binary number system- [ 0 and 1 ] Radix-2 , e.g.-(101101)2

Decimal number system- [ 0 to 9 ] Radix-10 , e.g.-(243)10

Octal number system- [ 0 to 7 ] Radix-8 , e.g.-(736.4)8

Hexadecimal - [ 0 to 9 and A to F ] Radix-16, e.g.-(F3)16

NUMBER SYSTEMS:

Page 3: Data r epresentation

Conversion to decimal- A number expressed in base r can be

converted to its decimal equivalent by multiplying each coefficient by corresponding power of r and adding . The following is an example of octal to decimal conversion:

Conversion

Page 4: Data r epresentation

Conversion from decimal to ‘r’ : Conversion of decimal integer into a base r is

done by successive divisions by r and accumulation of the remainders . The conversion of fraction is done by successive multiplication by r and accumulation of integer so obtained.

Page 5: Data r epresentation

Conversion from and to binary , octal , hexadecimal-

Since 23=8 and 24=16, each octal digits corresponds to three and each hexadecimal corresponds to 4 binary digits . The conversion from binary to octal and hexadecimal is done by partitioning the binary no. into groups of three and four bits respectively .

Page 6: Data r epresentation

(r-1)’s - - 9’s complement : It follows that the 9’s complement of a decimal

no. is obtained by subtracting each digit from 9. e.g.- 9’s complement of 546700 is 999999-

546700=453299

-1’s complement: The 1’s complement of a binary no. is obtained

by subtracting each digit by 1. e.g.- 1’s complement of 1011001 is 0100110.

Complements

Page 7: Data r epresentation

( r’s ) – -10’s complement : 10’s complement of a decimal number is

obtained by adding 1 to the 9’s complement value. e.g.- 10’s complement of 2389 is 7610+1=7611.

-2’s complement : 2’s complement of binary number is obtained by adding 1 to the 1’s complement.e.g. – 2’s complement of 101100 is 010011+1=010100.

Page 8: Data r epresentation

Subtraction of unsigned numbers

Page 9: Data r epresentation

Signed Numbers

Page 10: Data r epresentation
Page 11: Data r epresentation

An overflow condition can be detected by observing the carry into the sign bit position and carry out of the sign bit position . If these two carries are not equal an overflow is occurred . carries: 0 1 carries: 1 0

+70 0 1000110 -70 1 0111010

+80 0 1010000 -80 1 0110000

+150 1 0010110 -150 0 1101010

Overflow

Page 12: Data r epresentation

THANK YOU

THANK YOU