Good Day,
My latest assignment is to convert the 10 bit decimal (since the maximum decimal number of 10 bit is 1023) to 16 bit BCD. When the input decimal is greater than or equal to 1024, then the error waveform will go high. The whole module of course is connected to a clock. I don't know how can I implement this in VHDL coding but I have some few suggested ideas on how can I make it work:
- First, I could implement the use of TWO MODULES where the output of the first block will be connected to the second block with the same clock. The output of the first block is the binary of the input where the error is equal to 1 when the decimal input is greater than 1023.
- The second one is to just use the one module technique where the input decimal is directly converted to 16-bit BCD where the error is one if the input decimal is greater than 1023.
Can anyone help me on how to code the decimal to bcd conversion using VHDL. A little help is much appreciated. Thank you