+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Member level 3
    Points: 901, Level: 6

    Join Date
    Apr 2010
    Location
    tunisia
    Posts
    54
    Helped
    0 / 0
    Points
    901
    Level
    6

    HDL coded digital to bcd (binary-coded-decimal) 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!

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 50,445, Level: 54

    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 (binary-coded-decimal) 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.



    •   AltAdvertisment

        
       

  3. #3
    Member level 3
    Points: 901, Level: 6

    Join Date
    Apr 2010
    Location
    tunisia
    Posts
    54
    Helped
    0 / 0
    Points
    901
    Level
    6

    Re: HDL coded digital to bcd (binary-coded-decimal) conversion

    can you please give me an example how can i write it with vhdl or verilog code?



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 50,445, Level: 54

    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 (binary-coded-decimal) conversion

    Quote Originally Posted by noura7 View Post
    can you please give me an example how can i write it with vhdl or verilog code?
    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:




--[[ ]]--