I have a 32-bit system. 2^32 bytes of memory. Let’s say 4KB per page: 2^12 pages.
How does one determine the required number of pages? 2^32 / 2^12 = 2^20? So we have 20 bits for paging and 12 bits for offset?
Anyone have an example of how I could understand paging?
Your calculation is correct for a simple paging system, but things get more complicated for systems which allow variable sized pages (i.e. Pentium). Just be wary of the difference between virtual addressing and physical addressing… although your architecture might allow for 2^32 addressable bytes of memory, your actual hardware may have less or more memory.
If you want an example, just look up some university notes on operating systems… there are some lecs on memory management here.