2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_arith.all;
4 use ieee.std_logic_unsigned.all;
10 data : in std_logic_vector (7 downto 0);
12 ready : out std_logic;
17 --------------------------------------------------------------------------------
19 architecture dataflow of transmitter is
21 -- Output shift register (containing also start and stop bit).
22 signal tx_shift_reg : std_logic_vector (9 downto 0);
23 -- Register parallel to the output shift register where '1' shows the last
24 -- bit of the frame ('1' is in the place of stop bit).
25 signal tx_flag : std_logic_vector (9 downto 0);
26 -- Transmitting of new frame could be started with next tx_clk.
27 signal tx_ready : std_logic;
29 --------------------------------------------------------------------------------
36 tx_shift_reg <= "1111111111";
37 tx_flag <= "0000000000";
40 elsif (rising_edge(clk)) then
42 tx_shift_reg <= '1' & data & '0';
43 tx_flag <= "1000000000";
47 tx_shift_reg <= '1' & tx_shift_reg(9 downto 1);
48 tx_flag <= '0' & tx_flag(9 downto 1);
50 if (tx_flag(1) = '1') then
58 --------------------------------------------------------------------------------
62 tx <= tx_shift_reg(0);