CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Binary Numbers

  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Binary Numbers

    Need your help! Please.
    I did some exercises. It's binary numbers.
    But the problem is that i don't know if it's
    right. Maybe there are some mistakes and it
    would be perfect if somebody could look through and
    correct them. Thanks in advance.

    Here are my answers:

    b. Make the following calculations with 8 bit numbers. Show carries and indicate whether an overflow occurred.

    00101100
    + 00011101

    01100010
    +00100110

    3A
    +FB



    bold = overflow

    first: 01001001 overflow

    second: 10001000 overflow

    third: A+B = 15; 3+F+1=13 => 1354 => 30910

    d. In a base 4 number system, we have the digits 0,1,2 and 3. Convert the base-4 number 323104 to decimal, octal and hex. How many bits do we need to store the value in memory on a digital computer ( hint: convert to binary)
    0*1+1*4+3*16+2*64+3*256=948
    94810 = 11101101002
    10 digits = we need 10 bits to store it
    (here i didn't manage to do octal and hex )

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Binary Numbers

    What does this have to do with Java?
    You should be posting on a Math forum or you could just check your answers yourself using the Windows calculator which works in base 2, 8, 10 & 16.

    Convert the base-4 number 323104 to decimal, octal and hex.
    That isn't a base 4 number as it has a '4' in it, if it was in base 4 then it could only have the digits 0,1,2 and/or 3.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured