我想把一个三位数的个位.十位.百位的数分开来输出. library ieee,book_lib; use ieee.std_logic_1164.all,book_lib.utils_pkg.all; entity display is port(datain:in integer range 0 to 1000; x1,x2,x3:out integer range 0 to 10); end display;
architecture beha of display is variable a,b:natural; process(datain) begin a:=integer(datain/100); x1<=a; b:=integer((datain-a*100)/10); x2<=b; x3<=datain-a*100-b*10; end process; end;
|