17

I am reading William Stallings' Operating Systems: Internals and Design Principles (Seventh Edition), and a passage about memory hierarchy got me confused. What does the author mean when he mentions a "greater cost per bit"?

Here is what the relevant paragraph on page 24 says:

As might be expected, there is a trade-off among the three key characteristics of memory: namely, capacity, access time, and cost. A variety of technologies are used to implement memory systems, and across this spectrum of technologies, the following relationships hold:

  • Faster access time, greater cost per bit
  • Greater capacity, smaller cost per bit
  • Greater capacity, slower access speed

I understand that the lower you go down the pyramid of the memory hierarchy the slower the access time.

Like, a magnetic disk or SSD card will have slower access times than the CPU registers or cache or the RAM.

But what does it mean for there to be a "greater cost per bit"? Does it slow down other processes to access this memory? That would seem counter-intuitive as the access times are supposed to be faster? Do they just take up more space and therefore there is less of it?

6 Answers6

26

The cost per bit is the monetary cost (i.e. in dollars and cents) per unit of memory, thats all, ie a way of saying "assuming the amount of memory required is the same". (You could equally say the cost per gig of memory - but mentioning the size implies a usage case. A bit is very arguably the smallest amount that can be stored)

davidgo
  • 73,366
26

The cost per bit is just the price you have to pay for specific amount of memory.

If some amount of brand X memory costs $20 and the same amount of brand Y memory costs $25, then brand X has better cost per bit. The cost per bit differences are much more pronounced when comparing different kinds of memory (SRAM, DRAM, flash, SSD...)

gronostaj
  • 58,482
3

In addition to these other answers that rightly mention that cost per bit is the amount of money per bit:

If you have memory that stores 1024 bytes, that's 8192 bits. If that memory cost you $10 then it would be $10(cost)/8192 bits, or $0.001220703125 per bit. If you had memory with a faster access time, maybe it would cost $20 instead, in which case you'd have $0.00244140625 per bit.

Faster access time: $0.00244140625  cost per bit 
Greater capacity:   $0.001220703125 cost per bit
Wayne Werner
  • 2,463
1

I think the bit that other answers are missing is what Stallings is saying about the perpetual relationship between the three scenarios:

Let's say you have some memory, any memory, that costs $10 for a 1GB stick with a 10ns access time...therefore $10/GB.

What Stallings is saying that if you want faster storage, it will cost more, say $15 per 1GB with a 5ns access time = $15/GB - a higher cost per bit, compared to the previous memory.

If you wanted larger sticks, it might cost you $15 for 2GB, this time lowering the cost per bit - $7.50 per GB. However this larger stick will have a slower access time, say 12ns.

However, you may be able to get a premium version of the larger stick that still has an access time of 10ns, but this would cost even more - perhaps $18 ($9/GB).

As Stallings says, "there is a trade-off among the three key characteristics of memory: namely, capacity, access time, and cost". And he correctly suggests that, just as this is currently the case, this was the case for previous technologies/generations of memory, and will be the case for future memory technologies/generations.

[1GB = (1024)(1024)(1024)(8) = 8589934592 bits. Therefore, literal cost per bit for our $10 memory (above) would be $0.0000000012 per bit]

CJM
  • 2,627
0

Note that the costs to add a bit to memory are in physics terms - ie energy. There's a cost in energy to add a bit to memory, and to remove one. See Susskind's lectures on world as Hologram.

Hal
  • 1
-1

Specifically, the CPU registers are the fastest, most expensive type of memory. They take up the most valuable real estate in the whole PC. The various levels of caches are further away from the actual computation, and electrical signal propagation time starts to be a consideration. You can't build the whole thing out of registers.

MountainMan
  • 6,070