Niklas111 Posted December 23, 2019 Share Posted December 23, 2019 So this may seems simple to most of you but i need a good explanation of covering this format of binary to decimal "0110 1010". Im having trouble finding a good tutorial. I would like a detailed explanation of method of how to translate it. Thank you. Link to comment Share on other sites More sharing options...
mathematic Posted December 23, 2019 Share Posted December 23, 2019 0110 1010=0x2^7+1x2^6+1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+0x2^0 Link to comment Share on other sites More sharing options...
Sensei Posted December 23, 2019 Share Posted December 23, 2019 (edited) In code, or on piece of paper? Algorithm of conversion of any base-x system could be: (loop start) get modulo of number. push it on stack (FILO). divide number by the same base. (loop end) repeat until number is not 0. Then pop up elements ("digits") from stack and show to user after appropriate conversion (like elements with 16 > n >= 10 replace by 'a' to 'f' in the case of hexadecimal system). Edited December 23, 2019 by Sensei Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now