| ??? 04/12/07 04:39 Read: times |
#137014 - bcd to binary Responding to: ???'s previous message |
In one of my homeworks I designed a frequency synthesizer where I enter the required frequency on 8 digit 7 segment displays and convert it to binary(hex) for the nco component to generate the displayed frequency.
signal temp :std_logic_vector(27 downto 0);
-- Read the desired frequency value from display buffer
-- and convert it to binary(hex)
temp <= digit7(3 downto 0) + (digit6(3 downto 0) * x"A")
+ (digit5(3 downto 0) * x"64") + (digit4(3 downto 0)
* x"3e8") + (digit3(3 downto 0) * x"2710") +
(digit2(3 downto 0) * x"186A0") + (digit1(3 downto 0)
* x"F4240") + (digit0(3 downto 0) * x"989680");
freq_in <= temp(23 downto 0);
Is there an easier way to convert from bcd to binary? this method consumes too many logic elements from the Altera FPGA. Mahmood |



