+ Post New Thread
Results 1 to 4 of 4

24th September 2012, 11:25 #1
 Join Date
 Apr 2010
 Location
 tunisia
 Posts
 54
 Helped
 0 / 0
 Points
 901
 Level
 6
HDL coded digital to bcd (binarycodeddecimal) conversion
Hi all,
In the process of digital to analog conversion, the thermometer code output, corresponding to the digital value of the input signal, activates the unit value of the analog entities (which may be current or voltage sources). The analog output is the summation of all those activated analog entities.
Please can any one help me or give me examples how can i describe this process unsig VHDL or HDL code?
thanks a lot!

Advertisment

24th September 2012, 21:37 #2
 Join Date
 Apr 2011
 Location
 Minneapolis, Minnesota, USA
 Posts
 12,407
 Helped
 2464 / 2464
 Points
 50,445
 Level
 54
Re: HDL coded digital to bcd (binarycodeddecimal) conversion
Say you are using 8 bits. Then a value can occupy a range from zero to 255.
Say zero represents 0V, and 255 represents 5V. Then you can use a simple proportion to translate any value to a voltage.
To model this in electrical terms, each analog voltage is derived by sending 5 volts through resistors of different values.
Similarly each bit is weighted. You multiply it by a power of 2.
So if you have 8 bits...
The most significant bit is multiplied by 64 (2^7). The least significant bit is multiplied by 1 (2^0).
Sum all eight values. The total is scaled to whatever is the maximum voltage you would get if the value were all 1's.

Advertisment

26th September 2012, 09:43 #3
 Join Date
 Apr 2010
 Location
 tunisia
 Posts
 54
 Helped
 0 / 0
 Points
 901
 Level
 6
Re: HDL coded digital to bcd (binarycodeddecimal) conversion
can you please give me an example how can i write it with vhdl or verilog code?

Advertisment

26th September 2012, 10:39 #4
 Join Date
 Apr 2011
 Location
 Minneapolis, Minnesota, USA
 Posts
 12,407
 Helped
 2464 / 2464
 Points
 50,445
 Level
 54
Re: HDL coded digital to bcd (binarycodeddecimal) conversion
Sorry, I'm not familiar with those languages.
If your question is about how to turn on a wire representing each bit, then:
Look at the least significant bit (2^0) of the number.
If it is 1, then turn on the corresponding wire. If it is 0 then turn it off.
Go on to the next bit. Etc.
The wires go to weighted resistors. Here is a schematic showing one type of network:
+ Post New Thread
Please login