logotransparent.png

Legion of Learners

www.lol-101.com

  • Home

  • Classrooms

  • Courses

  • About Us

    • Executive Team
    • Board Members
  • Resources

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    sfolax6776
    Feb 06
      ·  Edited: Feb 07

    ACSL Elementary: Conversion between base 10 and base 2

    in CS Fundamentals for ACSL

    A. Notes:

    From the extensive exercises on counting in binary, we know:

    Convert from binary to decimal:

    Covert decimal to binary:


    Method 1:




    Method 2

    The remainder method: dividing the number by 2 recursively until you're left with 0, write all remainders backwards.

    1. Write down the decimal number.

    2. Divide the number by 2.

    3. Write the result underneath.

    4. Write the remainder on the right hand side. This will be 0 or 1.

    5. Divide the result of the division by 2 and again write down the remainder.

    6. Continue dividing and writing down remainders until the result of the division is 0.

    7. The most significant bit (MSB) is at the bottom of the column of remainders and the least significant bit (LSB) is at the top.

    8. Read the series of 1s and 0s on the right from the bottom up. This is the binary equivalent of the decimal number.




    B. HW:

    1. How many binary numbers have more 1’s than 0’s in the range of numbers from 16 to 31 in base 10 inclusive?

    2.






    3 comments
    0
    jyao.coding
    Feb 09

    binary ---> decimal:

    1. 179

    2. 258

    3. 45

    4. 154

    5. 8

    6. 16

    7. 32

    8. 64

    decimal ---> binary:

    1. 1111

    2. 100110

    3. 1000111011

    4. 10111001111

    0
    ygou88
    Feb 12

    binary to decimal:

    1. 179

    2. 358

    3. 77

    4. 154

    5. 8

    6. 16

    7. 32

    8. 64


    decimal to binary:

    1. 1111

    2. 100110

    3. 1000110111

    4. 100100011111

    0
    mysteryboxes4life
    Feb 13

    1. 179

    2. 258

    3. 87

    4. 154

    5. 8

    6. 16

    7. 32

    8. 64


    1. 1111

    2. 100110

    3. 1000110111

    4. 100100011111

    0
    3 comments

    Questions? Email us at legionoflearners@gmail.com or join our WeChat group!

    • lol-101dotcom

    ©2020 Legion of Learners