Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub BinToDec()
- denary = 0
- length = binaryTxt.Text.Length
- For x = 1 To length
- length = length - 1
- If binaryTxt.Text(length) = "1" Then
- denary = denary + (2 ^ (x - 1))
- End If
- Next
- End Sub
- Sub DecToHex()
- hexa = Hex(denary)
- Console.WriteLine(hexa)
- End Sub
- Sub HexToDec()
- denary = CInt("&H" & hexTxt.Text)
- End Sub
- Sub DecToBin()
- binary = Convert.ToString(denary, 2)
- Console.WriteLine(binary)
- End Sub
- Sub BinToHex()
- BinToDec()
- DecToHex()
- End Sub
- Sub HexToBin()
- HexToDec()
- DecToBin()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement