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
digital
— Digital input signal to DAC
integer
Digital input signal to DAC, specified as an integer.
If theInput polarityparameter is set toBipolar
, the allowed range of the signal is [−2NBits-1, 2NBits1]。
If theInput polarityparameter is set toUnipolar
, the allowed range of the signal is [0, 2NBits-1].
Data Types:single
|double
|int8
|int16
|int32
|uint8
|uint16
|uint32
|fixed point
start
— External clock to start conversion
scalar
External clock to start conversion, specified as a scalar. The digital-to-analog conversion process starts at the rising edge of the signal at thestartport.
Dependencies
To enable this port, selectUse external start clockin theGeneraltab.
Data Types:double
Output
analog
— Converted analog output signal
scalar
Converted analog output signal, returned as a scalar.
Data Types:double
ready
— Indicates whether digital-to-analog conversion is complete
scalar
Indicates whether the digital-to-analog conversion is complete, returned as a scalar.
Dependencies
To enable this port, selectShow ready portin theGeneraltab.
Data Types:double
Parameters
General
Number of bits
— Number of bits in input word
5
(default) | positive real integer
Number of bits in the input word, specified as a unitless positive real integer.Number of bitsdetermines the resolution of the DAC.
Programmatic Use
Block parameter:NBits |
Type:character vector |
Values:positive real integer |
Default:5 |
Data Types:double
Input polarity
— Polarity of input signal to DAC
Bipolar
(default) |Unipolar
Polarity of the input signal to the DAC.
Programmatic Use
Block parameter:Polarity |
Type:character vector |
Values:Bipolar |Unipolar |
Default:Bipolar |
Use external start clock
— Connect to external start conversion clock
on (default) | off
Select to connect to an external start conversion clock. By default, this option is selected. If you deselect this option, aSampling Clock Sourceblock inside the Segmented DAC is used to generate the start conversion clock
Conversion start frequency (Hz)
— Frequency of internal start conversion clock
1e6
(default) | positive real scalar
Frequency of the internal start conversion clock, specified as a real scalar in Hz. TheConversion start frequency参数确定圣的转化率art of conversion.
Dependencies
To enable this parameter, deselectUse external start clock.
Programmatic Use
Block parameter:StartFreq |
Type:character vector |
Values:positive real scalar |
Default:1e6 |
Data Types:double
Reference (V)
— Reference voltage
2
(default) | real scalar
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, andBias (V)using the equation:
.
Programmatic Use
Block parameter:Ref |
Type:character vector |
Values:real scalar |
Default:2 |
Data Types:double
Bias (V)
— Bias voltage added to output
0
(default) | real scalar
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, andReference (V)using the equation:
.
Programmatic Use
Block parameter:Bias |
Type:character vector |
Values:real scalar |
Default:0 |
Data Types:double
Show ready port
— Enable ready port on block
off (default) | on
Select to enable thereadyport on the block. This option is deselected by default.
Impairments
Enable linearity impairments
— Enable offset and gain errors in DAC simulation
on (default) | off
Select to enable impairments such as offset error and gain error in DAC simulation. This parameter is selected. by default.
Offset error
— Shifts quantization steps by specific value
0 LSB
(default) | real scalar
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 erroris applied beforeReference (V)andBias (V).
Dependencies
To enable this parameter, selectEnable linearity impairmentsin theImpairmentstab.
Programmatic Use
Block parameter:OffsetError |
Type:character vector |
Values:real scalar |
Default:0 LSB |
Data Types:double
Gain error
— Error in slope of DAC transfer curve
0 LSB
(default) | real scalar
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 erroris applied beforeReference (V)andBias (V).
Dependencies
To enable this parameter, selectEnable linearity impairmentsin theImpairmentstab.
Programmatic Use
Block parameter:GainError |
Type:character vector |
Values:real scalar |
Default:0 LSB |
Data Types:double
Enable timing impairments
— Enable timing impairments in DAC simulation
on (default) | off
Select to enable timing impairments such as settling time or slew rate in DAC simulation. This parameter is selected. by default.
Specify switch timing using
— Specify how DAC calculates switch timing
Settling time
(default) |Slew rate
Specify whether the Binary Weighted DAC calculates switch timing using the settling time parameters or the slew rate parameters.
Dependencies
To enable this parameter, selectEnable timing impairmentsin theImpairmentstab.
Settling time (s)
— Time required for output to settle
2e-7
(default) | nonnegative real scalar
The time required for the output of the DAC to settle to within some fraction of its final value, specified as a nonnegative real scalar in seconds.
Dependencies
To enable this parameter, selectEnable timing impairmentsand setSpecify switch timing usingtoSettling time
in theImpairmentstab.
Programmatic Use
Block parameter:SettlingTime |
Type:character vector |
Values:real scalar |
Default:2e-7 |
Data Types:double
Settling time tolerance (LSB)
— Tolerance for calculating settling time
0.5
(default) | positive real scalar
The tolerance allowed for calculating settling time, specified as a positive real scalar in LSB. The output of the DAC must settle within theSettling time tolerance (LSB)bySettling time (s).
Dependencies
To enable this parameter, selectEnable timing impairmentsand setSpecify switch timing usingtoSettling time
in theImpairmentstab.
Programmatic Use
Block parameter:SettlingTimeTolerance |
Type:character vector |
Values:positive real scalar |
Default:0.5 |
Data Types:double
Rising slew rate
— Switch rising slew rate for DAC
5015625
(默认)|正真正的标量|正real vector
Switch the rising slew rate for the DAC, specified as a positive real scalar or vector. IfRising slew rateis scalar, it specifies the same slew rate for all the switches. IfRising slew rateis a vector of lengthNbits, it specifies the slew rate for each individual switch.
Dependencies
To enable this parameter, selectEnable timing impairmentsand setSpecify switch timing usingtoSlew rate
in theImpairmentstab.
Programmatic Use
Block parameter:RisingSlewRate |
Type:character vector |
Values:positive real scalar | positive real vector |
Default:5015625 |
Falling slew rate
— Switch falling slew rate for DAC
-5015625
(default) | negative real scalar | negative real vector
Switch the falling slew rate for the DAC, specified as a positive real scalar or vector. IfFalling slew rateis scalar, it specifies the same slew rate for all the switches. IfFalling slew rateis a vector of lengthNbits, it specifies the slew rate for each individual switch.
Dependencies
To enable this parameter, selectEnable timing impairmentsand setSpecify switch timing usingtoSlew rate
in theImpairmentstab.
Programmatic Use
Block parameter:FallingSlewRate |
Type:character vector |
Values:negative real scalar | negative real vector |
Default:-5015625 |
Model Examples
Version History
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)