• DaleGribble88@programming.dev
    link
    fedilink
    English
    arrow-up
    32
    ·
    15 days ago

    Marketing says it has 1,000,000,000,000 bytes, aka 1 Trillion bytes. SI unit naming conventions dictate that is 1 Tera-of-bytes.

    Computers work with powers of 2 (Like 2, 4, 8, 16, 32, …), and wouldn’t you know that 2^10 is 1024. So computer scientist will use 1024 as a stand in for Kilobyte because it makes a lot of the math elsewhere much easier.

    So, when you buy a 1TB hard drive, the manufacturer is advertising it at 1 Trillion bytes. However, your operating system, like Windows or Linux or MacOS, divides by 1024 when doing the conversion like so: 1 Trillion / 1024 / 1024 / 1024. That works out to just over 931.

    To help avoid confusion, the proper term for the 1024 number is a “Kibibyte,” abbreviated KiB, instead of a “kilobyte,” abbreviated KB. Similar names exist for Mebibytes, Gibibytes, Tibibytes and beyond!

    TL;DR Your box is measured in TB and your computer measures in TiB because 1st number is bigger and 2nd number is actually useful.

    • unitedwithme@lemmy.today
      link
      fedilink
      arrow-up
      11
      ·
      15 days ago

      Exactly this! MiB and MB were used interchangeably 30+years ago and MB stuck probably because if was easier to say and remember. Plus, 1000 bytes vs 1024 bytes wasn’t a big difference, same with 1,000KB vs 1,024KB. I recall Windows XP seeing my 16GB flash drive as 14.5GB. Now my 16TB drives are “14.5TB”.

    • Siru@discuss.tchncs.de
      link
      fedilink
      arrow-up
      7
      ·
      15 days ago

      For the record, this is just windows. MacOS and (most) flavors of Linux use the standard SI units. And also, just because computers are base2 for the mathematics inside the processor, that doesn’t mean they have problems dealing with number other than 2^n. That would be equivalent to saying that humans can only use numbers like 10, 100, 1000 and nothing in between.

      (The only area where things do get difficult is calculating with fractional values, such as 1/3 because the count of decimals needed to represent can vary depending on the base. For example, 1/3 is difficult to represent in base10 because it is infinite 0.333… however in base3 it requires only a single ‘decimal’/fractional digit 0.1.)

      • DaleGribble88@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        14 days ago

        Good to know about MacOS and Linux. I usually never turn on the human readable mode on my distros because most are VMs.

        Anyway, computers absolutely work best with working with numbers 2^n. That gives the most amount of space per bit. Otherwise, we would end up using the same amount of transistors for a fewer number of states. They could also greatly complicate the ALU to determine if it suddenly entered a forbidden state. Two’s compliment would certainly be much more difficult.

        Submitting would be nearly impossible too