+ 3
What is the mechanism of conversation of decimal to binary?
5 Respostas
+ 4
Conversion for decimal to binary
lets take an example
let the number be 156
do 156÷2=78 no reminder mark as 0
do 78÷2=39 no reminder mark as 0
do 39÷2=19 reminder=1 mark as 1
do 19÷2=9 reminder=1 mark as 1
do 9÷2=4 reminder=1 mark as 1
do 4÷2=2 reminder=0 mark as 0
do 2÷2=1 reminder=0 mark as 0
since the last result is 1 mark as 1
binary for 156 is 10011100 start from bottom to top( with the values marked)
+ 15
@Gokul Nagarajan:
To convert binary to decimal: 100101:
Go from right to left, under each bit.
Put a 2 with an exponent of 0 under the first.
Put a 2 with an exponent of 1 under the second.
Put a 2 with an exponent of 2 under the third.
Continue this from right to left and calculate the value of each.
Now,
If the bit is a zero, then it has no value.
If the bit is a one, then it has the value of whatever number you calculated under it. Add up every bit's value that is one and you will have successfully converted it.
100101 -
From right to left:
The first bit is 1. Under it, there would be a 2 with an exponent of 0. That is equal to 1. Add it to the sum.
The second bit is 0. Move on.
The third bit is 1. Under it, there would be a 2 with an exponent of 2. That is equal to 4. Add it to the sum.
The fourth bit is 0. Move on.
The fifth bit is 0. Move on.
The sixth bit is 1. Under it, there would be a 2 with an exponent of 5. That is equal to 32. Add it to the sum.
If you check the sum from the example, it will be 37. 1 + 4 + 32 = 37.
So 100101 is 37 in binary.
+ 15
No problem ^_^ @Gokul
+ 5
Thanks @cipher for the method😊😊
+ 4
sorry i dont know the reverse