Binary Weighted DAC

N-bit DAC based on R-2R weighted resistor architecture

  • Library:
  • Mixed-Signal Blockset / DAC / Architectures

Description

The R-2R DAC is one of the most common types of Binary-Weighted DACs. It consists of a parallel binary-weighted resistor bank. Each digital level is converted to an equivalent analog signal by the resistor bank.

The input/output transfer curve of the binary weighted DAC can be nonmonotonic, which means that the transfer curve can reverse its direction.

The R-2R DAC architecture is low resolution and consumes more power due to the large number of resistors required to implement the architecture.

Ports

Input

expand all

Digital input signal to DAC, specified as a scalar.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fixed point

Output

expand all

Converted analog output signal, returned as a scalar.

Data Types: double

Parameters

expand all

General

Number of bits in the input word, specified as a unitless positive real integer. Number of bits determines the resolution of the DAC.

Programmatic Use

  • Use get_param(gcb,'NBits') to view the current Number of bits.

  • Use set_param(gcb,'NBits',value) to set Number of bits to a specific value.

Data Types: double

Polarity of the input signal to the DAC.

Programmatic Use

  • Use get_param(gcb,'Polarity') to view the current Input polarity.

  • Use set_param(gcb,'Polarity',value) to set Input polarity to a specific value.

Frequency of internal start-conversion clock, specified as a positive real scalar in Hz. Conversion start frequency (Hz) determines the rate of the DAC.

Programmatic Use

  • Use get_param(gcb,'StartFreq') to view the current value of Conversion start frequency (Hz).

  • Use set_param(gcb,'StartFreq',value) to set Conversion start frequency (Hz) to a specific value.

Data Types: double

RMS aperture jitter added as an impairment to the start-conversion clock, specified as a real nonnegative scalar in seconds. Set RMS aperture jitter to zero if you want a clean signal from the clock.

Programmatic Use

  • Use get_param(gcb,'StartClkJitter') to view the current value of RMS aperture jitter (s).

  • Use set_param(gcb,'StartClkJitter',value) to set RMS aperture jitter (s) to a specific value.

Data Types: double

Reference voltage of the DAC, specified as a real scalar in volts. Reference (V) helps determine the output from the input digital code, Number of bits, and Bias (V) using the equation:

DAC output = ((Digital input code2Number of bits)Reference)+Bias.

Programmatic Use

  • Use get_param(gcb,'Ref') to view the current value of Reference (V).

  • Use set_param(gcb,'Ref',value) to set Reference (V) to a specific value.

Data Types: double

Bias voltage added to the output of the DAC, specified as a real scalar in volts. Bias (V) helps determine the output from the input digital code, Number of bits, and Reference (V) using the equation:

DAC output = ((Digital input code2Number of bits)Reference)+Bias.

Programmatic Use

  • Use get_param(gcb,'Bias') to view the current value of Bias (V).

  • Use set_param(gcb,'Bias',value) to set Bias (V) to a specific value.

Data Types: double

Impairments

Select to enable impairments such as offset error and gain error in DAC simulation. By default, this parameter is deselected.

Shifts quantization steps by a specific value, specified as a scalar in %FS (percentage full scale), FS (full scale), or LSB (least significant bit).

Offset error is applied before Reference (V) and Bias (V).

Dependencies

To enable this parameter, select Enable impairments in the Impairments tab.

Programmatic Use

  • Use get_param(gcb,'OffsetError') to view the current value of Offset error.

  • Use set_param(gcb,'OffsetError',value) to set Offset error to a specific value.

Data Types: double

Error in the slope of the straight line interpolating the DAC transfer curve, specified as a real scalar in %FS (percentage full scale), FS (full scale), or LSB (least significant bit).

Gain error is applied before Reference (V) and Bias (V).

Dependencies

To enable this parameter, select Enable impairments in the Impairments tab.

Programmatic Use

  • Use get_param(gcb,'GainError') to view the current value of Gain error.

  • Use set_param(gcb,'GainError',value) to set Gain error to a specific value.

Data Types: double

Introduced in R2020a