Monday, November 23, 2020
Convert Decimal to Binary
The very first way to convert is dividing the decimal number by 2
eg: 87
87/2 = 43 - 1
43/2 = 21 - 1
21/2 = 10 - 1
10/2 = 05 - 0
05/2 = 02 - 1
02/2 = 1 - 0
so the binary for the decimal number 87 is 1010111
also there is another way to easily find that is exponent method
2 power zero is 1
2 to the power one is 2 .....
so it comes as
1, 2, 4, 8, 16, 32, 64,128....
so 87 comes in between 64 and 128 so it should be active in that place so 1 at that place
so to find it easier
64* 1 + 32 = 96 which is greater than 87
so no 32
64* 1 + 32*0 + 16 = 80 so yes 16 can be active
64*1 + 32*0 + 16*1 + 8 = 88 which is greater than 87 so it (8) should be inactive
64*1+32*0+16*1+8*0+ 4 = 84 so it (4) can be
active
64*1+32*0+16*1+8*0+4*1+2= 86 so it(2) can be active
64*1 + 32*0+16*1+8*0+4*1+2*1+1=87 so it(1) can be active so
so the answer is 1010111
thank you!
Subscribe to:
Posts (Atom)