English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Does anyone know how to convert this binary number 1101010111011.01011 into a hexadecimal and octal I'm so
Does anyone know how to convert this binary number 1101010111011.01011 into a hexadecimal and octal number I'm so frustrated!!!

2007-02-20 11:29:14 · 6 answers · asked by TICKLES 1 in Computers & Internet Programming & Design

6 answers

Basically every group of 4 binary digits can be used to make a hexidecimal digit. So first break up your binary number into groups of 4 digits starting at the dot and working outward toward the left and right:

0001__1010__1011__1011 . 0101__1000

Notice that I padded the left and the right side of the number with zeros to get a nice round 4 binary digits. That does not change the value of the binary number. It is very important to do this padding with the fractional part to the right of the dot, since there is a big difference between 1000 (with padding) and 1 (misleading appearance without padding).

Convert each group of 4 from binary to decimal and then from decimal to hexidecimal:

0000 == 0(dec) == 0(hex)
0001 == 1(dec) == 1(hex)
0010 == 2(dec) == 2(hex)
...
...
1001 == 9(dec) == 9(hex)
1010 == 10(dec) == A(hex)
1011 == 11(dec) == B(hex)
1100 == 12(dec) == C(hex)
1101 == 13(dec) == D(hex)
1110 == 14(dec) == E(hex)
1111 == 15(dec) == F(hex)

So for your binary number grouped for hexidecimal conversion:
0001__1010__1011__1011 . 0101__1000

the decimal-equivalent groupings would be:
1__10__11__11 . 5__8

so the hexidecimal would be:
1ABB.58

ASIDE TO CHIPZ: the fractional notation using a dot works just as well for arithmetic of any base as it works for base 10. However, when the dot is used with binary digits it is called a "binary point," not a "decimal point".

Now answer this bonus question for a free WHATZIT(TM): What is the dot called when it is used for fractional notation with hexidecimal digits?

And a bonus bonus question, this one for a free WHATZIT(TM) REMOVER: Why do computer programmers and engineers represent computer-based "floating point numbers" as 8- or 16-digit hexidecimal integers instead of using "hexidecimal point" notation?

2007-02-20 12:03:08 · answer #1 · answered by BalRog 5 · 1 1

Hexidecimal is base 16 (0 to 15) and Octal is base 8 (0 to 7)
Hex uses the digits 0 to 9 and letters a to f to represent the16 values 0 to 15

A quickway of converting binary into either hex or octal is to group the binary number into either 4 or 3 digits and write down the value for that group.

so to convert the following binary into Hex
1101010111011

becomes where the underscore is used here to breakup the binary into groups of 4
1_1010_1011_1011

each of the above groups have the following values
1_A_B_B

To indicate its a Hex number begin the number with 0x

so the answer is : 0x1ABB which equals 6843 in decimal which equals 1101010111011 in binary.


To really understand binary and hex values you have to realize that each digit or a number represents a quantity of a base number raised to the power of the digits position.

In decimal the number 123 means

qty 1 hundred (10^2)
qty 2 ten (10^1)
qty 3 one (10^0)

123 converted to binary is 1111011
qty 1( 2^6) = 64 * 1 = 64
qty 1(2^5) = 32 * 1 = 32
qty 1(2^4) = 16 * 1 = 16
qty 1(2^3) = 8 * 1 = 8
qty 0(2^2) = 4 * 0= 0
qty 1(2^1) = 2 * 1 = 2
qty 1(2^0) = 1 * 1 = 1

so 64+32+16+8+0+2+1 = 123

For numbers on the right side of a decimal point you raise the base to the negative power. so 0.1 binary is 2^-1 = .5 decimal
or .5 decimal = 8*(16^-1) 0x8 in hex


Normally in the embedded programming world decimals are not used as math is integer based. Rather the number is shifted left a number of places say 4 binary places which is the equivalent of multiplying by 16 . the number is processed and finally shifted back 4 places 9 divide by 16) Any bits representing a fraction are lost/discarded.

2007-02-20 12:18:24 · answer #2 · answered by MarkG 7 · 0 0

to convert the binary number to hex is easy just break it into groups of four numbers, i'll break it down for you 0011 0101 0111 0110 1011 now with it broken into segments of four use the conversion for binary, so using the table below you get 3576B as your Hex number

Hex Binary
0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
A = 1010
B = 1011
C = 1100
D = 1101
E = 1110
F = 1111

Now for octal,all you do is break it down into groups of three, so again your number broken down would look like this 110 101 011 101 101 011 then all you do is convert to octal using the table below. which you get 653553 in octal.

Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111

hope that helps.

2007-02-20 11:46:14 · answer #3 · answered by Cap'n Mark 2 · 0 0

You can do this with a table driven algorithm

Break the string into blocks of 4 (for hex) or 3 (for octal)
and then output the number that matches from the table.

eg

Hex
Bin Hex
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

or for Octal
Bin Oct
000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7

2007-02-20 11:44:37 · answer #4 · answered by run4ever79 3 · 0 0

Check out this site and see if it helps you understand it a little more :)

http://www.computerhope.com/binhex.htm

2007-02-20 11:36:10 · answer #5 · answered by crayziegirl75 2 · 0 0

Just one additional thing ..

Why was there a *decimal" point in your string of
binary digits?!

1101010111011[point]01011

Typo? Decimal points only exist in decimal. :o)

2007-02-20 11:52:03 · answer #6 · answered by Anonymous · 0 1

fedest.com, questions and answers