Difference between revisions of "Manuals/calci/HEX2BIN"

From ZCubes Wiki
Jump to navigation Jump to search
Line 2: Line 2:
  
 
*Where 'number' is the hexadecimal number to be converted, and
 
*Where 'number' is the hexadecimal number to be converted, and
*'places' is the number of characters to display the output.If omitted then it use minimum number of characters.NumberPlaces is use for adding the return value with leading zero.
+
*'places' is the number of characters to display the output.
  
 
HEX2BIN() converts a hexadecimal number to its binary equivalent.
 
HEX2BIN() converts a hexadecimal number to its binary equivalent.
Line 9: Line 9:
 
HEX2BIN(number, places)
 
HEX2BIN(number, places)
  
*The 'number' should be in the range  to . If it exceeds the limit, Calci gives a #NUM! error.
+
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.
 
*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.  
 
*'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 returns an error message.
+
*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 truncates 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.
 
 
For example,
 
  
HEX2BIN() ''returns 1010''
 
  
HEX2BIN() ''returns 0001100100''
 
  
 
HEX2BIN() ''returns 011110''  
 
HEX2BIN() ''returns 011110''  

Revision as of 19:08, 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.


HEX2BIN() returns 011110


  • If SomeNumber and NumberPlaces are non-numeric, HEX2BIN returns the#ERROR.
  • If the NumberPlaces is a negative, it returns the #ERROR.
  • If NumberPlaces > LengthofSomeNumber then  returns #ERROR.
  • If number is not valid hexadecimal number, it returns #ERROR.
  • If NumberPlaces > 10 ,then it returns #ERROR.

HEX2BIN


Lets see an example in (Column1, Row1)

=HEX2BIN("A",5)

HEX2BIN converts A to 01010.

Consider an another example(Column1,Row2)

=HEX2BIN("C3")

Converts C3 to 11000011.


Syntax

Remarks

Examples

Description

Column1 Column2 Column3 Column4
Row1 1010
Row2 11000011
Row3
Row4
Row5
Row6