Reputation: 55
As title, The code of entity like :
entity n_in_1_out_xor_gate is
generic(
bits : integer
);
port (
n_in : in std_logic(bits-1 downto 0);
xor_gate_out : out std_logic
);
end n_in_1_out_xor_gate;
How to implement body of code? Does anybody help me? Thanks!
Upvotes: 1
Views: 1291
Reputation: 4461
With vhdl 2008, you can simply write:
xor_gate_out <= xor n_in;
if you're stuck with vhdl '93, all compilers I have ever used support the std_logic_misc non-standard library that contain reduction functions:
xor_gate_out <= xor_reduce(n_in);
Upvotes: 4