Ask Experts Questions for FREE Help !
Ask
    Samjar's Avatar
    Samjar Posts: 1, Reputation: 1
    New Member
     
    #1

    Apr 22, 2009, 04:45 AM
    VB codes for creating scientific calculator
    If possible I need help on codes for converting numbers such as Binary to octal,Binary to Decimal number system, thnks in advance
    Perito's Avatar
    Perito Posts: 3,139, Reputation: 150
    Ultra Member
     
    #2

    Apr 28, 2009, 06:25 AM

    It would be simpler if you had a specific problem. But, I'll try to answer without too much comment.

    To convert a number in binary to decimal, the usual route is to break it down into its individual numerals. For example, the binary number, "1011", would be broken down into four digits, 1-0-1-1. There are a number of ways to do this. Starting with the numeral on the far right, you multiply the digit by 2^n where n is the bit number. Remember that "n" is 0 for the rightmost digit and 2^0 = 1. The result is, therefore:

    1 * 2^0 = 1
    1 * 2^1 = 2
    0 * 2^2 = 0
    1 * 2^3 = 8
    Add up the numbers 8+0+2+1 = 11 (decimal).

    You can do this for other bases except instead of using 2 to the power, you use 8 to the power (for octal) or 16 to the power (for hexadecimal), etc.

    To convert from decimal to any number base, simply divide by the base repeatedly. The remainders are concatenated in a string. As an example, I'll convert 238 (decimal) to octal (divide by 8) and hexadecimal (divide by 16):







    The remainders, in reverse order, are 356. Therefore, 238 (decimal) = 356 (octal).

    in Hexadecimal, we typically use the following set of numerals: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

    (E is the numeral corresponding to 14)



    So, 238 (decimal) = EE (hexadecimal). Note that the divisions are done using base 10 arithmetic. Only use the hexadecimal set of numerals when evaluating the remainder.

    The above are algorithms. If you need actual VB code, I can probably generate it.
    sadaha's Avatar
    sadaha Posts: 1, Reputation: 1
    New Member
     
    #3

    Nov 29, 2011, 10:45 PM
    Can you generate it sir to vb6
    hasiii's Avatar
    hasiii Posts: 1, Reputation: 1
    New Member
     
    #4

    Feb 7, 2012, 07:57 AM
    Give me a sorce code u ****erzzzzzzzzzzzzzz

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Vb 6.0 calculator [ 2 Answers ]

Please help me! On my prject , I need a source code of a vb 6.0 calculator please help. Tnx

Probability using TI-83 Plus Calculator [ 1 Answers ]

One medical textbook states that only 6% of th human population has blood type O-Negative. Assume that a simple random sample of 45 people are selected. A. Find the probability that 5 of the selected people have blood type O-Negative. Would this be considered unusual. Why or why not? B. Find...

Fertility Calculator ? [ 17 Answers ]

Hey friends, For last two months I am trying to get pregnant but no result... I suspect that I am trying in wrong date I mean not in fertility window... I have checked diff fertility calculator available online which aks your period date and cycle time etc... but every this is so confusion and...

TI-84 Plus Calculator [ 1 Answers ]

This is sort of a math question and it isn't. I just bought this calculator yesterday, and the book that came with it does not tell me how to program the Quadratic formula as well as other equations into this calculator. And someone I know in my class has the same one and told me that this can be...

How to do e-0.05 on a calculator [ 5 Answers ]

Hi there, What are the exact steps I press on a calculator to do the following: - 40e-0.05 I keep getting the wrong answer? Any help is appreciated


View more questions Search