Digitally Controlled Current Sink in VHDL-AMS for CADENCE

(Last Updated On: May 23, 2018)

The following current sink vary it current value depending on the 8 bit digital input. For each increment of the input the current increase one step declared as generic parameter in VHDL. For this case the generic parameter is named “rate” and given the value of 0.5 uA.

The digital controlled current sink is a current sink, which drains a proportional current in function of the digital input signal. For this case an 8-bit vector is used as an input. The minimum step-size of the current source is 1uA. For example; a CurrentInput of 30 will generate a current sink of 30 uA.

For each increment of the input the current increase one step declared as generic parameter in VHDL. For this case the generic parameter is named “rate” and given the value of 1 uA.

For test this module the control signal (std_logic_vector) is provided from the counter block.

After the simulation:

Analog model

An analogue model was created for the mixed signal circuit, to compare it with the digital model.

schematic of the digitally controlled current sink

Thermometer Coder

The thermometer or unary code is needed in the current sink to drive the 256 branches of 1 uA. The thermometer code converts a n-bit number into a series of ones followed by zeroes of size 2^n. In this case we are transforming an 8bit input vector into a 256 output vector.

The thermometer coder block is written in VHDL and tested on the next Figure.

Testing

A separated test bench was used for the current sink, as shown in the Figure 15. The previous explained counter is here reused as stimuli to create an increasing and decreasing ramp as shown in the Figure 16.

Test bench for the analogue current sink

The test signal is a ramp like the following:

counter ramp signal for test the behavior of the current sink

Functionality test of the thermometer coder

Digital versus analogue model

Theoretically, the digital and analogue model should behave identically. But this should be tested. For the current sink, the analogue model performs similar, but slightly different.

The digital model behaves as programmed, each step of the input is translated into current linearly, as shown in the following Figure.

Digital model of the current sink

In the following Figures, the digital and analogue model are compared:

Analogue current sink model

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top