This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

convert decimal to binary and contrary !
#1
Hi guys !
I have a little problem, I have 3 problems, please help! :
- I want to convert Decimal value to binary, or Hex to binary.
Example: Number 5000 converts to 0001 0011 1000 1000, suppose assigning to string b='0001 0011 1000 1000'
- After getting string b, we can read the value of each bit in string b (read each position from bit 0 to bit 15).
For example, for the string b='0001 0011 1000 1000', I read bits from right to left, the 4th place is "1", the 10th and 11th places are "1" and "0".
for the string b='0001 0011 1000 1000', I also want to read the ordinal bits, the 9th and 10th and 11th positions are "111", the 3rd and 4th positions are "10"
How can I do this?
This is "how to convert dec to bin"
https://www.rapidtables.org/vi/convert/n...inary.html
- I have the string b='0001 0011 1000 1000'. I want to record the 4th value =1 (from right to left) as =0 . What should I do Sad.After assigning I want to convert this string to decimal number
Thank you very much everyone! Smile
Reply


Messages In This Thread
convert decimal to binary and contrary ! - by phongvucba - 23.03.2022, 05:21

Forum Jump: