Luke15 Posted January 3, 2006 Share Posted January 3, 2006 I really need some basic help on converting binary to octal as its for an assignment. Is there any simplistic way in doing this? Thanks. Luke. Link to comment Share on other sites More sharing options...
segosa Posted January 3, 2006 Share Posted January 3, 2006 Take a binary number like 01001011 which is 75. Split it into 3 bit sections from right to left. 01 001 011 Convert each one into the decimal number 01 = 1 001 = 1 011 = 3 So the octal equivalent is 113. Link to comment Share on other sites More sharing options...
Luke15 Posted January 3, 2006 Author Share Posted January 3, 2006 Cheers dude, much appreciated. I have to do a Binary to Oct, Hex and Floating Point Assignment Link to comment Share on other sites More sharing options...
K^2 Posted January 5, 2006 Share Posted January 5, 2006 Conversions to Oct and Hex are simple. For octal, convert binary into groups of 3 bits, for hex groups of 4 bits, and convert each group into a digit. Just make sure you start grouping starting with lowest bit. Do you mean floating point in the binary? Same thing. Group everything to the right of the "decimal" point into groups of 3 or 4 bits. If you mean IEEE 32 bit floating point numbers, it is a bit tougher, but if you want to cheat, you can use a hex editor to get through it. Prior to filing a bug against any of my code, please consider this response to common concerns. 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