Difference between revisions of "Manuals/calci/BIN2DEC"

From ZCubes Wiki
Jump to navigation Jump to search
Line 18: Line 18:
 
*The conversion can be obtained for a binary number upto 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.
 
*The conversion can be obtained for a binary number upto 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.
  
*Positive numbers can be from 0 (000000000) to 511 (111111111) or negative numbers -1 (1000000001) to -512 (1111111111).
+
*Positive numbers can be from 0 (000000000) to 511 (111111111) or negative numbers -1 (1000000001) to -512 (1111111111).
 +
 
 +
*A number preceding with '0' (e.g 01111111111) should be written in text format ("01111111111") to avoid confusion with octal numbers. 
  
 
*A binary number (e.g '101') can be converted to decimal number (base 2) as -
 
*A binary number (e.g '101') can be converted to decimal number (base 2) as -
Line 25: Line 27:
 
*If the number is not a valid number, 'Calci' returns an #ERROR message.
 
*If the number is not a valid number, 'Calci' returns an #ERROR message.
  
----
+
== Examples ==
<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>
 
 
 
</div>
 
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
 
 
BIN2DEC
 
 
 
</div></div>
 
----
 
<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>]
 
  
<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>
 
 
</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" | 4
 +
 +
|- class="even"
 +
| class="ssh1_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 +
 +
|- class="odd"
 +
| class="ssh1_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
| class="sshl_f" |
+
 
 
|- class="even"
 
|- class="even"
| class=" " | Row2
+
| class="ssh1_f" |  
 
| class="sshl_f" |
 
| class="sshl_f" |
|
+
 
| 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"
 
| Row3
 
| class="                                      sshl_f                  " |
 
|
 
|
 
|
 
|- class="even"
 
| Row4
 
|
 
|
 
|
 
| class="  " |
 
|- class="odd"
 
| class=" " | Row5
 
|
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
 
|}
 
|}
  
 
<div align="left">[[Image:calci1.gif]]</div></div>
 
<div align="left">[[Image:calci1.gif]]</div></div>
 
----
 
----

Revision as of 17:07, 12 November 2013

BIN2DEC(number)

  • Where 'number' is the binary number to be converted to decimal number.


Description

BIN2DEC(number)

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

            BIN2DEC(11110) returns 30 as a result. 
  • BIN2DEC() converts a binary number to decimal number.
  • Binaray 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 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.
  • Positive numbers can be from 0 (000000000) to 511 (111111111) or negative numbers -1 (1000000001) to -512 (1111111111).
  • A number preceding with '0' (e.g 01111111111) should be written in text format ("01111111111") to avoid confusion with octal numbers.
  • A binary number (e.g '101') can be 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.

Examples

Binary Input Decimal Output
100 4