address lines of 8051
Homework? OK in slow-motion:
If you've 1 address line you can describe 2 addresses (line is low: 1st address, line is high: 2nd address).
If there're 2 lines, there are 4 possible adresses (line1 low & line2 low; line1 high & line2 low; line1 low & line2 high; line1 high & line2 high).
So the number of addresses double with each additional address line. It can be calculated this way: NumberOfAddresses = 2^NumberOfAddresslines
Now I guess you want to address 5kBytes = 5 * 1024 Bytes = 5120 Bytes
Let's see:
2^1 = 2 (1st example above)
2^2 = 4 (2nd example above)
2^3 = 8
2^4 = 16
2^5 = 32
2^6 = 64
2^7 =128
2^8 = 256
2^9 = 512
2^10 = 1024
2^11 = 2048
2^12 = 4096 (too less for you)
2^13 = 8192 (sufficient to address 5120 Bytes)
So 13 address lines are needed for 5kBytes @ an 8-bit MCU like 8051.
But if you meant 5kBits the calculation would be different (5kBit = 640Bytes --> 10 address lines)!