Difference between revisions of "Manuals/calci/BIN2HEX"

From ZCubes Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
=BIN2HEX(number,padding)=
+
=BIN2HEX(number,places)=
  
 
*Where 'number' is the binary number to be converted and  
 
*Where 'number' is the binary number to be converted and  
*'padding' is the number of characters to display the output.
+
*'places' is the number of characters to display the output.
  
 
BIN2HEX() converts a binary number to its hexadecimal equivalent.
 
BIN2HEX() converts a binary number to its hexadecimal equivalent.
Line 8: Line 8:
 
== Description ==
 
== Description ==
  
BIN2HEX(number, padding)
+
BIN2HEX(number, places)
  
 
This function is used to convert a binary number to its hexadecimal equivalent.
 
This function is used to convert a binary number to its hexadecimal equivalent.
  
*'number' must be a binary number.
+
*'number' must be a binary number. Binary number is represented using digits 1 or 0 only. The number can also be entered in text format (e.g "101").
  
*BIN2HEX returns the error value, when 'num' contains more than 10 characters (10 bits).
+
*The most significant bit represents the 'sign' of the number (0=positive, 1=negative). Negative numbers are represented using 2's complement notation.
  
*If the number is negative, Calci returns a NAN(error) value.
+
*Positive numbers may be from 0 (000000000) to 130046 (11111111111111110) and negative numbers from -1 (1111111111) to -512 (1000000000).
  
*Calci returns an error, if 'padding' is nonnumeric or negative.
+
*A number preceding with '0' (e.g 01111111111) should be written in text format ("01111111111") to avoid confusion with octal numbers. 
 +
 
 +
*If the 'number' exceeds the limit, Calci returns an #ERROR message.
 +
 
 +
*If the 'number' is negative, Calci ignores the places and displays 10 digit hexadecimal number.
 +
 
 +
*If the 'number' is invalid, Calci returns an #ERROR message.
 +
UNIQ45fda82a140a653d-item-3--QINU*If 'places' is not an integer, Calci truncates the value and uses integer part.
  
 
For Example,
 
For Example,
  
BIN2HEX(11111011, 3) returns 0FB
+
BIN2HEX(11111011, 3) ''returns 0FB''
  
BIN2HEX(1110) returns E
+
BIN2HEX(1110) ''returns E''
 +
 
 +
BIN2HEX(11001100,6.6) ''returns 00000CC''
  
 
== Examples ==
 
== Examples ==
Line 32: Line 41:
 
{| id="TABLE3" class="SpreadSheet blue"
 
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
|- class="even"
| class="  " | ''Formula''
+
| class="  " | '''Formula'''
| class="  " | ''Hex Output''
+
| class="  " | '''Hex Output'''
  
 
|- class="odd"
 
|- class="odd"
Line 44: Line 53:
  
 
|- class="odd"
 
|- class="odd"
| class="ssh1_f" | BIN2HEX(11001100,4)
+
| class="ssh1_f" | BIN2HEX(11001100,6)
| class="sshl_f" | 00CC
+
| class="sshl_f" | 0000CC
  
 
|- class="even"
 
|- class="even"
| class="ssh1_f" | BIN2HEX(101000000000000)  
+
| class="ssh1_f" | BIN2HEX(11110000)  
| class="sshl_f" | 4C00
+
| class="sshl_f" | F0
 +
 
 +
|}
 +
 
 +
==Related Videos==
 +
 
 +
{{#ev:youtube|8T4F7WboWPQ|280|center|BIN2HEX}}
 +
 
 +
== See Also ==
 +
 
 +
*[[Manuals/calci/BIN2DEC| BIN2DEC]]
  
|- class="odd"
+
*[[Manuals/calci/BIN2OCT| BIN2OCT]]
| class="ssh1_f" |
+
 
| class="sshl_f" |
+
*[[Manuals/calci/HEX2BIN| HEX2BIN]]
  
|- class="even"
+
==References==
| class="ssh1_f" |
 
| class="sshl_f" |
 
  
|}
+
*[http://en.wikipedia.org/wiki/Binary_number#Hexadecimal Conversion to Hexadecimal Number]

Latest revision as of 14:54, 18 April 2015

BIN2HEX(number,places)

  • Where 'number' is the binary number to be converted and
  • 'places' is the number of characters to display the output.

BIN2HEX() converts a binary number to its hexadecimal equivalent.

Description

BIN2HEX(number, places)

This function is used to convert a binary number to its hexadecimal equivalent.

  • 'number' must be a binary number. Binary number is represented using digits 1 or 0 only. The number can also be entered in text format (e.g "101").
  • The most significant bit represents the 'sign' of the number (0=positive, 1=negative). Negative numbers are represented using 2's complement notation.
  • Positive numbers may be from 0 (000000000) to 130046 (11111111111111110) and negative numbers from -1 (1111111111) to -512 (1000000000).
  • A number preceding with '0' (e.g 01111111111) should be written in text format ("01111111111") to avoid confusion with octal numbers.
  • If the 'number' exceeds the limit, Calci returns an #ERROR message.
  • If the 'number' is negative, Calci ignores the places and displays 10 digit hexadecimal number.
  • If the 'number' is invalid, Calci returns an #ERROR message.

?UNIQ45fda82a140a653d-item-3--QINU?*If 'places' is not an integer, Calci truncates the value and uses integer part.

For Example,

BIN2HEX(11111011, 3) returns 0FB

BIN2HEX(1110) returns E

BIN2HEX(11001100,6.6) returns 00000CC

Examples

Formula Hex Output
BIN2HEX(100) 4
BIN2HEX(110011,4) 0033
BIN2HEX(11001100,6) 0000CC
BIN2HEX(11110000) F0

Related Videos

BIN2HEX

See Also

References