Friday, March 23, 2018

Convert numbers to different number systems

Convert numbers to different number systems

A number system is a systematic way to represent numbers with symbolic characters and uses a base value to conveniently group numbers in compact form. The most common number system is decimal, which has a base value of 10, and a symbolic character set of 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. However, there are other number systems, and they can be more efficient to use for a specific purpose. For example, because computers use Boolean logic to perform calculations and operations, they use the binary number system, which has a base value of 2.

Microsoft Office Excel has several functions that you can use to convert numbers to and from the following number systems:

Number system

Base value

Symbolic character set

Binary

2

0,1

Octal

8

0, 1, 2, 3, 4, 5, 6, 7

Decimal

10

0, 1, 2, 3, 4, 5, 6, 7, 8, and 9

Hexadecimal

16

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

To do this task, use the BIN2DEC function.

1

2

3

A

B

Formula

Description (Result)

=BIN2DEC(1100100)

Converts binary 1100100 to decimal (100)

=BIN2DEC(1111111111)

Converts binary 1111111111 to decimal (-1)

To do this task, use the BIN2HEX function.

1

2

3

4

A

B

Formula

Description (Result)

=BIN2HEX(11111011, 4)

Converts binary 11111011 to hexadecimal with 4 characters (00FB)

=BIN2HEX(1110)

Converts binary 1110 to hexadecimal (E)

=BIN2HEX(1111111111)

Converts binary 1111111111 to hexadecimal (FFFFFFFFFF)

To do this task, use the BIN2OCT function.

1

2

3

4

A

B

Formula

Description (Result)

=BIN2OCT(1001, 3)

Converts binary 1001 to octal with 3 characters (011)

=BIN2OCT(1100100)

Converts binary 1100100 to octal (144)

=BIN2OCT(1111111111)

Converts binary 1111111111 to octal (7777777777)

To do this task, use the DEC2BIN function.

1

2

3

A

B

Formula

Description (Result)

=DEC2BIN(9, 4)

Converts decimal 9 to binary with 4 characters (1001)

=DEC2BIN(-100)

Converts decimal -100 to binary (1110011100)

To do this task, use the DEC2HEX function.

1

2

3

A

B

Formula

Description (Result)

=DEC2HEX(100, 4)

Converts decimal 100 to hexadecimal with 4 characters (0064)

=DEC2HEX(-54)

Converts decimal -54 to hexadecimal (FFFFFFFFCA)

To do this task, use the DEC2OCT function.

1

2

3

A

B

Formula

Description (Result)

=DEC2OCT(58, 3)

Converts decimal 58 to octal (072)

=DEC2OCT(-100)

Converts decimal to octal (7777777634)

To do this task, use the HEX2BIN function.

1

2

3

4

A

B

Formula

Description (Result)

=HEX2BIN("F", 8)

Converts hexadecimal F to binary, with 8 characters (00001111)

=HEX2BIN("B7")

Converts hexadecimal B7 to binary (10110111)

=HEX2BIN("FFFFFFFFFF")

Converts hexadecimal FFFFFFFFFF to binary (1111111111)

To do this task, use the HEX2DEC function.

1

2

3

4

A

B

Formula

Description (Result)

=HEX2DEC("A5")

Converts hexadecimal A5 to decimal (165)

=HEX2DEC("FFFFFFFF5B")

Converts hexadecimal FFFFFFFF5B to decimal (-165)

=HEX2DEC("3DA408B9")

Converts hexadecimal 3DA408B9 to decimal (1034160313)

To do this task, use the HEX2OCT function.

1

2

3

4

A

B

Formula

Description (Result)

=HEX2OCT("F", 3)

Converts hexadecimal F to octal with 3 characters (017)

=HEX2OCT("3B4E")

Converts hexadecimal 3B4E to octal (35516)

=HEX2OCT("FFFFFFFF00")

Converts hexadecimal FFFFFFFF00 to octal (7777777400)

To do this task, use the OCT2BIN function.

1

2

3

A

B

Formula

Description (Result)

=OCT2BIN(3, 3)

Converts octal 3 to binary with 3 characters (011)

=OCT2BIN(7777777000)

Converts octal 7777777000 to binary (1000000000)

To do this task, use the OCT2DEC function.

1

2

3

A

B

Formula

Description (Result)

=OCT2DEC(54)

Converts octal 54 to decimal (44)

=OCT2DEC(7777777533)

Converts octal 7777777533 to decimal (-165)

To do this task, use the OCT2HEX function.

1

2

3

A

B

Formula

Description (Result)

=OCT2HEX(100, 4)

Converts octal number 100 to hexadecimal with 4 characters (0040)

=OCT2HEX(7777777533)

Converts octal number 7777777533 to hexadecimal (FFFFFFFF5B)

No comments:

Post a Comment