Khushaal
Khushaal
&
CONVERSION
•
• Multiply each bit by 2n, where n is the
"weight" of the bit.
• The weight is the position of the bit,
starting from 0 on the right
• Add the results
EXAMPLE
• (101001) 2 => 1 * 2 0
=1
• 0 * 2 1
=0
• 0 * 2 2
=0
• 1 * 2 3
=8
• 0 * 2 4
=0
• 1 * 2 5
=32
• (41)10
Decimal To Binary
• Technique:
• Multiply each bit by 16n, where n is the
"weight" of the bit
• The weight is the position of the bit,
starting from 0 on the right
• Add the results
OCTAL TO BINARY
• (777) 8 =
• 7 7 7
• 111 111 171
• (777)8= 111000101
COMPLEMENT OF NUMBER
• One's complement: In binary system, if
each 1 is replaced by 0and each 0 by 1,
then resulting number is called as one's
complement of the that number.
• If first number is positive then resulting will
be negative with the same magnitude and
vice versa.
• In binary arithmetic 1's complement of a
binary number N is obtained by the formula
= (2n-1) – N
• Where n is the no of bits in
binary number N.
EXAMPLE
• Convert binary number 1001010 to 1's complement.
• Method:
• Replace 0 with 1 and vice versa.
• N=1001010
• Answer:
• 1's complement of N is 0110101
TWO’S COMPLEMENT
• Two's complement: If 1 is
added to the complement
of a number then resulting
number is known as two's
complement.
• • If MSB is 0 then the
number is positive else if
MSB is 1 then the number
is negative.
• • 2's complement of a
binary number N is
obtained by the formula
(2n) - N, Where n is the no
of bits in number N
EXAMPLE
• Convert binary number 111001101 to 2's complement
• Method:
• 2's complement of a binary no can be obtained by two step
process
• Step 1
• 1's complement of number N = 000110010
• Step 2
• 1's complement + 1
• 000110010 +000000001 = 000110011
• Answer
• 2's complement of a binary no 111001101 is 000110011
Question 1: Convert (101101)₂ to Decimal
Convert the binary number (101101)₂ to its decimal
equivalent.
(101101)2=1×25+0×24+1×23+1×22+0×21+1×20(10110
1)_2 = 1×2^5 + 0×2^4 + 1×2^3 + 1×2^2 +
0×2^1 + 1×2^0(101101)2
=1×25+0×24+1×23+1×22+0×21+1×20
=1×32+0×16+1×8+1×4+0×2+1×1=
(238)₁₀
Question 3: Convert (245)₁₀ to Binary
Convert the decimal number (245)₁₀ to its binary equivalent.