Why for a 64 bit machine the range for memory address ranges from 0 to 2^64?
Range of memory for a pointer
hello @Senjuti256
00000000000000 // 64 times
00000000000001
00000000000010
00000000000011
…
…
…
…
…
1111111111111111// 64 times
it will be total 2^64 in numbers.
why?
at each bit position we have 2 options either we put 0 or we put 1.
so for 64 such position we can have 2^64 distint number.
that is the reason why range of 64 bit is -> 0 – 2^64 - 1.
in general for x bit pointer.
it can point to address in range -> 0 to 2^x-1
Why are we subtracting 1?
let we have 2 bit number
00
01
10
11 // this 3 (2^2 -1)
for 3 bit number
000
001
010
011
100
101
110
111 // 7 -> 2^3-1
similarly for x bit number -> last address will be 2^x-1