Study The Bhaskar Books Notes (Page1-24, 54-72) To Learn The Language Better
Study The Bhaskar Books Notes (Page1-24, 54-72) To Learn The Language Better
3. Entity name should be same in all three places. It should not be any
reserved words used in VHDL (find the list in the Bhaskar Book notes-page
20)
4. Architecture name should be different from entity name. No reserved
words are allowed to use.
Some examples:
1. Half adder (dataflow style)
Library ieee;
use ieee.std_logic_1164.all;
entity half_adder is
port(A,B:in bit;
SUM,CARRY:out bit);
end half_adder;
Library ieee;
use ieee.std_logic_1164.all;
entity half_sub is
port(A,B:in bit;
D,Br:out bit);
end half_sub;
4. Full Subtractor
Library ieee;
use ieee.std_logic_1164.all;
entity full_sub is
port(A,B,C: in bit;
DIFF,BORROW:out bit);
end full_sub;
architecture data of full_sub is
begin
DIFF<= A xor B xor C;
BORROW <= (B and (not A)) or (B and C) or (C and (not A));
end data;
Library ieee;
use ieee.std_logic_1164.all;
entity mux is
port(S1,S0,I0,I1,I2,I3:in bit; Y:out bit);
end mux;
Library ieee;
use ieee.std_logic_1164.all;
entity demux is
port(B,A,X:in bit; D0,D1,D2,D3:out bit);
end demux;