Reputation: 317
a) 2G b) 16G c) 32 G d) 64G
So I found my answer to be 8G. But according to the teacher it is d) 64 G. Can someone explain this?
I thought it’s 2^32 * 2 since there are 2 bytes per address, and then divide that by 2^30, because 2^30 bytes is 1 GB ?
Upvotes: 1
Views: 2838
Reputation: 365832
64 gigabits (Gib) = 8 gigabytes (GiB).
The problem is that none of the answers have units, only prefixes, so they're both right for a reasonable choice of unit.
Apparently since the bus width was given in bits, they want the memory capacity in bits. That makes some sense, but I'd still say the question is ambiguous and a trick question.
It's also ambiguous to me because they haven't told you whether each byte has its own address, or whether it's word-addressable only. (We only know from the correct answer being 64 Gib that it's word-addressable). Modern CPUs other than some DSPs almost all use byte-addressable memory, even if (like early DEC Alpha) they don't support loads narrower than a word. As @Kaz points out, it could be a word-addressable machine with 32-bit words where a word takes 2 bus cycles to transfer, so the question is under-specified even for finding the capacity in bits.
And if you're going to be technical about units, 1 GB is 10^9 bytes, while 1 GiB is 2^30 bytes in SI units. https://en.wikipedia.org/wiki/Gibibyte.
(Many people and lots of software don't bother with SI units, though, and use GB even for power-of-2 cases where they mean 2^30. SI's attempt to resolve the ambiguity hasn't fully caught on, perhaps because SI power-of-2 naming is ridiculous to say out loud. I've never heard anyone say or even type out "gibibyte" un-ironically without at least mocking the name, only use the abbreviations to be completely un-ambiguous that they mean power-of-2 units.)
Note that hard-drive vendors definitely mean power-of-10 GB or TB for hard-drive sizes, so they can put a larger number on the sticker, but 4GB of DRAM is definitely 4 GiB because RAM is naturally power-of-2 based.
Technically you don't know the size of a byte on the machine, so really you could only say 8 giga-octets (or 64 Gib). Machines with 9-bit bytes and other sizes other than 8 used to exist, but IDK if anyone's ever claimed their machine had 16-bit bytes instead of calling it a word-addressable machine like everyone else would. So this is not a real ambiguity unless you're purposely being weird.
Upvotes: 4
Reputation: 689
It's a really bad question, if nothing else.
It doesn't matter what the size of the of a 'word', or the number of data bits is. The address bus is - quite literally - 32 wires that can each be a 1 or a 0. That means the number of addresses is 2^32, or roughly 4 billion |(which we call 4G)
16 data bits is two bytes per address, so one could argue the 'total size of the memory' is 8 GB. That is the same as 64 gigabits, since 8 its per byte.
Trick question.
Upvotes: 0