I want to be able to manual address a 4gb ddr4 memory stick. looking at the datasheet for ddr 4 there are only address pins from A0 to A17 which is 18 bits, 2^18 = 262, 144 address spaces. So how does it address 4gb? It would need 32 bits right?
These address pins are used in a multiplexed fashion for row and column addresses. Extremely simplified, it means that accessing 4 GB (which needs 32 address bits) only 16 address bits are sent at a time in two parts. In reality it is slightly more complicated as there are X rows and Y columns and Z banks in a single chip and there are multiple chips per memory module which all add up to the total module size.
The addressing is not straight forward as in 8080 interface. You can study in detail.
- Bank Group
There are many other control signals such as RAS and CAS.
Please go through the link above several times. Please ask more questions if you find something doubtful.