Micro Firmware Tech Support

Notes on Math Used in Hard Drive Translation


Filename: HDMATH.TXT
WWW URL:  http://www.firmware.com/support/bios/hdmath.htm
FTP URL:  ftp://ftp.firmware.com/text/hdmath.txt
Author:   Terry Slade, Micro Firmware Technical Support
Revision: 07/27/97
Summary:  Some notes on exact sizes of BIOS limitations on hard drive
          sizes.

Just some rough notes to provide a reference for some confusing numbers. See also:

OVER4GB.TXT http://www.firmware.com/pb4ts/over4gb.htm

METRIC.TXT http://www.firmware.com/pb4ts/metric.htm


A sector is 512 bytes - this is true on all hard drives in the PC world and also applies to floppy disks.

This refers to formatted data capacity - a sector actually uses more than 512 bytes. 512 bytes are available for data storage. Throughout this document and in most discussions of hard drive capacity, all figures assume formatted capacity (512 bytes/sector).


A megabyte (MB) can be properly defined in two different ways:

"decimal megabyte" = 1,000,000 bytes (10 to the 6th power)

"binary megabyte" = 1,048,576 bytes (2 to the 20th power)
(also easily calculated as 1024 x 1024)


(Some of the values for MB and GB in this document are shown in
parenthesis to indicate binary MB and GB rather than decimal).


To convert decimal MB to binary MB:


decimal MB x 1,000,000
---------------------- = binary MB
1,048,576

To convert binary MB to decimal MB:


binary MB x 1.048576 = decimal MB


DOS FDISK shows drive capacity in binary megabytes.

Windows 3.x File Manager shows drive capacity in binary megabytes.

CMOS setup in older ROM BIOSes will show drive capacity in binary megabytes.

CMOS setup in newer ROM BIOSes (including all MFI BIOS upgrades) will show drive capacity in decimal megabytes.

CHKDSK shows capacity in decimal megabytes (actually total bytes).

Drive manufacturers report drive capacities in decimal megabytes.


Gigabyte - GB - (can be pronounced giga or jiga)
"decimal gigabyte" = 1,000,000,000 bytes (10 to the 9th power)

"binary gigabyte" = 1,073,741,824 bytes (2 to the 30th power)
(1024 x 1024 x1024)


BIOS Int 13 Limitation
Cylinders  limit is 1024 cylinders numbered 0-1023  (10 bits)
Heads      limit is 256 heads      numbered 0-255   (8 bits)
Sectors    limit is 63 sectors     numbered 1-63    (6 bits)

1024 x 256 x 63 = 16,515,072 sectors

16,515,072 x 512 = 8,455,716,864 bytes 8.4GB (7.9GB)


ATA Specification
Cylinders  limit is 65536 cylinders numbered 0-65535  (16 bits)
Heads      limit is 16 heads        numbered 0-15     (4 bits)
Sectors    limit is 255 sectors     numbered 1-255    (8 bits)

65536 x 16 x 255 = 267,386,880 sectors

267,386,880 x 512 = 136,902,082,560 bytes 136.9GB (127GB)


Combined BIOS Int13 and ATA Limitation
Cylinders  limit is 1024 cylinders numbered 0-1023  (10 bits)
Heads      limit is 16 heads       numbered 0-15    (4 bits)
Sectors    limit is 63 sectors     numbered 1-63    (6 bits)

1024 x 16 x 63 = 1,032,192 sectors

1,032,192 x 512 = 528,482,304 bytes 528MB (504MB)


CHS Translation (also called ECHS Translation - Extended CHS)
(cylinders are halved and heads doubled until cylinders are 1024 or less)


0-1024 cyls 16 heads
1025-2048 cyls 32 heads
2047-4096 cyls 64 heads
4097-8192 cyls 128 heads 8192-16384 cyls 256 heads 16385-32768 cyls 512 heads


Limit in BIOSes with 2.1GB Problem

Many older BIOSes erroneously allocate only 12 bits for the cylinder field in CMOS RAM.

Cylinders  limit is 4096 cylinders numbered 0-4095  (12 bits)
Heads      limit is 16 heads       numbered 0-15    (4 bits)
Sectors    limit is 63 sectors     numbered 1-63    (6 bits)

4096 x 16 x 63 = 4,128,768 sectors

4,128,768 x 512 = 2,113,929,216 bytes 2.1GB (1.97GB)


Limit in BIOSes with 4.2GB Problem

All versions of DOS including WIN95 are unable to handle the value 256 (or any value over 255) for the number of heads. Although this is a problem with the operating system, a newer BIOS should compensate for it, normally by using Assisted LBA translation, which limits the total heads value to 255 or by using a revised form of ECHS transalation, which adjusts 16 heads to 15 and increases the cylinder values by 16/15 before performing the normal ECHS translation.

8192 cylinders causes 16 heads to translate to 256
8191 cylinders causes 16 heads to translate to 128

Cylinders limit is 8191 cylinders numbered 0-8190 (13 bits) Heads limit is 16 heads numbered 0-15 (4 bits) Sectors limit is 63 sectors numbered 1-63 (6 bits)

8191 x 16 x 63 = 8,256,528 sectors

8,256,528 x 512 = 4,227,342,336 bytes 4.2GB 4227MB (3937MB)


8.4 GB Limitation
16384 causes 16 heads to translate as 256 heads.
16385 would cause 16 heads to translate as 512 heads which is beyond
the limits that a translating BIOS can handle.

Cylinders limit is 16384 cylinders numbered 0-16383 (14 bits) Heads limit is 16 heads numbered 0-15 (4 bits) Sectors limit is 63 sectors numbered 1-63 (6 bits)

16384 x 16 x 63 = 16,515,072 sectors

16,515,072 x 512 = 8,455,716,864 bytes = 8456MB = 8.5GB (8064MB, 7.875GB)

The ATA-3 spec says that a drive with over 8 heads should use no more than 16383 cylinders. One of the first 8.4GB drives, the Quantum Fireball SE uses these values:

16383 x 16 x 63 = 16,514,064 sectors

16,514,064 x 512 = 8,455,200,768 bytes 8.5GB 8455MB (8064MB, 7.875GB)


With Assisted LBA Translation the limit is lower:
The maximum translated values would be:

1024 x 255 x 63 = 16,450,560 sectors

16,450,560 x 512 = 8,422,686,720 bytes 8.4GB 8423MB

Maximum untranslated CHS values:

16320 x 16 x 63


With revised ECHS translation the limit is even lower:
The maximum translated values would be:

1024 x 240 x 63 = 15,482,880 sectors

15,482,880 x 512 = 7,927,234,560 bytes = 7927MB = 7.9GB

Maximum untranslated CHS values:

15360 x 16 x 63


Capacity Loss Due to Rounding During Translation

In translation algorithms, any non-whole numbers are rounded down to the nearest whole number. Depending on the factory CHS values used on a particular drive, there may or may not be a small loss in capacity due to rounding of non-whole numbers when the parameters are translated by the BIOS. This loss may vary with different types of translation.


Example using Maxtor 85120A 5.1GB
Factory CHS     9924 x 16 x 63 = 10,003,392 total sectors  

5,121,736,704 bytes 5.1GB
(4884MB, 4.77GB)

Assisted LBA 622 x 255 x 63 = 9,992,430 sectors
5,116,124,160 bytes 5.1GB
(4879MB, 4.76GB)


loss = 10962 sectors 5,612,544 bytes 5.6MB (5.35MB)

Standard ECHS 620 x 256 x 63 = 9,999,360
5,119,672,320 bytes 5.1GB
(4882.5MB 4.77GB)


loss = 4032 sectors 2,064,384 bytes

Revised ECHS 661 x 240 x 63 = 9,994,320
10585 x 15 x 63


loss = 9072 sectors 4,644,864 bytes


Example using Western Digital 22100 2.1GB
Factory CHS     4092 x 16 x 63 = 4,124,736 sectors

ECHS 1023 x 64 x 63 = 4,124,736 sectors - no loss

4092 is divided by 4 to get cylinders to 1024 or below. 4092 is divisible by 4 with no remainder, so there is no rounding.



(C) 1997 Micro Firmware, Inc.

SALES - SUPPORT - CONTACT - LINKS - HOME


Micro Firmware, Inc.
330 W. Gray Street
Norman, Oklahoma 73069-7111
Toll-Free Sales (USA/Canada): 1-800-767-5465 or 1-888-4-PC-BIOS
Support & Sales: +1 405-321-8333
Sales Department FAX: +1 405-573-5535
Technical Support FAX: +1 405-321-8342
Email: sales@firmware.com support@firmware.com

© 1998 Micro Firmware, Inc. - All Rights Reserved
While every attempt is made to ensure the accuracy of our support documents, Micro Firmware provides these documents on an AS-IS basis for information purposes only.