## Engineering functions number conversions binary and decimal

#### Excel Function BIN2DEC

The BIN2DEC() function is used to convert binary number to decimal notation.

This function takes a maximum of 10 bits.

The most significant bit is the sign bit.

The negative numbers are converted with the use of 2s compliment.

 Binary Decimal Formula 100101 37 =BIN2DEC(L4) 110111 55 =BIN2DEC(L5) 10001 17 =BIN2DEC(L6) 111100001 481 =BIN2DEC(L7) 1110001101 -115 =BIN2DEC(L8) 1001110 78 '=BIN2DEC(L9)

As seen from the example, the binary number with MSB as 1 (10th bit) is treated as negative.

#### Excel Function BIN2OCT

The BIN2OCT() function returns the octal notation of the specified binary number.

The octal notation has the base value of 8.

This function too is restricted with a maximum of 10 bits.

 Binary Octal Formula 100101 45 =BIN2OCT(L20) 110111 67 =BIN2OCT(L21) 10001 21 =BIN2OCT(L22) 111100001 741 =BIN2OCT(L23) 110001101 615 =BIN2OCT(L24) 1001110 116 =BIN2OCT(L25)

As seen from the example, the octal representation uses digits for 0 to 7 only.

#### Excel Function BIN2HEX

The BIN2HEX() function converts the given binary number to its Hexadecimal notation.

The hexadecimal notation refers to numbers represented with base value of 16.

So, this notation uses 0 to 9 and from 10 to 15, it uses alphabets from A to F.

 Binary Hex Formula 100101 25 =BIN2HEX(L35) 110111 37 =BIN2HEX(L36) 10001 11 =BIN2HEX(L37) 111100001 1E1 =BIN2HEX(L38) 110001101 18D =BIN2HEX(L39) 1001110 4E =BIN2HEX(L40)

#### Excel Function DEC2BIN

The DEC2BIN() function is used to convert decimal numbers of base 10 to binary numbers of base-2.

This function converts any decimal number to 1s and 0s.

This function is often used in digital electronics calculations.

 Decimal Binary Formula 23 10111 =DEC2BIN(L48) 45 101101 =DEC2BIN(L49) 65 1000001 =DEC2BIN(L50) 3 11 =DEC2BIN(L51) 511 111111111 =DEC2BIN(L52) 12 1100 =DEC2BIN(L53)

As seen from the example, the maximum value of this function is 511 in decimal.

#### Excel Function DEC2OCT

The DEC2OCT() function is used to represent decimal numbers in Octal notation.

That is, from base-10 to base value of 8.

This function is most useful when the number of bits to represent a number is to be reduced.

 Decimal Octal Formula 23 27 =DEC2OCT(L63) 45 55 =DEC2OCT(L64) 65 101 =DEC2OCT(L65) 3 3 =DEC2OCT(L66) 511 777 =DEC2OCT(L67) 12 14 =DEC2OCT(L68)

As seen above, 511 in decimal is the maximum value that can be given.

#### Excel Function DEC2HEX

The DEC2HEX() function is used to convert decimal numbers to its hexadecimal form.

This function is most useful for opcode generation in microprocessor programming.

The hexadecimal notation has a base value of 16.

 Decimal Hex Formula 23 17 =DEC2HEX(L78) 45 2D =DEC2HEX(L79) 65 41 =DEC2HEX(L80) 3 3 =DEC2HEX(L81) 511 1FF =DEC2HEX(L82) 12 C =DEC2HEX(L83)