Compare the unit of subdivision
Paging divides an address space into fixed-size pages for mapping. Segmentation describes logical regions, such as code and data, using a base and a length. The essential comparison is not simply small regions versus large regions. Ask whether the allocation unit is fixed or variable and how the address identifies a location inside it. An architecture can combine the mechanisms, so they are not necessarily mutually exclusive product categories. The meaning of a segment also depends on the architecture being discussed. Use a simple base-and-bound segmentation model for the initial comparison, then explicitly identify any additional translation stage or special architectural rule.
| Aspect | Paging | Simple segmentation |
|---|---|---|
| Basic unit | Fixed-size pages | Variable-size logical regions |
| Address calculation | Page number and offset | Base and within-bound offset |
| Combination | Can coexist with other stages | Can precede paging |
Split a paged address into number and offset
With 4 KiB pages, virtual address 0x2345 splits into page number two and offset 0x345. Mapping page two to frame nine produces physical address 0x9345. Consecutive virtual pages can occupy separate physical frames. The page table records mappings and protection at the relevant granularity, but actual table structures need not be one flat array. Multilevel tables, larger pages and translation caches change implementation costs. First establish the fixed-size mapping calculation, then add the mechanisms used to represent and accelerate it. This keeps the address decomposition separate from assumptions about the number of memory accesses or the latency of every real translation.
Use a base and a bound for a segment
In a simple base-and-bound example, a segment starts at address 10000 and has length 3000 bytes. Offset 1200 is valid and reaches 11200. Offset 3500 lies outside the segment and must be rejected rather than blindly added to the base. Separate permissions for logical regions are a natural part of this model. The calculated target is not necessarily the final physical address in a combined design, however. It may feed another paging stage. Label the address produced at each stage instead of calling every intermediate result physical. The numbers illustrate one segmentation model and do not replace the exact bounds, descriptor and privilege rules of a particular instruction-set architecture.
Distinguish internal and external fragmentation
Fixed-size pages can leave unused space inside the final allocation unit. If a simplified allocator reserves whole 4096-byte pages for 5000 bytes, it reserves 8192 bytes and leaves 3192 unused. That is internal slack. In a simple segmentation system requiring each variable-length segment to occupy a contiguous physical region, enough total free storage can exist without a sufficiently long contiguous hole. That is an external-fragmentation problem. Real allocators and combined mechanisms have further techniques, so these are model-level trade-offs rather than universal measurements. Identify the layer performing the allocation and which continuity constraint applies before interpreting wasted-space figures or deciding that one mechanism has eliminated every kind of fragmentation.
Apply the comparison to a specific environment
Paging is central to many contemporary general-purpose operating systems, but it is too broad to claim that every segmentation-related architectural feature has disappeared. For example, x86-64 rules depend on execution mode and include special handling relevant to FS and GS. Conversely, an ordinary application is not necessarily designing arbitrary variable-size hardware segments whenever it allocates an object. Separate instruction-set mode, operating-system address spaces and library allocation. Then compare protection granularity, mapping-management cost, continuity requirements and sharing. This sequence makes the terminology useful without mistaking a teaching model for an exact description of every modern machine. Consult the architecture and OS contract before translating a conceptual trade-off into a configuration change.