Sizes in Computers (VERY IMPORTANT FOUNDATION)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyrinNew
    Senior Member
    • Feb 2024
    • 5168

    #1

    Sizes in Computers (VERY IMPORTANT FOUNDATION)

    Everything in networking is based on bits β†’ bytes β†’ IP





    What is a BIT?

    πŸ‘‰ A bit is the smallest unit of data






    bit = 0 or 1
    • 0 = OFF
    • 1 = ON





    What is a BYTE?

    πŸ‘‰ A byte = 8 bits






    1 byte = 8 bits







    Example:






    10101010 β†’ 1 byte










    What is an OCTET?

    πŸ‘‰ An octet = 8 bits (same as byte)


    In networking, we say:
    • byte β†’ general computing
    • octet β†’ networking (IP addresses)





    🎯 KEY IDEA





    1 octet = 8 bits = numbers from 0 to 255










    πŸŽ“ 2. Why 0–255?

    Because:


    2^8 = 256


    πŸ‘‰ So:






    0 to 255 = 256 values










    πŸŽ“ 3. Structure of IP Address

    Example:






    192.168.1.10







    This has 4 octets:






    [192] [168] [1] [10]







    Each one = 8 bits


    Total:






    4 Γ— 8 = 32 bits










    πŸŽ“ 4. The β€œBOX METHOD” (This is what you asked)

    This is how you convert numbers like 192 into bits





    Step 1 β€” Draw boxes

    Each octet has 8 boxes (bits)






    128 64 32 16 8 4 2 1
    [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]







    πŸ‘‰ These numbers are powers of 2





    πŸŽ“ 5. Example: Convert 192

    We need to make 192 using these numbers





    Step-by-step:





    192 - 128 = 64 β†’ use 128 β†’ put 1
    64 - 64 = 0 β†’ use 64 β†’ put 1







    Remaining = 0 β†’ rest are 0





    Final boxes:





    128 64 32 16 8 4 2 1
    1 1 0 0 0 0 0 0










    Final answer:





    192 = 11000000










    πŸŽ“ 6. Example: Convert 168




    Step-by-step:





    168 - 128 = 40 β†’ 1
    40 - 32 = 8 β†’ 1
    8 - 8 = 0 β†’ 1










    Boxes:





    128 64 32 16 8 4 2 1
    1 0 1 0 1 0 0 0










    Final:





    168 = 10101000










    πŸŽ“ 7. Example: Convert 1





    00000001










    πŸŽ“ 8. Example: Convert 0





    00000000










    πŸŽ“ 9. Full IP in Binary





    192.168.1.10 =
    11000000.10101000.00000001.00001010










    πŸŽ“ 10. VERY SIMPLE MEMORY TRICK

    πŸ‘‰ Think:






    Big numbers β†’ left side
    Small numbers β†’ right side










    πŸŽ“ 11. Shortcut Table (Memorize This)

    128 10000000
    192 11000000
    224 11100000
    240 11110000
    248 11111000
    252 11111100
    255 11111111


    πŸ‘‰ These are used in subnet masks





    πŸŽ“ 12. Why This Matters

    You need this to understand:
    • subnet mask
    • network vs host
    • AWS VPC
    • CIDR





    πŸŽ“ FINAL SUMMARY

    πŸ‘‰ bit = 0 or 1

    πŸ‘‰ 8 bits = 1 byte = 1 octet

    πŸ‘‰ octet = 0–255

    πŸ‘‰ IP = 4 octets = 32 bits

    πŸ‘‰ boxes = powers of 2

    πŸ‘‰ fill with 1s to reach number




    More...
Working...