Im trying to write code for multiplexer/decoder that is hooked up to a 7 segment display using quartus. when I compile i get a 10500 error
"VHDL syntax error at ...(14) near text "IF" expecting "end" or "(", or an Identifier....."
here is my code. Thanks for any help you can offer.
"VHDL syntax error at ...(14) near text "IF" expecting "end" or "(", or an Identifier....."
here is my code. Thanks for any help you can offer.
Rich (BB code):
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY multiplexorDecoder IS
PORT(
s : IN BIT;
a : IN STD_LOGIC_VECTOR (3 downto 0);
b : IN STD_LOGIC_VECTOR (3 downto 0);
y : OUT STD_LOGIC_VECTOR (7 downto 0));
END multiplexorDecoder;
ARCHITECTURE mDecode OF multiplexorDecoder IS
BEGIN
IF (s = 1) then
(With a SELECT
y <= "1111110" when "0000" --0
"0110000" when "0001" --1
"1101101" when "0010" --2
"1111001" when "0011" --3
"0110011" when "0100" --4
"1010011" when "0101" --5
"0011111" when "0110" --6
"1110000" when "0111" --7
"1111111" when "1000" --8
"1110011" when "1001" --9
"0000000" when others);
else
(With b SELECT
y <= "1111110" when "0000" --0
"0110000" when "0001" --1
"1101101" when "0010" --2
"1111001" when "0011" --3
"0110011" when "0100" --4
"1010011" when "0101" --5
"0011111" when "0110" --6
"1110000" when "0111" --7
"1111111" when "1000" --8
"1110011" when "1001" --9
"0000000" when others);
END IF;
END mDecode;
Last edited by a moderator: