data r epresentation
DESCRIPTION
Sanjeev Patel 4xTRANSCRIPT
DATA REPRESENTATI
ONBY-
Ravi Sharma
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:
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
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.
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 .
(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
( 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.
Subtraction of unsigned numbers
Signed Numbers
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
THANK YOU
THANK YOU