How to calculate kilobytes in a hex address range

WBahn

Joined Mar 31, 2012
32,714
can you explain this? "2 to A is 9"
2 to A isn't 9. But your addresses don't stop with A000, do they?

First work with something that is more familiar to you.

You have a bunch of boxes, each of which contains 4 envelopes. The boxes are numbered consecutively from 2000 to 7999 (in base-10). How many envelopes are there?

First, how many boxes are there?

What would you say to someone that took your answer and asked you to explain how 2 to 7 is 6?
 

MrChips

Joined Oct 2, 2009
34,632
Simple.

Convert the hex values to decimal. Do the subtraction and then add 1. Finally, divide by 1024.

For example,

0000 = 0
FFFF = 65535

FFFF - 0000 = 65535 - 0 = 65535
Add 1 gives 65536
Divide by 1024 gives 65536/1024 = 64K
 
Top