Paging is a memory management method that divides the virtual address space of a process into K-byte sized blocks called pages, and the physical memory (RAM) into blocks of the same size called page frames. This process requires a log2(K)-bit offset, which indexes through the page frame. During the process:
Each N-bit virtual address is split into the offset (log2(K) least significant bits), and an [N−log2(K)]-byte virtual page number (VPN), which is used to index through the page table, and find the desired PTE:
\begin{document}\begin{tikzpicture} % Draw the inner boxes for Metadata \draw[thick, fill=darkgray] (-.5,3) rectangle (3,4) node[midway] {VPN}; % Draw the inner boxes for Data \draw[thick] (3,3) rectangle (5,4) node[midway, align=center] {Offset}; % Add offset numbers \node at (-.5, 4.25) {$N-1$}; \node at (3, 4.25) {$\log_2(K)-1$}; \node at (5, 4.25) {0};\end{tikzpicture}\end{document}
Each M-bit physical address is split into the same offset, and an [M−log2(K)]-byte physical page number (PPN), used as the starting index of the page frame.
\begin{document}\begin{tikzpicture} % Draw the inner boxes for Metadata \draw[thick, fill=darkgray] (-.5,3) rectangle (3,4) node[midway] {PPN}; % Draw the inner boxes for Data \draw[thick] (3,3) rectangle (5,4) node[midway, align=center] {Offset}; % Add offset numbers \node at (-.5, 4.25) {$M-1$}; \node at (3, 4.25) {$\log_2(K)-1$}; \node at (5, 4.25) {0};\end{tikzpicture}\end{document}