Module 3 · 12 min read · Free chapter
Data converters and semiconductor memories
An n-bit converter has a step of full scale divided by 2ⁿ and an ideal SNR of about 6.02n + 1.76 dB. R-2R ladders make accurate DACs with only two resistor values. A flash ADC is fastest, a SAR ADC takes n clocks and a dual-slope ADC is slow but very accurate. SRAM uses six transistors per bit, while DRAM uses one transistor and a capacitor and needs refresh.
Start from zero: crossing between analog and digital
The world is analog. Sound pressure, temperature and light vary smoothly, and so do the voltages from microphones and sensors. Processors, however, work only with numbers.
An analog-to-digital converter (ADC) measures a voltage and turns it into a binary number. A digital-to-analog converter (DAC) turns a number back into a voltage. Every phone call, music file, digital camera and smart meter depends on this pair.
The numbers must be stored somewhere. Semiconductor memories hold them, either permanently in ROM and flash, or temporarily and very fast in SRAM and DRAM.
This chapter covers sampling and quantisation, the main DAC and ADC types, and how each kind of memory stores a bit.
Why it matters. GATE EC asks resolution, ADC conversion time or a DAC output almost every year, and memory organisation questions appear in both EC and CS papers.
Sampling, quantisation and resolution
Converting a signal to digital involves two steps. Sampling measures it at regular instants, and quantisation rounds each measurement to the nearest of a fixed set of levels.
The sampling rate must be high enough. The Nyquist criterion says a signal with highest frequency must be sampled at:
If it is sampled more slowly, high frequencies fold down and appear as false low frequencies, called aliasing. An analog low-pass anti-aliasing filter before the ADC removes frequencies above . CD audio samples at 44.1 kHz to capture sound up to about 20 kHz. Sampling is treated fully in the signals chapters.
While the ADC works, the input must not change. A sample-and-hold circuit, a switch, a capacitor and a buffer, tracks the input and then freezes it. Its main specs are the acquisition time to charge the capacitor, the droop as charge leaks during hold and the aperture time uncertainty when the switch opens.
An -bit converter divides its full-scale range into levels. The step between levels is the resolution, or one LSB:
Some texts use in the denominator when the top code is defined to equal full scale; read the question's definition. Rounding to the nearest level gives a quantisation error of at most . For a full-scale sine wave, the best possible signal-to-noise ratio is:
Each extra bit adds about 6 dB.
Worked example. A 10-bit ADC with a 0 to 5 V range has a step of mV, a maximum quantisation error of about 2.4 mV, and an ideal SNR of about 62 dB.
Why it matters. Resolution, error and SNR per bit are among the most asked converter facts.
Digital-to-analog converters
A DAC adds up weighted contributions, one per bit. The most significant bit is worth half of full scale, the next a quarter, and so on.
The binary-weighted resistor DAC uses a summing op-amp with input resistors , , , …, , each switched to or ground by one bit. It is easy to understand but hard to build. An 8-bit version needs resistors spanning 128 to 1, all matched to better than one part in 256. Such a spread is impractical on a chip.
The R-2R ladder DAC solves this. It uses only two values, R and 2R. At every node of the ladder the resistance looking to the right is 2R, so the current splits equally in two at each node. Each bit's switch therefore receives half the current of the bit before it. For the inverting op-amp form:
Here is the MSB. Matching two values is easy, so R-2R ladders are standard in integrated DACs.
DAC quality is described by its resolution, its settling time to within ½ LSB of the final value, and its linearity. A monotonic DAC never gives a lower output for a higher code, which matters in control loops.
Worked example. A 4-bit R-2R DAC with V and receives code 1010. The output is V.
Why it matters. DAC output for a given code and the reason R-2R is preferred are standard questions.
Analog-to-digital converters
ADCs trade speed against size and accuracy. Four types cover most of the range.
The flash ADC compares the input with every level at once. A resistor string makes reference voltages, and comparators each say whether the input is above their level. An encoder turns this thermometer code into binary.
Conversion takes one step, so flash ADCs are the fastest, used in oscilloscopes and radar. But an 8-bit flash needs 255 comparators, and the count doubles with every bit.
The successive-approximation ADC (SAR) plays a guessing game. It sets the MSB of a register, converts the register with an internal DAC and compares with the input. If the DAC output is too high, the bit is cleared; otherwise it stays. Then it moves to the next bit.
This is a binary search, and it finishes in clock cycles whatever the input. SAR ADCs give a good balance of speed, power and size, and they are the most common type in microcontrollers.
The dual-slope ADC integrates the input for a fixed time , then integrates a known reference of opposite sign until the integrator returns to zero, counting the time . Then:
The result depends only on the ratio of times, not on the exact R and C, so it is very accurate. If is a whole number of mains cycles, 50 Hz hum averages out. It is slow, but ideal for digital multimeters.
The counter-ramp ADC counts up, converting the count with a DAC, until the DAC output passes the input. It can take up to clocks, so it is slow. A tracking variant counts up or down to follow the input.
High-resolution audio converters use the sigma-delta type, which samples very fast with a 1-bit quantiser and filters digitally.
| Type | Conversion time | Comparators | Typical use |
|---|---|---|---|
| Flash | 1 cycle | Very fast, low resolution | |
| SAR | n cycles | 1 | General purpose, microcontrollers |
| Dual-slope | Many ms | 1 | Meters, high accuracy |
| Counter-ramp | Up to cycles | 1 | Simple, slow |
Worked example. A 12-bit SAR ADC clocked at 1 MHz needs 12 µs per conversion. A counter-ramp ADC of the same resolution may need up to 4096 µs.
Why it matters. Comparator counts, SAR conversion time and dual-slope behaviour are favourite GATE and ESE questions.
Memory organisation and read-only memories
A memory is an array of cells, each holding one bit, arranged in words. A memory with words of bits is written . It has address lines, which a decoder turns into one selected row, and data lines. Its capacity is bits.
Larger memories are built from smaller chips in two ways. To widen the word, chips are connected in parallel, sharing address lines and supplying different data bits. To add more words, chips share the data lines, and the extra high-order address bits go to a decoder that enables one chip at a time.
Read-only memories keep their contents without power, so they are non-volatile. A mask ROM is programmed when the chip is made, and is the cheapest for large volumes. A PROM has fuses that the user blows once.
An EPROM stores charge on a floating gate, an isolated polysilicon layer inside a MOSFET's gate oxide. Trapped electrons raise the threshold voltage, which reads as a stored bit. Ultraviolet light through a quartz window erases the whole chip.
An EEPROM erases electrically, byte by byte, by tunnelling electrons off the floating gate. Flash memory uses the same principle but erases in large blocks, which makes the cells smaller and cheaper. NAND flash chains cells in series for the highest density and is used in phones, pen drives and SSDs. NOR flash allows fast random reads and is used to store program code.
Worked example. A memory with 16 address lines and 8 data lines holds bits, or 64 KB. Building it from 16K × 8 chips needs four chips and a 2-to-4 decoder on the top two address lines.
Why it matters. Address-line counts, chip counts and ROM types are quick GATE and JE questions.
SRAM and DRAM
Read-write memories that lose their data when power is removed are volatile. Two kinds dominate.
A static RAM (SRAM) cell is a tiny latch: two cross-coupled CMOS inverters holding a bit, plus two access transistors that connect it to a pair of bit lines when the word line is raised. That is six transistors per bit, the 6T cell. It holds its data as long as power is on, with no refresh, and it reads and writes in a nanosecond or less. Its size makes it expensive, so SRAM is used for processor caches and registers.
A dynamic RAM (DRAM) cell is one transistor and one capacitor, the 1T1C cell. A charged capacitor is a 1 and an empty one is a 0. The cell is four to six times smaller than SRAM, so DRAM gives gigabytes cheaply and is used for main memory.
The price is that the capacitor leaks. Every row must be read and rewritten, or refreshed, typically every 64 ms. Reading is also destructive: the tiny charge is shared with the much larger bit line, a sense amplifier detects the small voltage change, and the value is then written back. DRAM is therefore slower than SRAM and needs a memory controller.
| Property | SRAM | DRAM |
|---|---|---|
| Cell | 6 transistors | 1 transistor + 1 capacitor |
| Refresh | Not needed | Needed, about every 64 ms |
| Speed | Faster | Slower |
| Density and cost | Low density, high cost per bit | High density, low cost per bit |
| Use | Caches, registers | Main memory |
Why it matters. The SRAM and DRAM comparison, refresh and cell structure are standard GATE and ESE questions.
Descriptive lens: how this topic is asked in written papers
Written papers ask this topic in four ways:
- Explain the working of an R-2R DAC, a SAR ADC or a dual-slope ADC, with diagrams.
- Compare ADC types for speed, accuracy and hardware, or SRAM with DRAM.
- Compute resolution, quantisation error, SNR, DAC output or conversion time.
- Design a memory of a given size from smaller chips, showing the address decoding.
Practice questions (our own, not previous-year questions).
- Explain the working of a successive-approximation ADC with a block diagram, and show the steps for converting 6.3 V on a 4-bit, 0 to 16 V converter. (15 marks)
- Why is a dual-slope ADC insensitive to the exact values of R and C, and how does it reject mains interference? (10 marks)
- Design a 64K × 16 memory from 16K × 8 chips. How many chips are needed and how is the decoding arranged? (10 marks)
Answer plan for question 3.
- Note that two 16K × 8 chips in parallel make one 16K × 16 bank.
- Note that four banks are needed for 64K words, so eight chips in all.
- Assign 16 address lines: the lower 14 go to every chip and the upper 2 go to a 2-to-4 decoder.
- Connect each decoder output to the chip-select of both chips in one bank.
- Draw the data bus: one chip of each pair drives D15-D8 and the other D7-D0.
Quick revision
- An n-bit step is , the error is at most LSB, and SNR is about dB.
- Sampling needs , and a sample-and-hold freezes the input during conversion.
- A weighted DAC needs a wide resistor spread, while R-2R uses two values and halves the current at each node.
- A flash ADC uses comparators and one step, and a SAR ADC takes n clocks by binary search.
- A dual-slope ADC gives and is accurate and rejects hum, while a counter-ramp takes up to clocks.
- A memory has m address lines and n data lines.
- In ROM types, EPROM erases by UV, EEPROM by byte and flash by block.
- SRAM is a 6T latch with no refresh, while DRAM is 1T1C, needs refresh and reads destructively.