Difference between revisions of "Manuals/calci/HEX2BIN"
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
HEX2BIN("1EE",9) ''returns 111101110 '' | HEX2BIN("1EE",9) ''returns 111101110 '' | ||
− | HEX2BIN("4F,4) ''returns 1001111'' | + | HEX2BIN("4F",4) ''returns 1001111'' |
*The 'number' can be maximum of 10 characters (40 bits). If it exceeds the limit, Calci gives a #NUM! error. | *The 'number' can be maximum of 10 characters (40 bits). If it exceeds the limit, Calci gives a #NUM! error. | ||
Line 23: | Line 23: | ||
*If 'places' is not an integer, Calci rounds the value and uses the integer part as input. | *If 'places' is not an integer, Calci rounds the value and uses the integer part as input. | ||
+ | == Examples == | ||
+ | <div id="1SpaceContent" class="zcontent" align="left"> | ||
− | + | {| id="TABLE1" class="SpreadSheet blue" | |
+ | |- class="even" | ||
+ | | class=" " | '''Function''' | ||
+ | | class=" " | '''Binary Output''' | ||
+ | |- class="odd" | ||
+ | | class="sshl_f" | HEX2BIN("A",5) | ||
+ | | class="sshl_f" | | ||
− | + | |- class="even" | |
− | + | | class="sshl_f" | HEX2BIN("10",8) | |
− | + | | class="sshl_f" | | |
− | |||
− | |||
− | + | |- class="odd" | |
− | - | + | | class="sshl_f" | HEX2BIN("FFFFF00",7) |
− | + | | class="sshl_f" | | |
− | HEX2BIN | + | |- class="even" |
+ | | class="sshl_f" | HEX2BIN("FF0FF0",-5) | ||
+ | | class="sshl_f" | | ||
− | + | |- class="odd" | |
+ | | class="sshl_f" | HEX2BIN() | ||
+ | | class="sshl_f" | | ||
+ | |} | ||
− | + | == See Also == | |
− | |||
− | |||
− | + | *[[Manuals/calci/DEC2HEX| DEC2HEX]] | |
− | + | *[[Manuals/calci/DEC2OCT| DEC2OCT]] | |
− | + | *[[Manuals/calci/BIN2DEC| BIN2DEC]] | |
− | + | ==References== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | *[http://en.wikipedia.org/wiki/Decimal Decimal Numbers] | |
− |
Revision as of 19:47, 3 December 2013
HEX2BIN(number, places)
- Where 'number' is the hexadecimal number to be converted, and
- 'places' is the number of characters to display the output.
HEX2BIN() converts a hexadecimal number to its binary equivalent.
Description
HEX2BIN(number, places)
For example,
HEX2BIN("1EE",9) returns 111101110
HEX2BIN("4F",4) returns 1001111
- The 'number' can be maximum of 10 characters (40 bits). If it exceeds the limit, Calci gives a #NUM! error.
- Hexadecimal number uses numbers from 0 to 9 and characters from A to F. Hence, the number argument should be entered in quotes (e.g. "1FF").
- The most significant bit of the number is the sign bit and remaining bits are magnitude bits. A negative number is represented in 2's complement form.
- Calci returns an #ERROR message, if the 'number' is not a valid hexadecimal number.
- 'places' argument is used to return the output with leading zeros. If 'places' argument is not used, 'Calci' uses the minimum number of characters required to display the binary output.
- If 'places' is negative, Calci ignores the places and uses the minimum number of characters required to display the binary output.
- If 'places' is not an integer, Calci rounds the value and uses the integer part as input.
Examples
Function | Binary Output |
HEX2BIN("A",5) | |
HEX2BIN("10",8) | |
HEX2BIN("FFFFF00",7) | |
HEX2BIN("FF0FF0",-5) | |
HEX2BIN() |