Difference between revisions of "Manuals/calci/HEX2BIN"

From ZCubes Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=HEX2BIN(number, places)=
 
=HEX2BIN(number, places)=
  
*Where 'number' is the hexadecimal number to be converted, and
+
*Where <math>number</math> is the hexadecimal number to be converted, and
*'places' is the number of characters to display the output.
+
*<math>places</math> 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 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 <math>number</math> 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").  
 
*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.
 
*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 <math>number</math> 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.  
+
*<math>places</math> argument is used to return the output with leading zeros. If <math>places</math> 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 <math>places</math> 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.
+
*If <math>places</math> is not an integer, Calci rounds the value and uses the integer part as input.
 +
*If <math>places</math> 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 ==
  
 +
<div id="1SpaceContent" class="zcontent" align="left">
  
HEX2BIN() ''returns 011110''  
+
{| id="TABLE1" class="SpreadSheet blue"
 +
|- class="even"
 +
| class="  " | '''Function'''
 +
| class="  " | '''Binary Output'''
  
 +
|- class="odd"
 +
| class="sshl_f" | HEX2BIN("A",5)
 +
| class="sshl_f" | 01010
  
*If SomeNumber and NumberPlaces are non-numeric, HEX2BIN returns the#ERROR.
+
|- class="even"
*If the NumberPlaces is a negative, it returns the #ERROR.
+
| class="sshl_f" | HEX2BIN("10",8)
*If NumberPlaces &gt; LengthofSomeNumber then  returns #ERROR.
+
| class="sshl_f" | 00010000
*If number is not valid hexadecimal number, it returns #ERROR.
 
*If NumberPlaces &gt; 10 ,then it returns #ERROR.
 
  
</div>
+
|- class="odd"
----
+
| class="sshl_f" | HEX2BIN("FFFFFFFE00")
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
+
| class="sshl_f" | 1000000000
  
HEX2BIN
+
|- class="even"
 +
| class="sshl_f" | HEX2BIN("0FF",-5)
 +
| class="sshl_f" | 11111111
  
<font size="6"></font>
+
|- class="odd"
 +
| class="sshl_f" | HEX2BIN("DF")
 +
| class="sshl_f" | 0011011111
  
</div></div>
+
|- class="even"
----
+
| class="sshl_f" | HEX2BIN("C",6.3)
<div id="8SpaceContent" class="zcontent" align="left">
+
| class="sshl_f" | 0001100
  
Lets see an example in (Column1, Row1)
+
|}
  
<nowiki>=HEX2BIN("A",5)</nowiki>
+
==Related Videos==
  
HEX2BIN converts A to 01010.
+
{{#ev:youtube|7yfNWmHR0GE|280|center|HEX2BIN}}
  
Consider an another example(Column1,Row2)
+
== See Also ==
  
<nowiki>=HEX2BIN("C3")</nowiki>
+
*[[Manuals/calci/HEX2DEC| HEX2DEC]]
  
Converts C3 to 11000011.
+
*[[Manuals/calci/HEX2OCT| HEX2OCT]]
  
</div>
+
*[[Manuals/calci/BIN2HEX| BIN2HEX]]
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<div id="4SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Remarks </div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Examples </div></div>
 
----
 
<div id="11SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Description </div></div>
 
----
 
<div id="2SpaceContent" class="zcontent" align="left">
 
  
{| id="TABLE3" class="SpreadSheet blue"
+
==References==
|- class="even"
 
| class=" " |
 
| Column1
 
| Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class="sshl_f" | 1010
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f" | 11000011
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|- class="odd"
 
| Row3
 
| class="  SelectTD ChangeBGColor SelectTD" |
 
<div id="2Space_Handle" class="zhandles" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="2Space_Copy" class="zhandles" title="Click and Drag over to AutoFill other cells."></div><div id="2Space_Drag" class="zhandles" title="Click and Drag to Move/Copy Area.">[[Image:copy-cube.gif]]  </div>
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|- class="even"
 
| Row4
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|- class="odd"
 
| class=" " | Row5
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|- class="even"
 
| Row6
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|}
 
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
*[http://en.wikipedia.org/wiki/Hexadecimal#Conversion Hexadecimal to Binary Conversion]
----
 

Latest revision as of 14:47, 17 April 2015

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