2c Structural Modelling Vhdl Example
2c Structural Modelling Vhdl Example
Benha University
Faculty of Engineering at Shoubra
ECE-322
Electronic Circuits (B)
Lecture #12
Spring 2015
Structural VHDL Modeling
Instructor:
Dr. Ahmad El-Banna
Elec. Cts B, Lec#12 , Spring 2015 © Ahmad El-Banna
Agenda
Structural Example
3
Elec. Cts B, Lec#12 , Spring 2015 © Ahmad El-Banna
Structural way Example
Not complete example, just for concept justification ..
4
Elec. Cts B, Lec#12 , Spring 2015 © Ahmad El-Banna
Structural way..
• First declare D-latch and and-gate entities and architectures
6
Elec. Cts B, Lec#12 , Spring 2015 © Ahmad El-Banna
Structural way....
• Now use them to implement the register
...
begin
bit0 : d_latch
port map ( d0, int_clk, q0 );
bit1 : d_latch
port map ( d1, int_clk, q1 );
bit2 : d_latch
port map ( d2, int_clk, q2 );
bit3 : d_latch
port map ( d3, int_clk, q3 );
gate : and2
port map ( en, clk, int_clk );
end struct; 7
Trace the code & Draw the model structure
• the model
• Simulation waveform
10
Elec. Cts B, Lec#12 , Spring 2015 © Ahmad El-Banna
Mixed Behavior and Structure
• An architecture can contain both behavioral and structural
parts
• process statements and component instances
• collectively called concurrent statements
• processes can read and assign to signals
• Example: register-transfer-level (RTL) Model
• data path described structurally
• control section described behaviorally
11
Elec. Cts B, Lec#12 , Spring 2015 © Ahmad El-Banna
Mixed Example
Not complete example, just for concept justification ..
12
Elec. Cts B, Lec#12 , Spring 2015 © Ahmad El-Banna
Mixed Example
entity multiplier is
port ( clk, reset : in bit;
multiplicand, multiplier : in integer;
product : out integer );
end multiplier;
14
Elec. Cts B, Lec#12 , Spring 2015© Ahmad El-Banna
• For more details, refer to:
• VHDL Tutorial: Learn by Example by Weijun Zhang
• http://esd.cs.ucr.edu/labs/tutorial/
• VHDL GUIDELINES FOR SYNTHESIS
• http://www.utdallas.edu/~zxb107020/EE6306/Tutorial/VHDL.pdf
• “Introduction to VHDL” presentation by Dr. Adnan Shaout, The
University of Michigan-Dearborn
• The VHDL Cookbook, Peter J. Ashenden, st1 edition, 1990.
• The lecture is available online at:
• http://bu.edu.eg/staff/ahmad.elbanna-courses/12135
• For inquires, send to:
• [email protected]
15