Manuals/calci/HEX2BIN

From ZCubes Wiki
Jump to navigation Jump to search

HEX2BIN(number, places)

  • Where is the hexadecimal number to be converted, and
  • 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 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 is not a valid hexadecimal number.
  • argument is used to return the output with leading zeros. If argument is not used, 'Calci' uses the minimum number of characters required to display the binary output.
  • If is negative, Calci ignores the places and uses the minimum number of characters required to display the binary output.
  • If is not an integer, Calci rounds the value and uses the integer part as input.
  • If is less than the number of output characters, Calci ignores the places and uses the minimum number of characters required to display the output.

Examples

Function Binary Output
HEX2BIN("A",5) 01010
HEX2BIN("10",8) 00010000
HEX2BIN("FFFFFFFE00") 1000000000
HEX2BIN("0FF",-5) 11111111
HEX2BIN("DF") 0011011111
HEX2BIN("C",6.3) 0001100

Related Videos

HEX2BIN

See Also

References