Difference between revisions of "Manuals/calci/BIN2DEC"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left">  <font color="#000000"><font face="Arial, sans-serif"><font size="2">'''BIN2DEC'''</font></font><font face="Arial, sans...")
 
 
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left">  <font color="#000000"><font face="Arial, sans-serif"><font size="2">'''BIN2DEC'''</font></font><font face="Arial, sans-serif"><font size="2">(</font></font><font face="Arial, sans-serif"><font size="2">'''num'''</font></font><font face="Arial, sans-serif"><font size="2">)</font></font></font>
+
=BIN2DEC(number,places)=
  
<font color="#000000"><font face="Arial, sans-serif"><font size="2">Where 'num' is the binary number to convert. </font></font></font>
+
*Where 'number' is the binary number to be converted to decimal number.
  
</div>
+
*'places' is the number of characters to display the output.  
----
 
<div id="1SpaceContent" class="zcontent" align="left"> <font color="#000000"><font face="Arial, sans-serif"><font size="2">BIN2DEC function converts a binary number to decimal.</font></font></font></div>
 
----
 
<div id="7SpaceContent" class="zcontent" align="left"> 
 
  
<font color="#000000"><font face="Arial, sans-serif"><font size="2">BIN2DEC returns the error value., when number contains more than 10 characters (10 bits).</font></font></font>
+
BIN2DEC() converts a binary number to a decimal number.
  
</div>
+
== Description ==
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
  
BIN2DEC
+
BIN2DEC(number,places)
  
</div></div>
+
For example, BIN2DEC(101,3) ''returns 005'' as a result.
----
 
<div id="8SpaceContent" class="zcontent" align="left"> 
 
  
[javascript:ToggleDiv('divExpCollAsst_4') <font color="#000000"><font face="Arial, sans-serif"><font size="2">'''BIN2DEC'''</font></font></font>][javascript:ToggleDiv('divExpCollAsst_4') <font color="#000000"><font face="Arial, sans-serif"><font size="2">(</font></font></font>][javascript:ToggleDiv('divExpCollAsst_4') <font color="#000000"><font face="Arial, sans-serif"><font size="2">'''num'''</font></font></font>][javascript:ToggleDiv('divExpCollAsst_4') <font color="#000000"><font face="Arial, sans-serif"><font size="2">)</font></font></font>]
+
            BIN2DEC(11110) ''returns 30'' as a result.
  
<font face="Tahoma, sans-serif"><font size="1">[javascript:ToggleDiv('divExpCollAsst_4') <font color="#000000"><font face="Arial, sans-serif"><font size="2"><nowiki>=BIN2DEC(1100100) is 100</nowiki></font></font></font>]</font></font>
+
*This function is used to convert a binary number to a decimal number.
 +
 
 +
*Binary number is represented using digits 1 or 0 only. The number can also be entered in text format (e.g "101").
 +
 
 +
*The conversion can be obtained for a binary number upto 17 bits for positive numbers and 10 bits for negative numbers.
 +
 
 +
*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.
 +
 
 +
*'places' argument can be omitted. Then, Calci displays the octal output with minimum number of characters necessary.
 +
 
 +
*'places' is used for padding the output with leading '0's.
 +
 
 +
*A binary number (e.g '101') is converted to decimal number (base 2) as -
 +
(1*2^2)+(0*2^1)+(1*2^0)=4+0+1= ''5''
 +
 
 +
*If the number is not a valid number, 'Calci' returns an #ERROR message.
 +
 
 +
Below are few examples that show the use of combination of functions and get the result in decimal -
 +
 
 +
1)SUM(BIN2DEC(100),BIN2DEC(101)) ''returns 9'' as a result.
 +
 
 +
2)AVERAGE(BIN2DEC(100) + BIN2DEC(101)) ''returns 9'' as a result.
 +
 
 +
3)BIN2DEC(110)+BIN2DEC(101)-BIN2DEC(100) ''returns 7'' as a result.
 +
 
 +
== Examples ==
  
</div>
 
----
 
<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">
 
<div id="2SpaceContent" class="zcontent" align="left">
  
 
{| id="TABLE3" class="SpreadSheet blue"
 
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
|- class="even"
| class=" " |
+
| class=" " | '''Binary Input'''
| Column1
+
| class="  " | '''Decimal Output'''
| class="  " | Column2
+
 
| Column3
 
| Column4
 
 
|- class="odd"
 
|- class="odd"
| class=" " | Row1
 
 
| class="sshl_f" | 100
 
| class="sshl_f" | 100
| class="sshl_f" |
+
| class="sshl_f" | 4
| class="sshl_f" |
+
 
| class="sshl_f" |
 
 
|- class="even"
 
|- class="even"
| class=" " | Row2
+
| class="ssh1_f" | 11110,3
| class="sshl_f" |
+
| class="sshl_f" | 030
|
+
 
| class=" SelectTD SelectTD" |
 
<div id="2Space_Handle" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="2Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
|
 
 
|- class="odd"
 
|- class="odd"
| Row3
+
| class="ssh1_f" | 1010101010101010
| class="                                       sshl_f                 " |
+
| class="sshl_f" | 43690
|
+
 
|
 
|
 
 
|- class="even"
 
|- class="even"
| Row4
+
| class="ssh1_f" | 1111111111
|
+
| class="sshl_f" | 1023
|
+
 
|
 
| class=" " |
 
 
|- class="odd"
 
|- class="odd"
| class=" " | Row5
+
| class="ssh1_f" | 1111000000
|
+
| class="sshl_f" | 960
|
+
 
|
 
|
 
 
|- class="even"
 
|- class="even"
| Row6
+
| class="ssh1_f" | 1000000000
|
+
| class="sshl_f" | 512
|
+
 
|
 
|
 
 
|}
 
|}
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
==Related Videos==
----
+
{{#ev:youtube|tfKe8PPI2zs|280|center|BIN2DEC}}
 +
 
 +
== See Also ==
 +
 
 +
*[[Manuals/calci/BIN2HEX| BIN2HEX]]
 +
 
 +
*[[Manuals/calci/BIN2OCT| BIN2OCT]]
 +
 
 +
*[[Manuals/calci/DEC2BIN| DEC2BIN]]
 +
 
 +
*[[Manuals/calci/OCT2BIN| OCT2BIN]]
 +
 
 +
*[[Manuals/calci/OCT2BIN| HEX2BIN]]
 +
 
 +
==References==
 +
*[http://en.wikipedia.org/wiki/Binary_number#Conversion_to_and_from_other_numeral_systems Conversion of Binary Numbers]

Latest revision as of 05:51, 8 October 2015

BIN2DEC(number,places)

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

BIN2DEC() converts a binary number to a decimal number.

Description

BIN2DEC(number,places)

For example, BIN2DEC(101,3) returns 005 as a result.

            BIN2DEC(11110) returns 30 as a result. 
  • This function is used to convert a binary number to a decimal number.
  • Binary number is represented using digits 1 or 0 only. The number can also be entered in text format (e.g "101").
  • The conversion can be obtained for a binary number upto 17 bits for positive numbers and 10 bits for negative numbers.
  • 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.
  • 'places' argument can be omitted. Then, Calci displays the octal output with minimum number of characters necessary.
  • 'places' is used for padding the output with leading '0's.
  • A binary number (e.g '101') is converted to decimal number (base 2) as -
(1*2^2)+(0*2^1)+(1*2^0)=4+0+1= 5
  • If the number is not a valid number, 'Calci' returns an #ERROR message.

Below are few examples that show the use of combination of functions and get the result in decimal -

1)SUM(BIN2DEC(100),BIN2DEC(101)) returns 9 as a result.

2)AVERAGE(BIN2DEC(100) + BIN2DEC(101)) returns 9 as a result.

3)BIN2DEC(110)+BIN2DEC(101)-BIN2DEC(100) returns 7 as a result.

Examples

Binary Input Decimal Output
100 4
11110,3 030
1010101010101010 43690
1111111111 1023
1111000000 960
1000000000 512

Related Videos

BIN2DEC

See Also

References