Design Units Entity Architecture
Design Units Entity Architecture
DIGITAL
SYSTEM
DESIGN
Dr. Dipali Borakhade
Assistant professor
St. Vincent Pallotti college of engineering
and technology , Nagpur
Programming language
– Semantics (“meaning”)
– Syntax (“grammar”)
q A hardware description language (HDL) is a programming
language used to describe the behavior or structure of
digital circuits (ICs).
q HDLs are also used to stimulate the circuit and check its
response.
q Many HDLs are available, but VHDL and Verilog are by far
the most popular.
Two HDLs used today
– VHDL and Verilog
Bo t h V H D L a nd V erilo g a re o f f ic ia lly endo rs ed IEE E
(Institute of Electrical and Electronics Engineers) standards.
Other HDLs include JHDL (Java HDL), and proprietary
HDLs such as Cypress Semiconductor Corporation's Active-
HDL.
– Syntax and ``appearance'' of the two languages
are very different
– Capabilities and scopes are quite similar
– Both are industrial standards and are supported
by most software tools. Most CAD tools available in
the market support these languages.
VHDL
– VHDL: VHSIC (Very High Speed Integrated Circuit) HDL
– Initially sponsored by DoD as a hardware documentation
standard in early 80s
– Transferred to IEEE and ratified it as IEEE standard 1176 in
1987 (known as VHDL-87)
– Major modification in ’93 (known as VHDL-93)
– Revised continuously
VHDL Benefits
Public Standard
Supports a variety of design methodologies
1. Behavioral modeling
2. Dataflow or RTL Modeling
3. Structural or gate level modeling
It supports various design methodologies like Top-
down approach and Bottom-up approach.
It provides a flexible design language.
It allows better design management.
It allows detailed implementations.
It supports a multi-level abstraction.
It provides tight coupling to lower levels of design.
A VHDL model (program) consists of two design units:
1.Primary design unit.
2.Secondary design unit.
The primary design unit consists of
•Entity
•Package
•Configuration
The secondary design unit consists of
•Architecture
•Package body
q It describes the inputs and outputs of the circuit.
q It as a black box which you can see from outside only.
q So, by looking at it, you only get the information about
inputs and outputs and not really the inside.
q The entity syntax is keyword “entity”, followed by entity name and the
keyword “is” and “port”.
q Then inside parenthesis there is the por ts declaration. In the
port declaration there are port name followed by colon, then port
direction (in/out in this example) followed by port type.
entity entity_name is
generic (generic_list);
port (port_list);]
end entity entity_name;
Entity and_3 is
Port ( a,b,c : in std_logic;
z: out std_logic);
End and_3;
Entity full_adder is
Port ( A : in std_logic;
B : in std_logic;
Cin : in std_logic;
Sum : out std_logic ;
Cout : out std_logic);
End full_adder;
Architecture
q In mixed modeling, we combine the feature all modeling style, and this comes as
an advantage. We can use all the optimum features from all the modeling styles.
This gives an edge to mixed modeling. Hence, it is also a much more popular
modeling style in developers.
entity half_adder is
port (a, b : in BIT;
sum, carry : out BIT );
end half_adder;
• Mode
• In, Out, Inout, Buffer
• Data type
• Any declared or predefined datatype.
entity andgate is
port (a : in std_logic;
b : in std_logic;
c : out std_logic );
end andgate;
architecture dataflow of andgate is
Begin
c <= a and b;
end dataflow;
WRITE VHDL CODE FOR HALF ADDER USING DATAFLOW TYPE OF
MODELING
Library ieee;
Use ieee.std_logic_1164.all;
Entity HA is
Port (a,b : in std_logic;
sum, cout :out std_logic);
End HA;
Architecture dataflow of HA is
Begin
Sum<= a xor b ;
Carry <= (a and b) ;
End dataflow;
WRITE VHDL CODE FOR FULL ADDER USING DATAFLOW TYPE OF
MODELING
Library ieee;
Use ieee.std_logic_1164.all;
Entity FA is
Port (a,b,c : in std_logic;
sum, carry :out std_logic);
End FA;
Architecture dataflow of FA is
Begin
Sum<= a xor b xor c ;
Carry <= (a and b) or (a and c) or (b and c); Sum = a xor b xor cin
End dataflow; Carry_out = ab + acin + bcin
WRITE ENTITY FOR 4:1 MULTIPLXER
Library ieee;
Use ieee.std_logic_1164.all;
Entity mux4 is
Port ( I : in std_logic_vector ( 3 DOWNTO 0);
S : in std_logic_vector ( 1 downto 0);
y : out std_logic);
End mux4;
I3 I2 I1 I0
I0 I1 I2 I3