The answer is actual simple, but not well known to many people.
Hard drive manufactures uses 1,000 to represent every kilobyte of storage space. But 1 kilobyte actually equals 1,024 (or 2^10).
What this means is that your 320GB hard drive is actually 312.5GB (320GB / 1.024). However, that is the unformatted drive space. Once you format the drive, the format structure (FAT16, FAT32, NTFS) takes up some space as well. In this case the format structure takes up about 7.5GB. That leaves you with 305GB of storage.