SlideShare a Scribd company logo
1 of 33
Download to read offline
Structural modelling
Structural modeling
● Structural VHDL models the structure of a circuit;
similar to circuit schematic
– Defines the circuit components
– Describes how components are connected
Modeling the Structural way
● Structural architecture
– implements the module as a composition of
subsystems
– contains
● component instances
– instances of previously declared entity/architecture pairs
● signal declarations, for internal interconnections
– the entity ports are also treated as signals
● port maps in component instances
– connect signals to component ports
Example Schematic
A_IN
B_IN
C_IN
Z_OUT
INT1
INT2
INT3
A
B
Z
ZB
A
C
A
B
Z
A
B
Z
A1
A2
A3
O1
Example Structural VHDL Interface
-- Define the Interface
entity MAJORITY is
port
(A_IN, B_IN, C_IN: in BIT;
Z_OUT : out BIT);
end MAJORITY;
Design Entity – Component
Relationship
A1
A2
A3
O1
Design entities Components
Instantiations
Component Declarations
● Component declarations reference the components
that are to be connected
– Identified by keyword „component’
● Definition terminated by ‘end component’
– Port statement define the interface
● Identifier, direction, type same as in port statement in design
entity interface definition
– Component to entity association is defined by a
„configuration‟
● Default configuration associates components and entities that
have the same interface
Example - Structural VHDL Body
architecture STRUCTURE of MAJORITY is
-- Declaration of components and local signals
component AND2_OP
port (A, B : in BIT; Z : out BIT);
end component;
component OR3_OP
port (A, B, C : in BIT; Z : out BIT);
end component;
signal INT1, INT2, INT3 : BIT;
Signal Declarations
● Instantiated components need connecting; signals
do this
– Effectively form the internal gate-to-gate wiring
– Keyword is ‘signal’
– Must specify identifier(s) and type
Component Instantiation Statements
● Component instantiation statements define specific,
names instances of components
– Prefaced with a label: identifier (names the part)
– Followed by the component name
– Followed by keyword ‘port map’
– Followed by signal map list
● Associates signals with component interface entity
● Connectivity is either positional association or named
association
Example VHDL Statement Part
begin
-- Define the component connections
A1: AND2_OP port map (A_IN, B_IN, INT1);
A2: AND2_OP port map (A_IN, C_IN, INT2);
A3: AND2_OP port map (B_IN, C_IN, INT3);
O1: OR3_OP port map (INT1, INT2, INT3, Z_OUT);
end STRUCTURE;
Port Map Associations
● Positional association connects port identifiers to port
map identifiers in order of occurrence
● Named association explicitly identifies the connection
between port identifiers and port map identifiers
– Association is “port name => signal name”
– left side: "formals" (port names from component declaration)
– right side: "actuals" (architecture signals)
– Associations can appear in any order
● Both associations can appear in one port map
– Positional before named
A1: AND2_OP port map (Z=>INT1, B=>B_IN, A=>A_IN);
Hierarchical Model Layout
● HDL allows for a hierarchical model layout, which
means that a module can be assembled out of several
submodules. The connections between these submodules
are defined within the architecture of a top module.
● As you can see, a fulladder can be built with the help of
two halfadders (module1, module2) and an OR gate
(module3).
● A purely structural architecture does not describe any
functionality and contains just a list of components, their
instantiation and the definition of their interconnections.
entity FULLADDER is
port (A,B, CARRY_IN: in bit;
SUM, CARRY: out bit);
end FULLADDER;
architecture STRUCT of FULLADDER is
signal W_SUM, W_CARRY1, W_CARRY2 : bit;
component HALFADDER
port (X, Y : in bit;
S, C : out bit);
end component;
component ORGATE
port (IP1, IP2 : in bit;
OP : out bit);
end component;
begin
MODULE1: HALFADDER port map (A, B,
W_SUM, W_CARRY1 );
MODULE2: HALFADDER port map (W_SUM,
CARRY_IN, SUM, W_CARRY2 );
MODULE3: ORGATE port map (W_CARRY2,
W_CARRY1, CARRY);
end STRUCT;
Design entities – Half adder
entity HALFADDER
port (X, Y : in bit;
S, C : out bit);
end entity;
Architecture BEH of HALFADDER is
Begin
S<=X xor Y;
C<= X and Y;
End beh;
Design entities – OR gate
entity ORGATE
port (IP1, IP2 : in bit;
OP : out bit);
end entity;
Architecture BEH of ORGATE is
Begin
OP<=IP1 or IP2;
end BEH
● As the fulladder consists of several submodules,
they have to be "introduced" first. In a component
declaration all module types which will be used,
are declared.
● This declaration has to occur before the 'begin'
keyword of the architecture statement. Note, that
just the interface of the modules is given here and
their use still remains unspecified.
entity FULLADDER is
port (A,B, CARRY_IN: in bit;
SUM, CARRY: out bit);
end FULLADDER;
architecture STRUCT of FULLADDER is
component HALFADDER
port (X, Y : in bit;
S, C: out bit);
end component;
. . .
signal W_SUM, W_CARRY1, W_CARRY2 : bit;
begin
MODULE1: HALFADDER
port map (X => A,
S => W_SUM,
Y => B,
C => W_CARRY1 );
. . .
end STRUCT;
Example – 9-bit Parity generator circuit
Structural VHDL code of 9-bit Parity
generator circuit
Design entities used in Structural VHDL
code of 9-bit Parity generator circuit –
XOR gate
Entity XOR2 is
Port (A,B: in std_logic; Z:out STD_LOGIC);
End XOR2;
Architecture BEH of XOR2 is
Begin
Z<=A xor B;
End BEH;
Design entities used in Structural VHDL
code of 9-bit Parity generator circuit –
XOR gate
Entity INV2 is
Port (A: in std_logic; Z:out STD_LOGIC);
End INV2;
Architecture BEH of INV2 is
Begin
Z<=not A;
End BEH;
Example – Decade counter using JK F/Fs
Structural VHDL code of Decade counter
using JK F/Fs
Design entities used in Structural VHDL
code of Decade counter – JK F/F
entity JK_FF is
port (J, K, ck: in std_logic;
Q, NQ: Buffer std_logic);
end JK_FF;
architecture behv of JK_FF is
begin
input <= J & K; -- combine inputs into vector
p: process (ck)
begin
if (ck=„1‟ and ck‟event) then
case (input) is
when "11" =>
Q<=not Q; NQ<=not Nbar;
when "10" =>
Q <= '1'; NQ<=0;
when "01" =>
Q <= '0'; NQ<=1;
when others =>
null;
end case;
end if;
end process;
end behv;
And gate
Entity AND_GATE is
Port (A,B:in std_logic; C:out STD_LOGIC);
End AND_GATE;
Architecture BEH of AND_GATE is
Begin
C<=A and B;
End BEH;
References
● [1]. “Digital Systems Design Using VHDL” by
Charles H Roth, Jr., Thomson Learining,
Brooks/Cole.
● [2]. “VHDL Primer” by J Bhasker, PHI, Third
edition.

More Related Content

What's hot

What's hot (20)

Structural modelling
Structural modellingStructural modelling
Structural modelling
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
VLSI & E-CAD Lab Manual
VLSI & E-CAD Lab ManualVLSI & E-CAD Lab Manual
VLSI & E-CAD Lab Manual
 
Fpga 05-verilog-programming
Fpga 05-verilog-programmingFpga 05-verilog-programming
Fpga 05-verilog-programming
 
Basic structures in vhdl
Basic structures in vhdlBasic structures in vhdl
Basic structures in vhdl
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with Examples
 
Basics of Vhdl
Basics of VhdlBasics of Vhdl
Basics of Vhdl
 
Verilog
VerilogVerilog
Verilog
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
VHDL - Enumerated Types (Part 3)
VHDL - Enumerated Types (Part 3)VHDL - Enumerated Types (Part 3)
VHDL - Enumerated Types (Part 3)
 
VHDL
VHDLVHDL
VHDL
 
Verilog HDL- 2
Verilog HDL- 2Verilog HDL- 2
Verilog HDL- 2
 
Vhdl basic unit-2
Vhdl basic unit-2Vhdl basic unit-2
Vhdl basic unit-2
 
RELIABLE NoC ROUTER ARCHITECTURE DESIGN USING IBM 130NM TECHNOLOGY
RELIABLE NoC ROUTER ARCHITECTURE DESIGN USING IBM 130NM TECHNOLOGYRELIABLE NoC ROUTER ARCHITECTURE DESIGN USING IBM 130NM TECHNOLOGY
RELIABLE NoC ROUTER ARCHITECTURE DESIGN USING IBM 130NM TECHNOLOGY
 
ECAD lab manual
ECAD lab manualECAD lab manual
ECAD lab manual
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training Course
 
VHDL - Part 2
VHDL - Part 2VHDL - Part 2
VHDL - Part 2
 

Similar to Ddhdl 15

Similar to Ddhdl 15 (20)

L6_Slides_vhdl coures temporary hair dye for dark hair
L6_Slides_vhdl coures temporary hair dye for dark hairL6_Slides_vhdl coures temporary hair dye for dark hair
L6_Slides_vhdl coures temporary hair dye for dark hair
 
vlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptxvlsi introduction to hdl and its typesunit-1.pptx
vlsi introduction to hdl and its typesunit-1.pptx
 
Fpga 1
Fpga 1Fpga 1
Fpga 1
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
Practical file
Practical filePractical file
Practical file
 
Combinational logic circuit by umakant bhaskar gohatre
Combinational logic circuit by umakant bhaskar gohatreCombinational logic circuit by umakant bhaskar gohatre
Combinational logic circuit by umakant bhaskar gohatre
 
Structural vhdl
Structural vhdlStructural vhdl
Structural vhdl
 
Spdas2 vlsibput
Spdas2 vlsibputSpdas2 vlsibput
Spdas2 vlsibput
 
Hd6
Hd6Hd6
Hd6
 
Ddhdl 17
Ddhdl 17Ddhdl 17
Ddhdl 17
 
Digital Electronics .
Digital Electronics                                              .Digital Electronics                                              .
Digital Electronics .
 
VHDL summer training (ppt)
 VHDL summer training (ppt) VHDL summer training (ppt)
VHDL summer training (ppt)
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
Hardware Description Language
Hardware Description Language Hardware Description Language
Hardware Description Language
 
VHDL Programs
VHDL ProgramsVHDL Programs
VHDL Programs
 
slide8.ppt
slide8.pptslide8.ppt
slide8.ppt
 
Verilog_Overview.pdf
Verilog_Overview.pdfVerilog_Overview.pdf
Verilog_Overview.pdf
 
Session1
Session1Session1
Session1
 
Eecs 317 20010209
Eecs 317 20010209Eecs 317 20010209
Eecs 317 20010209
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 

Recently uploaded

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

Ddhdl 15

  • 2. Structural modeling ● Structural VHDL models the structure of a circuit; similar to circuit schematic – Defines the circuit components – Describes how components are connected
  • 3. Modeling the Structural way ● Structural architecture – implements the module as a composition of subsystems – contains ● component instances – instances of previously declared entity/architecture pairs ● signal declarations, for internal interconnections – the entity ports are also treated as signals ● port maps in component instances – connect signals to component ports
  • 5. Example Structural VHDL Interface -- Define the Interface entity MAJORITY is port (A_IN, B_IN, C_IN: in BIT; Z_OUT : out BIT); end MAJORITY;
  • 6. Design Entity – Component Relationship A1 A2 A3 O1 Design entities Components Instantiations
  • 7. Component Declarations ● Component declarations reference the components that are to be connected – Identified by keyword „component’ ● Definition terminated by ‘end component’ – Port statement define the interface ● Identifier, direction, type same as in port statement in design entity interface definition – Component to entity association is defined by a „configuration‟ ● Default configuration associates components and entities that have the same interface
  • 8. Example - Structural VHDL Body architecture STRUCTURE of MAJORITY is -- Declaration of components and local signals component AND2_OP port (A, B : in BIT; Z : out BIT); end component; component OR3_OP port (A, B, C : in BIT; Z : out BIT); end component; signal INT1, INT2, INT3 : BIT;
  • 9. Signal Declarations ● Instantiated components need connecting; signals do this – Effectively form the internal gate-to-gate wiring – Keyword is ‘signal’ – Must specify identifier(s) and type
  • 10. Component Instantiation Statements ● Component instantiation statements define specific, names instances of components – Prefaced with a label: identifier (names the part) – Followed by the component name – Followed by keyword ‘port map’ – Followed by signal map list ● Associates signals with component interface entity ● Connectivity is either positional association or named association
  • 11. Example VHDL Statement Part begin -- Define the component connections A1: AND2_OP port map (A_IN, B_IN, INT1); A2: AND2_OP port map (A_IN, C_IN, INT2); A3: AND2_OP port map (B_IN, C_IN, INT3); O1: OR3_OP port map (INT1, INT2, INT3, Z_OUT); end STRUCTURE;
  • 12. Port Map Associations ● Positional association connects port identifiers to port map identifiers in order of occurrence ● Named association explicitly identifies the connection between port identifiers and port map identifiers – Association is “port name => signal name” – left side: "formals" (port names from component declaration) – right side: "actuals" (architecture signals) – Associations can appear in any order ● Both associations can appear in one port map – Positional before named A1: AND2_OP port map (Z=>INT1, B=>B_IN, A=>A_IN);
  • 14. ● HDL allows for a hierarchical model layout, which means that a module can be assembled out of several submodules. The connections between these submodules are defined within the architecture of a top module. ● As you can see, a fulladder can be built with the help of two halfadders (module1, module2) and an OR gate (module3). ● A purely structural architecture does not describe any functionality and contains just a list of components, their instantiation and the definition of their interconnections.
  • 15. entity FULLADDER is port (A,B, CARRY_IN: in bit; SUM, CARRY: out bit); end FULLADDER; architecture STRUCT of FULLADDER is signal W_SUM, W_CARRY1, W_CARRY2 : bit; component HALFADDER port (X, Y : in bit; S, C : out bit); end component; component ORGATE port (IP1, IP2 : in bit; OP : out bit); end component;
  • 16. begin MODULE1: HALFADDER port map (A, B, W_SUM, W_CARRY1 ); MODULE2: HALFADDER port map (W_SUM, CARRY_IN, SUM, W_CARRY2 ); MODULE3: ORGATE port map (W_CARRY2, W_CARRY1, CARRY); end STRUCT;
  • 17. Design entities – Half adder entity HALFADDER port (X, Y : in bit; S, C : out bit); end entity; Architecture BEH of HALFADDER is Begin S<=X xor Y; C<= X and Y; End beh;
  • 18. Design entities – OR gate entity ORGATE port (IP1, IP2 : in bit; OP : out bit); end entity; Architecture BEH of ORGATE is Begin OP<=IP1 or IP2; end BEH
  • 19. ● As the fulladder consists of several submodules, they have to be "introduced" first. In a component declaration all module types which will be used, are declared. ● This declaration has to occur before the 'begin' keyword of the architecture statement. Note, that just the interface of the modules is given here and their use still remains unspecified.
  • 20. entity FULLADDER is port (A,B, CARRY_IN: in bit; SUM, CARRY: out bit); end FULLADDER; architecture STRUCT of FULLADDER is component HALFADDER port (X, Y : in bit; S, C: out bit); end component; . . .
  • 21. signal W_SUM, W_CARRY1, W_CARRY2 : bit; begin MODULE1: HALFADDER port map (X => A, S => W_SUM, Y => B, C => W_CARRY1 ); . . . end STRUCT;
  • 22. Example – 9-bit Parity generator circuit
  • 23. Structural VHDL code of 9-bit Parity generator circuit
  • 24.
  • 25. Design entities used in Structural VHDL code of 9-bit Parity generator circuit – XOR gate Entity XOR2 is Port (A,B: in std_logic; Z:out STD_LOGIC); End XOR2; Architecture BEH of XOR2 is Begin Z<=A xor B; End BEH;
  • 26. Design entities used in Structural VHDL code of 9-bit Parity generator circuit – XOR gate Entity INV2 is Port (A: in std_logic; Z:out STD_LOGIC); End INV2; Architecture BEH of INV2 is Begin Z<=not A; End BEH;
  • 27. Example – Decade counter using JK F/Fs
  • 28. Structural VHDL code of Decade counter using JK F/Fs
  • 29.
  • 30. Design entities used in Structural VHDL code of Decade counter – JK F/F entity JK_FF is port (J, K, ck: in std_logic; Q, NQ: Buffer std_logic); end JK_FF; architecture behv of JK_FF is begin input <= J & K; -- combine inputs into vector
  • 31. p: process (ck) begin if (ck=„1‟ and ck‟event) then case (input) is when "11" => Q<=not Q; NQ<=not Nbar; when "10" => Q <= '1'; NQ<=0; when "01" => Q <= '0'; NQ<=1; when others => null; end case; end if; end process; end behv;
  • 32. And gate Entity AND_GATE is Port (A,B:in std_logic; C:out STD_LOGIC); End AND_GATE; Architecture BEH of AND_GATE is Begin C<=A and B; End BEH;
  • 33. References ● [1]. “Digital Systems Design Using VHDL” by Charles H Roth, Jr., Thomson Learining, Brooks/Cole. ● [2]. “VHDL Primer” by J Bhasker, PHI, Third edition.