2^n programmable gain amplifier

I was trying to design a circuit for conditioning a signal from a photodiode. I needed an amplifier to buffer and amplify the signal before sampling it with an ADC. However, the signal from a photodiode can have a high dynamic range, and I wasn't sure if the ADC can cover that. Instead of using a higher resolution ADC, I read about the programmable gain amplifier.

A programmable gain amplifier can be useful when sampling a signal that has a higher dynamic range than the resolution of the ADC allows. It's similar to setting the exposure of a camera when taking a picture; even though the scene can have a higher dynamic range than the camera can capture, the exposure can be set so that the camera does capture the most interesting part. Essentially, the dynamic range of the ADC is “shifted” to cover the full range of the signal.

There are several PGA ICs available, such as Linear LTC6910, Maxim MAX9939, Microchip MCP6S21, and TI PGA112. I figured I could also build one using an ordinary op-amp. Here's an article I found with two reference designs.

I also came up with an alternative arrangement that is capable of 1x to 128x gain in 2^n steps:

2^n PGA schematic

Unlike the circuits in the article above, this PGA design only requires 3 digital signals for gain control, and it only requires three different resistor values. Also, instead of requiring analog switches, this PGA uses only MOSFETs. On the downside, this circuit has a fairly poor bandwidth when the gain is low, due to MOSFET parasitic capacitances.

How many exa-exa-exactly?

Yesterday I was reading the Wikipedia article on petabytes, and it mentions one pebibyte (10245) is more than 12% larger than one petabyte (10005). Makes sense, since it's an exponential relationship. This difference is well-known when talking about hard drives.

So I wondered if hard drives keep getting larger and larger, how large do you have to get, for 1024x bytes to be twice as many as 1000x bytes:

  1. 1024^x=2*1000^x
  2. 1024^x/1000^x=2
  3. (1024/1000)^x=2
  4. x ln{1024/1000}=ln{2}
  5. x=0.30103/0.0103
  6. x{approx}30

Therefore, half of 102430 bytes is approximately 100030 bytes, which is equivalent to:

  • 1 giga-giga-giga-giga-giga-giga-giga-giga-giga-gigabytes, or
  • 1 peta-peta-peta-peta-peta-petabytes, or
  • 1 exa-exa-exa-exa-exabytes, or
  • 1,000,000,000 hella-hella-hellabytes

So in the (distant) future, when you go buy a 1 exa-exa-exa-exa-exabyte hard drive, don't be surprised if it's only 0.5 exbi-exbi-exbi-exbi-exbibytes.