0

Why does 2^10 represent 1KBytes, not 1Kbits?

2^10 = 1024 (round to 1K)

1 byte = 8 bits

For 1KBytes, it should be 2^13, not 2^10.

enter image description here

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Pingpong
  • 7,681
  • 21
  • 83
  • 209
  • Because 1KiB is 2^10 bytes, and it takes 10 address bits to address that amount of space. Why do you think it should be counting in bits at all? The smallest addressable unit of memory in most computer systems is a byte. – Peter Cordes Oct 09 '21 at 21:00
  • I know your point about the smallest addressable unit. But when you are dealing with bit manipulation, you have to consider bits, this is why the confusion is. E.g. 2^10 = 1Kbit, not 1KB. I am still confused. – Pingpong Oct 09 '21 at 21:34
  • Where is this table from? Why do you think it's about bit *manipulation*? 2^10 bits is 1 Kib (kibibits) = 128 bytes; 2^10 bytes = 1 KiB (kibibytes) = 8 Kib, if we're going to be exact with SI units and binary prefixes. You can never say 2^10 = 1 kbit because 2^10 is dimensionless, but 1 Kbit has a unit, [so their dimensions don't match; you might as well say 2 radians = 1 meter and be equally meaningless](https://stackoverflow.com/questions/69196826/how-do-you-get-rid-of-hz-when-calculating-mips/69204093#69204093). – Peter Cordes Oct 09 '21 at 22:00
  • 1
    One is KB the other is Kb ... – Surt Oct 10 '21 at 16:42

0 Answers0