User Name Remember Me? Password

 Calculus Calculus Math Forum

 April 16th, 2017, 03:19 AM #1 Newbie   Joined: Nov 2016 From: iran Posts: 4 Thanks: 0 how do I convert binary to hexadecimal? hi i wanted to know how to convert a binary(base 2) number to hexadecimal (base 16). i can do it by converting binary to decimal and decimal to hexadecimal but i want to know how i can do this conversion in one step. let's take 01100001 for example which equals to 97 in decimal and 61 in hexadecimal (i chose that number because every eight bit is one byte and if you show me how it's done using that number it would be much clearer. April 16th, 2017, 03:37 AM #2 Math Team   Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 14,597 Thanks: 1038 Thanks from Joppy April 16th, 2017, 04:23 AM #3 Math Team   Joined: Jan 2015 From: Alabama Posts: 3,264 Thanks: 902 16 (decimal) is (of course) 10 (hexadecimal) and 10000 (binary). Given any binary number, separate it into groups of 4 "bits" and convert each group to hexadecimal separately. For example, 10000 (binary) would be 1 and 0000. 1 (binary) is 1 (hexadecimal) and 0000 (binary) is 0 (hexadecimal). 10000 (binary) is 10 hexadecimal. For the numbers you give, 01100001 (binary), separate it to 0110 (binary) and 0001 (binary). 0110 (binary) is 0*8+ 1*4+ 1*2+ 0*1= 6 and 0001 (binary) is 0*8+ 0*4+ 0*2+ 1*1= 1 (obviously) so 01100001 (binary) is 61 (hexadecimal). Another example: 111001011010 separates as 1110, 0101, and 1010. 1110 is 1*8+ 1*4+ 1*2+ 0*1= 14 (D in hexadecimal), 0101 is 0*8+ 1*4+ 0*2+ 1*1= 5, and 1010 is 1*8+ 0*4+ 1*2+ 0*1= 10 (A in hexadecimal) so 111001011010 (binary) is D5A in hexadecimal. April 18th, 2017, 04:53 AM   #4
Math Team

Joined: Jan 2015
From: Alabama

Posts: 3,264
Thanks: 902

Quote:
 Originally Posted by Country Boy 16 (decimal) is (of course) 10 (hexadecimal) and 10000 (binary). Given any binary number, separate it into groups of 4 "bits" and convert each group to hexadecimal separately. For example, 10000 (binary) would be 1 and 0000. 1 (binary) is 1 (hexadecimal) and 0000 (binary) is 0 (hexadecimal). 10000 (binary) is 10 hexadecimal. For the numbers you give, 01100001 (binary), separate it to 0110 (binary) and 0001 (binary). 0110 (binary) is 0*8+ 1*4+ 1*2+ 0*1= 6 and 0001 (binary) is 0*8+ 0*4+ 0*2+ 1*1= 1 (obviously) so 01100001 (binary) is 61 (hexadecimal). Another example: 111001011010 separates as 1110, 0101, and 1010. 1110 is 1*8+ 1*4+ 1*2+ 0*1= 14 (D in hexadecimal), 0101 is 0*8+ 1*4+ 0*2+ 1*1= 5, and 1010 is 1*8+ 0*4+ 1*2+ 0*1= 10 (A in hexadecimal) so 111001011010 (binary) is D5A in hexadecimal.
No, "14" is not "D" in hexadecimal, it is "E" so the final answer here should be "E5A", not "D5A"! November 22nd, 2017, 02:51 AM #5 Newbie   Joined: Nov 2017 From: Sopore Posts: 1 Thanks: 0 i have developed a simple but powerful android app for converted numbers from one base to another. https://play.google.com/store/apps/d...code.converter Tags binary, convert, hexadecimal Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Similar Threads Thread Thread Starter Forum Replies Last Post Techmaster Computer Science 7 August 26th, 2014 01:29 PM Igo Computer Science 3 September 7th, 2012 03:58 AM Primalscientist Computer Science 3 April 17th, 2011 03:31 AM hans-de-jong Number Theory 2 June 30th, 2009 04:15 PM johnny Computer Science 2 October 13th, 2007 02:00 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top      