Guest
#4151793
Hello, this is my first post. I'm very new to digital logic and VHDL. I
started by making some VHDL for just a clock, which I was able to
compile with VHDL just fine, and simulate, and view the output in
gtkwave.
What I was hoping to do next is just an 8-bit ripple adder. However, I'm
stuck on an error. The following VHDL:
library ieee;
use ieee.std_logic_1164.all;
entity and_gate is
port (
a, b: in std_logic;
a_and_b: out std_logic
);
end;
architecture behavior of and_gate is
begin
process (a, b)
begin
a_and_b <= a and b;
end process;
end;
entity xor_gate is
port (
a: in std_logic;
b: in std_logic;
a_xor_b: out std_logic
);
end;
Fails with the errors:
$ ghdl -a 8_bit_adder.vhdl
8_bit_adder.vhdl:23:15: no declaration for "std_logic"
8_bit_adder.vhdl:24:15: no declaration for "std_logic"
8_bit_adder.vhdl:25:22: no declaration for "std_logic"
ghdl: compilation error
The error goes away if I delete the "xor_gate" entity. I'm surprised at
the error as I don't know why I wouldn't be able to use the same type
(std_logic) several times. Please help! :)