library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; Entity B_BCD is port( B: in std_logic_vector(15 downto 0); BCD: out std_logic_vector(15 downto 0) ); End; Architecture one of B_BCD is Begin Process(B) begin (16位的二进制码)转化为(相应的BCD码);比如说1234这个十进制数,它的16位二进制码是0000010011010010.则把它转化为BCD码后是:0001 0010 0011 0100. 如何实现这个功能呢:二进制转BCD码? |
更多回帖