hexadecimal

Number System Converter

I have stopped developing for Windows Phone – This app is no longer available

 

This is a simple app that performs conversion of numbers between different numbering systems; Binary, Octal, Decimal, Hexadecimal, and Binary-Coded Decimal (BCD). Starting from v1.1, the app supports fraction conversion also with accuracy of up to 12 binary digits.
More systems will be supported in the upcoming versions.
If you would like to suggest a feature for the next version or you have found an issue in the app, contact me on info (at) mohammedalani.com
This app supports Windows phone 7.5 and 8.

Winodws Phone store link:

http://www.windowsphone.com/s?appid=6ede0b59-f2dd-4022-bba2-db0ae14c0aa4

Changlog:

* v1.1: (Expected publishing date: Dec. 12th, 2012)

  • added BCD conversion.
  • added fraction conversion.

* v1.0:

  • published on Dec. 5th, 2012

A Gathering of Small Number Systems Conversions and Operations for WP7

* UPDATE: I have found many bugs and issues with this original code of this library. For an expanded (and working version) you can look at WP7NC.

I know its not too much but I gathered about 16 number-conversion operations and few logical operators in a small DLL for Windows Phone devs who might need it. The functions are:

[crayon lang=”vb”]Public Shared Function Dec2BinStr(ByVal Dec As Long) As String[/crayon]

Converts a decimal number into a binary number in the form of stringĀ  (ex: 10 becomes “1010”)

[crayon lang=”vb”]Public Shared Function Dec2BinAry(ByVal Dec As Long) As Integer()[/crayon]

Converts a decimal number into a binary number in the form of an array of ones and zeros.

[crayon lang=”vb”]Public Shared Function BinStr2Dec(ByVal Bin As String) As Long[/crayon]

Converts a binary number in the form of a string into a decimal number.

[crayon lang=”vb”]Public Shared Function BinAry2Dec(ByVal Bin() As Integer) As Long[/crayon]

Converts a binary array into a decimal number.

[crayon lang=”vb”]Public Shared Function HexStr2Dec(ByVal Hex As String) As Long[/crayon]

Converts a hexadecimal number int he form of a string into a decimal number.

[crayon lang=”vb”]Public Shared Function Dec2HexStr(ByVal Dec As Long) As String[/crayon]

Converts decimal number into a hexadecimal number in the form of string.

[crayon lang=”vb”]Public Shared Function HexStr2BinStr(ByVal Hex As String) As String[/crayon]

Converts a hexadecimal number in the form of a string into a binary number, also in the form of string.

[crayon lang=”vb”]Public Function BinStr2HexStr(ByVal Bin As String) As String[/crayon]

Converts a binary number in the form of a string into a hexadecimal number, also in the form of string.

[crayon lang=”vb”]Public Function BinStrAnd(ByVal Bin1 As String, ByVal Bin2 As String) As String[/crayon]

Perform bitwise AND operation between two binary numbers in the form of a string.

[crayon lang=”vb”]Public Function HexStrAnd(ByVal Hex1 As String, ByVal Hex2 As String) As String[/crayon]

Perform bitwise and between two hexadecimal numbers in the form of a string.

[crayon lang=”vb”]Public Function BinStrOr(ByVal Bin1 As String, ByVal Bin2 As String) As String[/crayon]

Perform bitwise OR operation between two binary numbers in the form of a string.

[crayon lang=”vb”]Public Function HexStrOr(ByVal Hex1 As String, ByVal Hex2 As String) As String[/crayon]

Perform bitwise OR operation between two hexadecimal numbers in the form of a string.

[crayon lang=”vb”]Public Function BinStrXOR(ByVal Bin1 As String, ByVal Bin2 As String) As String[/crayon]

Perform bitwise XOR operation between two binary numbers in the form of a string.

[crayon lang=”vb”]Public Function HexStrXOR(ByVal Hex1 As String, ByVal Hex2 As String) As String[/crayon]

Perform bitwise XOR operation between two hexadecimal numbers in the form of a string.

[crayon lang=”vb”]Public Function BinStrNot(ByVal Bin As String) As String[/crayon]

Perform bitwise NOT operation to a binary number in the form of a string.

[crayon lang=”vb”]Public Function HexStrNot(ByVal Bin As String) As String[/crayon]

Perform bitwise NOT operation to a hexadecimal number in the form of a string.

* UPDATE 02-12-2012: I have found out many minor mistakes in some of the conversion function. Thus, I have removed the file and re-written the library as an open-source project. More details can be found here.

Here is the download link:

NumberSystem.DLL v1.0 (10 kbytes)

 

If you have a suggestion to expand this library, please write it down in the comments or tweet it to me, and I’ll try to include it.