if sck'event and sck = '0' then
data_in_buf(7 downto 0) <= data_in_buf(6 downto 0)& data_in;
end if;
end process data_rx;
data_show:process(data_in_buf)
begin
case data_in_buf(3 downto 0) is --ABCDEFG
when "0000" => show_pin <= "1111110";--0
when "0001" => show_pin <= "0110000";--1
when "0010" => show_pin <= "1101101";--2
when "0011" => show_pin <= "1111001";--3
when "0100" => show_pin <= "0110011";--4
when "0101" => show_pin <= "1011011";--5
when "0110" => show_pin <= "1011111";--6
when "0111" => show_pin <= "1110000";--7
when "1000" => show_pin <= "1111111";--8
when "1001" => show_pin <= "1111011";--9
when "1010" => show_pin <= "1110111";--A
when "1011" => show_pin <= "0011111";--B
when "1100" => show_pin <= "1001110";--C
when "1101" => show_pin <= "0111101";--D
when "1110" => show_pin <= "1001111";--E
when "1111" => show_pin <= "1000111";--F
when others => show_pin <= "0000000";-->turn off
end case;
end process data_show;
data_out <= data_in_buf(0); -- 发送数据赋值
我用的CPLD 为XC9572xl-10,再次感谢。