π Lecture 42 β FLASH MEMORY ARRAY
π Overview: This lecture covers the internal structure and operation of FLASH memory arrays, explaining how data is stored and read using MOS transistors organized in rows and columns. It also provides a comprehensive summary of various memory types and introduces special memory architectures like FIFO and LIFO, which are crucial for connecting devices operating at different data rates.
ποΈ Topics Covered
The lecture begins with the organization of FLASH Memory Array, detailing the row and column structure, the role of control gates and source terminals, and the read operation based on stored charge. It then provides a Memory Summary table comparing SRAM, DRAM, ROM, EPROM, EEPROM, and FLASH. Following that, it discusses Special Type of Memories, focusing on the First In-First Out (FIFO) memory used as a buffer for devices with different data rates. Finally, it covers the implementation of FIFO memory using shift registers and its alternative implementation using RAM as a circular buffer.
π Lecture Summary
FLASH MEMORY ARRAY
The FLASH memory array is organized into rows and columns. The row line connects to the Control Gate of each MOS transistor, which acts as a single-bit storage cell. The number of transistors in a row depends on the data word size; for an 8-bit byte, eight cells are activated by a single row. Only one row is selected at a time. The Source terminals of all transistors in a column are connected to a common column line. Figure 42.1 illustrates this structure.
When a row is selected (e.g., row 2), all transistors with Gates connected to that row line are activated. Current flows through a selected transistor if its corresponding column select line is activated and the transistor Gate has no stored charge. A stored charge on the gate prevents current flow. For example, if column select 0 is activated but the transistor in that column has a stored charge, no current flows. If column select 1 is activated and its transistor has no charge, current flows.
π Definition β Active Load: A component at the end of each column line that produces a voltage drop when current flows.
The presence or absence of current in each column line is detected. Current flow creates a voltage drop across the active load; no current means no voltage drop. A comparator compares the voltage across each active load with a reference voltage. If there is a voltage drop (current flows), the comparator output is 0. If the voltage drop is 0V (no current), the comparator output is 1. Therefore, the comparator output is the inverse of the stored logic value (stored charge = 1, no charge = 0).
π‘ Why this matters: The FLASH memory cell uses a single transistor with a floating gate to store charge. The read operation is non-destructive and relies on sensing current, making it fast and suitable for non-volatile storage.
Memory Summary
A summary of memory types and their key characteristics is presented in Table 42.1.
- SRAM: Non-volatile? No. High density? No (requires 6 transistors per latch). Uses one-transistor cell? No. In-system writable? Yes.
- DRAM: Non-volatile? No. High density? Yes (one transistor + one capacitor). Uses one-transistor cell? Yes. In-system writable? Yes.
- ROM: Non-volatile? Yes. High density? Yes. Uses one-transistor cell? Yes. In-system writable? No.
- EPROM: Non-volatile? Yes. High density? Yes. Uses one-transistor cell? Yes. In-system writable? No.
- EEPROM: Non-volatile? Yes. High density? No (requires extra logic). Uses one-transistor cell? No. In-system writable? Yes.
- FLASH: Non-volatile? Yes. High density? Yes. Uses one-transistor cell? Yes. In-system writable? Yes.
Special Type of Memories
Two special memory types are implemented using shift registers: First In-First Out (FIFO) and Last In-First Out (LIFO). These are used in specific applications where data access order is critical.
First In-First Out (FIFO) Memory
FIFO memories are used to connect digital devices operating at different data rates. For example, a fast microprocessor connected directly to a slow keyboard would waste time waiting. A keyboard buffer (a FIFO memory) is used instead. The keyboard writes keystrokes to the buffer, and the microprocessor reads them when it can, without being idle.
π Definition β FIFO Memory: A memory where the first data written is the first data to be read out.
Data is written and read in the same sequence. As shown in Figure 42.2c, data values (7, 9, 1, 0, 3) are written in order. When device B consumes the first two values (7 and 9), the remaining values (1, 0, 3) shift towards the head of the buffer. New data (5, 6, 1, 2) can then be appended.
π Example β FIFO Operation: Data produced in sequence 7, 9, 1, 0, 3. The first two values (7 and 9) are consumed. The buffer now contains 1, 0, 3 at the head. Four new values (5, 6, 1, 2) are appended to the empty locations.
FIFO Implementation using Shift Registers
A FIFO can be implemented using shift registers, as shown in Figure 42.3. An Input Buffer holds incoming data. The Shift Register Control circuit shifts the data to its appropriate location. The Input Control Logic activates an Input Ready signal when the buffer can accept new data. Data is output via an Output Buffer. After data is read, the Shift Control shifts the buffer contents towards the right, moving the next data value to the Output Buffer. An Output Ready signal indicates data is available for reading.
Implementing FIFO memory using RAM
For larger buffers, computers implement FIFO memory by reserving a part of their RAM. This is done as a circular buffer (Figure 42.4). Two registers, a Buffer Input Address Register and a Buffer Output Address Register, point to the locations for the next write and next read respectively. These addresses are updated (incremented and wrapped around) as data is written and read.
β Key Takeaways
A FLASH memory cell stores a bit by trapping charge on the gate of a single MOS transistor, and reading is done by sensing current flow through the transistor when its row and column are selected; the comparator output is inverted relative to the stored charge. The comparison table highlights that FLASH memory is unique in combining non-volatility, high density (one transistor per cell), and in-system write ability. FIFO memories are essential for rate-matching between devices and operate on a first-in, first-out principle, implemented either with dedicated shift registers for small buffers or with RAM using a circular buffer for larger systems. The key difference between the shift-register and RAM-based FIFO is that the shift-register physically moves data, while the RAM-based approach updates pointers to logical locations.
π§ Quick Revision Questions
- In a FLASH memory array, what is the relationship between the presence of a stored charge on a transistor's gate and the current flow when that cell is selected?
- What is the output of the comparator (0 or 1) when current flows through a selected cell in a FLASH array?
- Name four memory types that are both non-volatile and use a one-transistor cell.
- What is the primary purpose of a FIFO memory in a digital system?
- In a RAM-based FIFO buffer, what are the two registers used to manage the read and write operations?
π Lecture 43 β LAST IN-FIRST OUT (LIFO) MEMORY
π Overview: This lecture introduces the concept of Last In-First Out (LIFO) memory, commonly used to implement a stack in computer systems. It explains two primary implementationsβshift register-based and RAM-based stacksβand then covers essential memory system design topics including memory maps, memory expansion techniques, and address decoding. The lecture concludes with an introduction to Field Programmable Gate Arrays (FPGAs).
ποΈ Topics Covered
The lecture begins with the concept of LIFO memory and its analogy to a stack of plates. It then covers shift register-based stack implementation followed by the practical RAM-based stack using a Stack Pointer Register. The topics of memory expansion are discussed in detail, including how microprocessors access different data unit sizes. The concept of a Memory Map is introduced to show the division of address space. Practical methods for expanding both data unit size and memory locations using multiple RAM chips are explained. Finally, the lecture covers Address Decoders for selecting memory chips at specific base addresses and introduces the architecture of FPGAs.
π Lecture Summary
Last In-First Out (LIFO) Memory
Last In-First Out (LIFO) Memory, or a stack, operates like a stack of plates: the last item placed on top is the first one removed. In a register-based LIFO, data is "pushed down" when stored and "pulled up" when removed. A shift register-based stack uses Parallel In/Parallel Out registers connected so data shifts through them. For example, in a 5-byte LIFO, the first 8-bit value is stored in Register 1. To store a second value, the first is shifted to Register 2, and the second is written into Register 1. A maximum of five values can be stored. The last value stored in Register 1 is read out first, and the remaining values are pulled up.
π Definition β Stack: A LIFO data structure where the last element stored is the first element retrieved. π Example: A five-byte LIFO memory with Registers 1-5. Storing values 7, then 4, then 9: 7 goes to Reg. 1, then is pushed to Reg. 2 to make room for 4. 4 is then pushed to Reg. 3, and 9 goes to Reg. 1. Reading removes 9 first.
RAM Stack
A practical stack for program execution uses RAM memory, known as a RAM Stack. A special Stack Pointer Register stores the address of the stack top in RAM. As data is written (pushed) or read (popped), the Stack Pointer increments or decrements to always point to the top.
π Definition β Stack Pointer Register: A dedicated register that holds the memory address of the current top of the stack. π Example: Initially, the Stack Pointer is 0. Value '7' is stored at address 0. The Stack Pointer increments to 1, and value '4' is stored. After storing 4, 9, and 8, the Stack Pointer points to location 3 (value 8). Reading the top value (8) decrements the pointer back to 2, making 9 the new top.
Memory Expansion
Digital systems require different amounts of RAM and ROM. The total memory supported depends on the size of the microprocessor's address bus. A 16-bit address bus can access 2^16 (65536) unique memory locations. The data bus size determines how many bytes are accessed per address. An 8-bit data bus accesses one byte, while a 16-bit bus accesses two bytes. Modern microprocessors have up to 64-bit data buses. Memory devices are manufactured in fixed sizes (e.g., 1, 4, or 8-bit data units, and specific address ranges). To meet system requirements, these fixed-size chips are connected together.
π Formula: Addressable Locations = 2^(number of address bus lines) π Example: A 16-bit address bus can access 2^16 = 65536 locations. A 32-bit address bus can access 2^32 locations.
Memory Map
A Memory Map specifies the total addressable space of a microprocessor and how that space is distributed among RAM, ROM, stack, and buffers. It shows the base address of each memory block.
π Definition β Base Address: The starting address of a memory chip or block within the system's memory map. π Example: A 1 MByte memory map is divided into 16 blocks of 64 Kbytes each. Block 0 (base address 00000H) is for ROM. Block 1 (base address 10000H) is for data RAM. Block 2 (base address 20000H) is for program code RAM. The last block (base address F0000H) is for the stack.
Expanding Data Unit Size
To create a memory with a wider data unit (e.g., 16-bit word), multiple memory chips with narrower data units (e.g., 8-bit byte) are connected in parallel. The address lines of the chips are connected together so the same location is accessed. The data lines of each chip form different parts of the wider data bus. For example, two 4K x 8 RAM chips can form a single 4K x 16 memory. One chip holds the most significant byte (D8-D15) and the other the least significant byte (D0-D7).
π Example: Two 4K Byte RAM chips (A0-A11) with 8 data lines each. Their address lines are tied together. Chip A provides the upper byte (D8-D15), and Chip B provides the lower byte (D0-D7). The CS (Chip Select) and R/W lines are also tied together to select both chips simultaneously for a 16-bit read/write.
π‘ Why this matters: This technique allows any microprocessor to access data of its native word size, even if individual memory chips are byte-wide.
Expanding Memory Locations
To increase the total number of memory locations, multiple chips are connected in series or by using address lines to select between them. The data lines of the chips are shared, and a higher-order address line is used as a Chip Select to choose which chip is active at a given time.
π Example: To create an 8 KByte memory from two 4K Byte chips. The lower 12 address lines (A0-A11) connect to both chips. The 13th address line (A12) is used to select the chip. When A12=0, the first 4K chip (addresses 0-4095) is selected. When A12=1, it selects the second chip (addresses 4096-8191) via a NOT gate.
Expanding Data Unit Size and Memory Locations
Both techniques can be combined. Four 4K x 8 chips can form an 8K x 16 memory. Chips A and B form one 4K x 16 block, and chips C and D form a second 4K x 16 block. The ( \overline{CS} ) lines of A and B are tied together, and the ( \overline{CS} ) lines of C and D are tied together. The A12 address line selects which 4K x 16 block is active.
π Example: Chips A & C store the upper byte, B & D store the lower byte. A12=0 selects chips A and B (4K word block 0). A12=1 selects chips C and D (4K word block 1).
Address Decoders
An Address Decoder is a circuit that detects a specific Base Address from the microprocessor's address bus and generates a Chip Select (CS) signal for the appropriate memory chip. This ensures only the desired memory chip responds to a given memory operation. Decoders can be implemented using logic gates (OR, NAND, NOT) or using m x n decoders like 2x4 or 3x8 decoders.
π Definition β Address Decoder: A digital circuit that uses the higher-order address lines to select a specific memory chip based on its assigned memory range. π Example: For three 4KByte chips at base addresses 0000H, 1000H, and 2000H, a 2x4 decoder takes A12 and A13 as inputs. Input 00 selects RAM1 (0000H), 01 selects RAM2 (1000H), and 10 selects RAM3 (2000H). Input 11 is vacant.
Introduction to FPGAs
A Field Programmable Gate Array (FPGA) is a more flexible device than a PLD. Instead of a single AND-OR array, an FPGA contains many Logic Blocks that can be individually programmed. These blocks are connected by programmable Row and Column Interconnects. The logic blocks connect to the outside world through programmable I/O Blocks. This architecture allows for the implementation of very complex digital circuits.
π Definition β FPGA (Field Programmable Gate Array): An integrated circuit containing an array of programmable logic blocks and interconnects that can be configured to perform any digital function.
β Key Takeaways
The LIFO stack is a fundamental data structure implemented either with shift registers or more practically using RAM and a Stack Pointer Register. Memory system design is determined by the microprocessor's address bus (for total addressable locations) and data bus (for data unit size). A Memory Map organizes the address space into regions for ROM, RAM, stack, and other uses. Memory chips can be combined in parallel to expand the data unit size (e.g., two 8-bit chips for a 16-bit word) or in series using an Address Decoder to expand the number of memory locations. Address Decoders, implemented with gates or decoder chips, are essential for selecting specific memory chips at their assigned Base Addresses. Finally, FPGAs offer a more advanced and flexible architecture than PLDs for creating complex digital systems.
π§ Quick Revision Questions
- Explain the difference between a shift register-based LIFO memory and a RAM-based stack, including the role of the Stack Pointer Register.
- A microprocessor has a 20-bit address bus and a 16-bit data bus. What is its total addressable memory space in bytes?
- How would you use two 4K x 8 RAM chips to create a single 4K x 16 memory? Describe the connections for address, data, and control lines.
- What is an Address Decoder and why is it necessary when connecting multiple memory chips to a microprocessor?
- What are the three main components of an FPGA (Logic Blocks, Interconnects, I/O Blocks) and how do they differ from the structure of a simpler PLD?
π Lecture 44 β THE LOGIC BLOCK
π Overview: This lecture details the internal structure of a Logic Block within programmable logic devices, focusing on the Look-Up Table (LUT) as a fundamental logic function generator. It then transitions to the critical topic of Analogue-to-Digital Conversion (ADC), explaining the necessity, process (sampling, quantization), and two major converter types: the high-speed Flash ADC and the slower but more precise Dual-Slope ADC used in measuring instruments.
ποΈ Topics Covered
The lecture begins by dissecting a Logic Element, explaining its components: the Look-Up Table (LUT), programmable selects, cascade logic, and flip-flop control. It details how an LUT memory implements logic functions and adders. The discussion then shifts to the need for Analogue-to-Digital conversion, covering the sampling and hold process, the Nyquist Criteria, and quantization. Finally, it presents the operational principles of the Flash A/D Converter and the Dual-Slope A/D Converter, including circuit diagrams, operating principles, and an example calculation for the Flash converter.
π Lecture Summary
The Logic Element
The Logic Element within a Logic Block features a Look-Up Table (LUT) with 4-inputs that can be programmed as a logic function generator for SOP functions, adders, and comparators. It has Carry In and Carry Out lines for expansion and Cascade Logic for connecting multiple LUTs. Two Programmable selects allow choosing between combinational (LUT) or registered (Flip-Flop) outputs. The Clock/Clear/Preset Select Logic controls the flip-flop's synchronous (Clock) and asynchronous (Clear, Preset) operations.
The Look-Up Table
The Look-Up Table is implemented using a memory element. For a three-variable SOP function, it requires a memory with 8 locations storing a single bit each. The three address lines represent variables A, B, C. Product terms included in the function store a logic 1; missing terms store a logic 0.
π Definition β LUT: A Look-Up Table is a memory element that stores the truth table of a logic function; the input variables act as address lines to select the stored output.
π Formula for SOP Implementation: F = Ξ£(mα΅’) For each minterm mα΅’, the corresponding memory location is programmed to '1'.
π Example: For function F = A'BC' + AB'C + ABC (minterms 2, 5, 7), memory locations 2, 5, and 7 store '1', and all others store '0'. When the address (A=0,B=1,C=0) is input, the output F=1.
A single-bit Full-Adder is implemented using a memory with 8 locations, each storing 2 bits (Sum and Carry_out). Address lines are A, B, and Cα΅’β.
π Example: For address 110 (A=1, B=1, Cα΅’β=0), the stored data output is 01, meaning Sum=0 and Cβα΅€β=1.
π‘ Why this matters: The LUT allows any arbitrary combinational logic function to be implemented simply by programming memory contents, making FPGAs reconfigurable.
Analogue to Digital Conversion
Real-world quantities (temperature, speech) are analogue (continuous), while digital systems process digital (discrete binary) information. Analogue to Digital (A/D) converters transform analogue signals into digital values for processing. Examples include mobile phones, digital thermometers, digital voltmeters, and CDs. The process involves sampling the analogue signal and holding it stable for conversion.
Sample and Hold Operation
A Sample and Hold circuit samples the analogue signal at regular intervals and holds the value stable for the A/D converter. The Nyquist Criteria states the sampling frequency must be at least twice the maximum frequency of the analogue signal to allow accurate reconstruction. Under-sampling loses information, while over-sampling provides higher accuracy but requires more processing time.
π Definition β Nyquist Criteria: To accurately reconstruct an analogue signal from its samples, the sampling frequency must be at least twice the highest frequency component of the original signal.
π Example: An analogue signal with a maximum frequency of 50 Hz must be sampled at a minimum frequency of 100 Hz (Nyquist rate). The sampled voltage must be held stable for the A/D converter to accurately digitize it.
Quantization
Quantization is the process of converting a sampled analogue signal into a digital code. The number of bits used determines the accuracy (resolution). More bits mean more quantization levels and a more precise digital representation.
π Definition β Quantization: Mapping a continuous range of analogue values into a finite set of discrete digital codes.
π Example: A 2-bit quantizer has 4 levels (00, 01, 10, 11) for a 0 to 220V signal: 00=0V, 01=0-73V (range), 10=74-146V, 11=147-220V. A 3-bit quantizer has 8 levels, providing finer granularity and higher accuracy. For an analogue signal ranging 0-31V, using a 4-level (2-bit) quantizer results in a coarse staircase representation of the original signal. A 16-level (4-bit) quantizer produces a much closer representation.
Operational Amplifier (Op-Amp)
An Operational Amplifier is a linear amplifier with high voltage gain, high input impedance, and low output impedance. It amplifies the difference between its inverting (-) and non-inverting (+) inputs. It is used as an Inverting Amplifier (gain = -Rf/Ri) and as a Comparator (output saturates to high or low based on which input is larger). A/D converters use Op-Amps as Integrators (by replacing Rf with a capacitor) and Comparators.
Flash Analogue-to Digital Converter
The Flash A/D Converter uses a resistor potential divider to create reference voltages for multiple Op-Amp comparators. The analogue input is applied to all comparators simultaneously. The comparator outputs drive a priority encoder that produces the binary output.
π Definition β Flash A/D Converter: The fastest type of ADC, using a parallel bank of comparators to simultaneously compare the input voltage against a set of reference voltages.
π Example (3-bit Flash Converter with Vα΅£βΥ’ = 8V): For an input of 4.2V, reference voltages are 7V, 6V, 5V, 4V, 3V, 2V, 1V. The comparators with reference voltages 1V, 2V, 3V output '1' (input > ref). Comparators with 4V, 5V, 6V, 7V output '0'. This binary pattern is encoded by the priority encoder to the binary value 100 (decimal 4).
A large number of comparators are required (2βΏ - 1 for n-bit). For a 4-bit converter, 15 comparators are needed. Flash converters are used for high-speed applications like video signal conversion but are expensive and power-hungry.
Dual-Slope Analogue to Digital Converter
The Dual-Slope A/D Converter is slower but accurate, commonly used in digital voltmeters. It integrates the input voltage for a fixed time, then discharges the integrator with a known negative reference voltage. The time to discharge is proportional to the input voltage and is measured by a counter.
π Definition β Dual-Slope A/D Converter: An ADC that converts an analogue voltage to a digital value by measuring the time required for an integrator to discharge from a voltage level proportional to the input.
π Operation:
- Phase 1 (Integration): Switch connects to Vα΅’β. Capacitor charges, creating a negative ramp at integrator output. Counter counts up from 0 for a fixed period
n(until terminal count). - Phase 2 (De-integration): At
t=n, switch connects to -Vα΅£βΥ’. Capacitor discharges, creating a positive ramp at integrator output. Counter continues counting from 0. - Termination: When integrator output reaches 0V, comparator disables the clock, and counter stops at count
m. - Result: The count
mis proportional to the input voltage Vα΅’β.
Higher Vα΅’β β more charge on capacitor β longer discharge time m β larger count value.
β Key Takeaways
You must remember that the Look-Up Table is the core of a logic block, implementing any combinational function by storing its truth table in memory. For Analogue-to-Digital conversion, the Nyquist Criteria dictates the minimum sampling frequency must be twice the signal's highest frequency. Quantization resolution, determined by the number of bits, directly impacts accuracy. The Flash ADC provides the fastest conversion using parallel comparators but is expensive, while the Dual-Slope ADC offers high accuracy by measuring the time to discharge an integrator, making it ideal for instruments like voltmeters.
π§ Quick Revision Questions
- What are the two programmable selects in a Logic Element and what do they select between?
- Explain how a 4-input Look-Up Table can be used to implement a full adder function.
- What is the Nyquist Criteria and why is it important in A/D conversion?
- Describe the operation of a 3-bit Flash A/D converter. How many comparators does it require and why?
- Explain the two phases of operation in a Dual-Slope A/D converter and how the counter value represents the input voltage.
π Lecture 45 β Successive-Approximation Analogue to Digital Converter
π Overview: This lecture covers the Successive-Approximation A/D converter, the most commonly used type for converting analogue signals to binary values. It explains its operation, components, and conversion process, then details common A/D converter errors and concludes with an in-depth look at Digital to Analogue Converters and their performance characteristics. Understanding this converter is crucial for applications requiring a balance of speed and accuracy.
ποΈ Topics Covered
The lecture begins with the Successive-Approximation A/D converter, detailing its components (SAR, DAC, Comparator) and step-by-step conversion process with a 5.2V example. It then discusses three types of Analogue-to-Digital Converter Errors: Missing Code, Incorrect Code, and Offset Error. The latter half covers Digital to Analogue Conversion, focusing on the Binary-Weighted-Input D/A Converter and the R/2R Ladder D/A Converter, concluding with five key performance characteristics: Resolution, Accuracy, Linearity, Monotonicity, and Settling Time.
π Lecture Summary
Successive-Approximation Analogue to Digital Converter
The Successive-Approximation A/D converter is the most commonly used A/D converter because it has a fixed conversion time and is faster than the Dual-Slope converter, though slower than the Flash converter. Its main components are the Successive Approximation Register (SAR), a Digital to Analogue Converter, and a Comparator. The analogue signal sample is applied to the comparator's non-inverting input. Initially, the SAR sets the most significant bit (MSB) to logic 1. The DAC converts this binary value to its equivalent analogue voltage, which is applied to the comparator's inverting input. If the input signal is larger, the comparator outputs logic 1, setting the MSB; otherwise, it resets it. This process repeats for all bits, with the SAR setting or resetting each bit based on the comparator's output.
π Definition β Successive-Approximation A/D Converter: An A/D converter that uses a binary search algorithm by comparing the input voltage with the output of a DAC controlled by a SAR to find the closest binary representation. π Example: Converting 5.2V with a 4-bit A/D converter (quantization steps of 1V). The process is shown in Table 45.1. The SAR first tries 1000 (8V), which is too high, so it resets the MSB. It then tries 0100 (4V), which is too low, so it keeps that bit. Next, it tries 0110 (6V), which is too high, so it resets that bit. Finally, it tries 0101 (5V), which is less than 5.2V, so the final binary output is 0101.
| Vin | SAR output | D/A output | Comparator output |
|---|---|---|---|
| 5.2 | 1000 | 8 | 0 |
| 5.2 | 0100 | 4 | 1 |
| 5.2 | 0110 | 6 | 0 |
| 5.2 | 0101 | 5 | 1 |
| Table 45.1 Successive-Approximation D/A Conversion |
π‘ Why this matters: The conversion time is fixed and depends on the number of bits (e.g., a 6-bit converter completes in 6 clock periods), making it predictable.
Analogue-to-Digital Converter Errors
A/D converters exhibit three types of errors: Missing Code, Incorrect Code, and Offset Error. These are typically tested using an ideal linear ramp input signal.
- Missing Code: This error occurs when a specific binary code is skipped in the output sequence. For example, in Figure 45.2a, the code '1001' is missing, and the output jumps from '1000' to '1010'. In a Flash converter, this is due to a failed comparator, causing the Priority Encoder to output the same code for two different analogue values.
- Incorrect Code: This error results from a particular bit being "stuck" at a fixed logic value (0 or 1). In Figure 45.2b, the bit next to the LSB is stuck at logic 0. This means analogue values 2 and 3 both produce the output '0000' and '0001' instead of '0010' and '0011', respectively.
- Offset Error: This error occurs when the binary output consistently represents a value higher than the actual analogue input. It is caused by a fault in the comparator circuit. The offset error can be compensated for, but missing and incorrect codes cannot.
π Example: Figure 45.2c illustrates an offset error of 2 volts. For every analogue input, the corresponding binary output represents a value that is exactly 2V higher.
Digital to Analogue Conversion
Digital binary signals are converted into analogue signals using D/A Converters. The two main types are the Binary-Weighted-Input D/A Converter and the R/2R Ladder D/A Converter.
Binary-Weighted-Input Digital to Analogue Converter
This converter uses a summing amplifier (Op-Amp) with a resistor network where each resistor's value represents the binary weight of its corresponding input bit. The current through each resistor is summed at the inverting input, and the output voltage is determined by the voltage drop across the feedback resistor (Rf).
π Definition β Binary-Weighted-Input D/A Converter: A D/A converter that uses a set of resistors with values proportional to the binary weights (e.g., R, 2R, 4R, 8R) of the input bits to generate a weighted sum of currents. π Example: For a 4-bit converter with resistors 1K (bit 0), 2K (bit 1), 4K (bit 2), and 8K (bit 3), and a feedback resistor of 2K ohms. If the input is 1000 (8 decimal), only the MSB (bit 3) is high (5V). Current = 5V / 8K = 0.625 mA. The total current through Rf is 0.625 mA. Vout = -(0.625 mA * 2K) = -1.25V. A full table of outputs is given in Table 45.2.
π Formula: Vout = -Rf * (V/R * bit0 + V/2R * bit1 + V/4R * bit2 + V/8R * bit3) π Important Note: This converter is not practical for many bits because it requires resistors with exact values that are multiples of each other, which is difficult to manufacture accurately.
The R/2R Ladder Digital to Analogue Converter
This converter overcomes the problem of needing many weighted resistors by using a ladder network with only two resistor values: R and 2R. The circuit's output voltage is determined by the Thevenin equivalent circuit of the ladder network for a given binary input.
π Definition β R/2R Ladder D/A Converter: A D/A converter that uses a network of resistors with only two values (R and 2R) to generate precise analogue voltages from binary inputs. It is easier to manufacture accurately. π Example: For binary input 0001, the simplified Thevenin equivalent circuit (Figures 45.5a and 45.5b) has a Thevenin voltage (Vth) of 0.625V and a series resistance of R. The current through Rf is I = 0.625V / 2R, and Vout = -I * Rf. Table 45.3 shows the outputs for all 16 combinations.
| Input | Vth (volts) | Current through Rf | Vout |
|---|---|---|---|
| 0001 | 0.625V | 0.625V/2R | -0.625V |
| 1000 | 5V | 5V/2R | -5V |
| 1111 | 9.325V | 9.325V/2R | -9.325V |
| Table 45.3 (Abbreviated) |
Performance characteristics of Digital-to-Analogue Converters
The performance of D/A converters is determined by five key parameters:
-
Resolution: The number of bits the converter can process. It is also expressed as the reciprocal of the number of discrete output steps as a percentage. For a 4-bit converter, resolution = (1/15) * 100 = 6.67%.
-
Accuracy: How close the actual output is to the expected output, expressed as a percentage of the full-scale output. Ideally, the accuracy should be Β±1/2 of the least significant bit (LSB). For an 8-bit converter with a full-scale of 64V, the LSB is 0.25V (250mV). The maximum allowed error is Β±125mV.
-
Linearity: The output voltage should form a straight line when plotted against the binary input. An offset error is indicated by a non-zero output when all input bits are 0.
-
Monotonicity: The output should always increase as the binary input increases. If the output ever decreases for an increased input, the converter exhibits non-monotonic behavior.
-
Settling Time: The time the D/A converter takes to settle within Β±1/2 LSB of its final value after a change in the binary input. For example, if the output changes from 1.250V to 250mV but reaches 375mV (Β±1/2 LSB) in 20 msec, the settling time is 20 msec.
β Key Takeaways
The Successive-Approximation A/D converter is a widely used converter that uses a binary search algorithm with an SAR, DAC, and comparator. Its conversion time is fixed and depends on the number of bits. A/D converter errors include Missing Code (failed comparator), Incorrect Code (stuck bit), and Offset Error (comparator fault), which can sometimes be compensated. For D/A conversion, the Binary-Weighted-Input method is simple but impractical for many bits, while the R/2R Ladder method is preferred for its use of only two resistor values. Key D/A converter performance specs include Resolution, Accuracy (ideally β€ Β±1/2 LSB), Linearity, Monotonicity, and Settling Time.
π§ Quick Revision Questions
- What are the three main components of a Successive-Approximation A/D converter?
- In the conversion example (5.2V to 4-bit binary), why did the SAR reset the MSB during the first step?
- What is the primary cause of a "Missing Code" error in a Flash A/D converter?
- What is the main advantage of the R/2R Ladder D/A converter over the Binary-Weighted-Input D/A converter?
- For an 8-bit D/A converter with a full-scale output of 10V, what is the maximum allowed error in mV for an output to be considered accurate ((\pm 1/2) LSB)?