Forum Discussion
Altera_Forum
Honored Contributor
8 years agoThank you, i decide my data, leave it in one internal signal of 8 bits, now read about UART examples.
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity joystick is port (d1,d2,d3,d4,d5,d6,d7,d8 : in std_logic); --deci : out integer range 0 to 255 end joystick; architecture lectura of joystick is signal val_bin : std_logic_vector(7 downto 0); signal deci : integer range 0 to 255; begin val_bin <= d8 & d7 & d6 & d5 & d4 & d3 & d2 & d1; deci <= to_integer(unsigned(val_bin)); end lectura;