Digital concept
and
Number system
Chapter 1
Number systems
Number system use positional notation to represent
value,The position of the character (numeral) in a
character string (collection of possible numerals)
indicate value as well as the character itself.
Radix (base) is the number of numeral characters in
the character set of a positional number system.
Position Weight is a constant that represents the
value of a position,Different position has different
weight,It is the integer power of radix.
Radix = r;
Weight = rn;
Character set = { 0,1,………,r-1 }
Represent number N of radix r
– Positional Notation
(N)r = Cn-1Cn-2…Ci…C0?C-1C-2….C-m
– Polynomial Notation
(N)r = Cn-1rn-1+Cn-2rn-2+…+Ciri+…+C0r0
+C-1r-1+C-2r-2+….+C-mr-m
– n is the number of digits in the integer portion
of N,m is the number of digits in the
fractional portion of N
Counting in Base r
Decimal number
– Radix=10 ;
– Character set,{0,1,2,3,4,5,6,7,8,9}
– Weight=10n ;
– Ex,The decimal number 536 is (536)10
Binary number
– Radix=2 ;
– Character set,{0,1}
– Weight=2n ;
– Ex,The binary number 0110 is (0110)2
Octal number
– Radix=8 ;
– Character set,{0,1,2,3,4,5,6,7}
– Weight=8n ;
– Ex,The decimal number 536 is (536)8
Hexadecimal number
– Radix=16 ;
– Character set,{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
– Weight=16n ;
– Ex,(1AD.B)16=1 * 162+A * 161+D * 160+B * 16-1
Binary To Hexadecimal Conversion
Solution:
– 1,Partition the binary number into groups
of four,starting at the radix point and
going left and right.
– 2,Each group of four corresponds to a
single hexadecimal digit.
Binary To Octal Conversion
Solution:
– 1,Partition the binary number into groups
of three,starting at the radix point and
going left and right.
– 2,Each group of three corresponds to a
single octal digit.
Octal,Hexadecimal to Binary
conversion
Solution:
– Each hexadecimal digit corresponds to
four binary digits.
– Each octal digit corresponds to three
binary digits
Binary To Decimal Conversion
Solution:
– Polynomial Notation
(N)2 = Bn-1*2n-1+Bn-2 * 2n-2+…+Bi * 2i+…+B0 * 20
+B-1 * 2-1+B-2 * 2-2+….+B-m * 2-m
– Evaluate each term in the Polynominal
Any Radix To Decimal Conversion
Solution:
– Polynomial Notation
(N)r = Cn-1*rn-1+Cn-2 * rn-2+…+Ci * ri+…+C0 * r0
+C-1 * r-1+C-2 * r-2+….+C-m * r-m
– Evaluate each term in the Polynomial
Integral part
– Polynomial Notation
– (N)10 =(M)r
– (M)r= Cn-1*rn-1+Cn-2 * rn-2+…+Ci * ri+…+ C1 * r1 +C0 * r0
– Divided N by r
– Quotient= Cn-1*rn-2+Cn-2 * rn-3+…+Ci * ri+…+C1 * r0
– Remainder= C0
Decimal to Binary conversion
Decimal to Binary conversion
1.Convert the integer by successive division
N= integer to be converted
r= radix of new number
Q= quotient of divide operation
R=remainder of divide operation
R=MSD
in radix r
N/r=Q…R
save R as LSD
Input N
and r
Q/r=Q…R
save R
Q=0
Start
Stop Output radix r numberNo Yes
fractional part
– Polynomial Notation
– (N)10 =(M)r
– (M)r= C-1*r-1+C-2 * r-2+…+C-i * r-i+…+ C-m * r-m
– multiply N by r
– product= C-1+C-2 * r-1+…+C-i * r-i+1 +…+ C-m * r-m+1
– The integral part of the product is C-1,
Decimal to Binary conversion
2.Convert the fraction by successive multiplication
Nf= fraction to be convert
r= radix of new number
P= product,where IpFp and ^ means
tied together
Fp=fractional part of P
Ip=integer part of P
Yes
Ip =LSD
Stop Output radix r number
r*Nf=Ip ^Fp,
Ip=MSD
Input
Nf and r
Fp =0
Start
r*Fp=Ip ^Fp,
save Ip
No
Decimal to Binary conversion
and
Number system
Chapter 1
Number systems
Number system use positional notation to represent
value,The position of the character (numeral) in a
character string (collection of possible numerals)
indicate value as well as the character itself.
Radix (base) is the number of numeral characters in
the character set of a positional number system.
Position Weight is a constant that represents the
value of a position,Different position has different
weight,It is the integer power of radix.
Radix = r;
Weight = rn;
Character set = { 0,1,………,r-1 }
Represent number N of radix r
– Positional Notation
(N)r = Cn-1Cn-2…Ci…C0?C-1C-2….C-m
– Polynomial Notation
(N)r = Cn-1rn-1+Cn-2rn-2+…+Ciri+…+C0r0
+C-1r-1+C-2r-2+….+C-mr-m
– n is the number of digits in the integer portion
of N,m is the number of digits in the
fractional portion of N
Counting in Base r
Decimal number
– Radix=10 ;
– Character set,{0,1,2,3,4,5,6,7,8,9}
– Weight=10n ;
– Ex,The decimal number 536 is (536)10
Binary number
– Radix=2 ;
– Character set,{0,1}
– Weight=2n ;
– Ex,The binary number 0110 is (0110)2
Octal number
– Radix=8 ;
– Character set,{0,1,2,3,4,5,6,7}
– Weight=8n ;
– Ex,The decimal number 536 is (536)8
Hexadecimal number
– Radix=16 ;
– Character set,{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
– Weight=16n ;
– Ex,(1AD.B)16=1 * 162+A * 161+D * 160+B * 16-1
Binary To Hexadecimal Conversion
Solution:
– 1,Partition the binary number into groups
of four,starting at the radix point and
going left and right.
– 2,Each group of four corresponds to a
single hexadecimal digit.
Binary To Octal Conversion
Solution:
– 1,Partition the binary number into groups
of three,starting at the radix point and
going left and right.
– 2,Each group of three corresponds to a
single octal digit.
Octal,Hexadecimal to Binary
conversion
Solution:
– Each hexadecimal digit corresponds to
four binary digits.
– Each octal digit corresponds to three
binary digits
Binary To Decimal Conversion
Solution:
– Polynomial Notation
(N)2 = Bn-1*2n-1+Bn-2 * 2n-2+…+Bi * 2i+…+B0 * 20
+B-1 * 2-1+B-2 * 2-2+….+B-m * 2-m
– Evaluate each term in the Polynominal
Any Radix To Decimal Conversion
Solution:
– Polynomial Notation
(N)r = Cn-1*rn-1+Cn-2 * rn-2+…+Ci * ri+…+C0 * r0
+C-1 * r-1+C-2 * r-2+….+C-m * r-m
– Evaluate each term in the Polynomial
Integral part
– Polynomial Notation
– (N)10 =(M)r
– (M)r= Cn-1*rn-1+Cn-2 * rn-2+…+Ci * ri+…+ C1 * r1 +C0 * r0
– Divided N by r
– Quotient= Cn-1*rn-2+Cn-2 * rn-3+…+Ci * ri+…+C1 * r0
– Remainder= C0
Decimal to Binary conversion
Decimal to Binary conversion
1.Convert the integer by successive division
N= integer to be converted
r= radix of new number
Q= quotient of divide operation
R=remainder of divide operation
R=MSD
in radix r
N/r=Q…R
save R as LSD
Input N
and r
Q/r=Q…R
save R
Q=0
Start
Stop Output radix r numberNo Yes
fractional part
– Polynomial Notation
– (N)10 =(M)r
– (M)r= C-1*r-1+C-2 * r-2+…+C-i * r-i+…+ C-m * r-m
– multiply N by r
– product= C-1+C-2 * r-1+…+C-i * r-i+1 +…+ C-m * r-m+1
– The integral part of the product is C-1,
Decimal to Binary conversion
2.Convert the fraction by successive multiplication
Nf= fraction to be convert
r= radix of new number
P= product,where IpFp and ^ means
tied together
Fp=fractional part of P
Ip=integer part of P
Yes
Ip =LSD
Stop Output radix r number
r*Nf=Ip ^Fp,
Ip=MSD
Input
Nf and r
Fp =0
Start
r*Fp=Ip ^Fp,
save Ip
No
Decimal to Binary conversion