问题
A computer has 16 address wires (address bus?) and 8-bit word size. What is the addressability?
I figured out that address space is 2^16 = 65536, but I still don't know how to calculate addressability.
I know addressability is the bytes each space occupies but how do I figure this out? Any help would be appreciated, especially some general formula associating word size/address bus with addressability.
I'm sorry if this question is super simple.
回答1:
Since there are 2^16 unique values you can put on the address bus, and you want to be able to address your memory with byte granularity, each value maps to a single byte.
If your machine always loaded say 64B cache lines, and your RAM was set up to deliver 64B bursts from a requested address, you'd only need 10 address lines to cover the same 64k of memory. The CPU would sort out which byte the load actually wanted internally, without needing to put the . (Or with 16 address lines, 2^16 * 64B addressability).
If you wanted bit-addressable memory, word-size = 1b, 2^16 bits is only 2^13 bytes.
In real life, memory controllers transfer addresses to DRAM in two halves, which cuts the number of address lines in half. See Ulrich Drepper's What Every Programmer Should Know About Memory which mentions that, but focuses on cache behaviour and how to optimize for it.
来源:https://stackoverflow.com/questions/32491045/what-is-the-addressability-given-number-of-16-address-wires-bus-and-8-bit-word