What’s VHDL? Basic Concept <ul><li>VHDL </li></ul><ul><li>Very Hard Difficult Language </li></ul><ul><li>V ery High Speed ...
<ul><li>Why VHDL? (Using an HDL) </li></ul><ul><ul><li>Can be used to </li></ul></ul><ul><ul><li>Describing, </li></ul></u...
VHDL Development <ul><li>US DoD initiated in 80’s </li></ul><ul><li>V ery  H igh Speed ASIC  D escription  L anguage </li>...
<ul><li>History of VHDL </li></ul><ul><ul><ul><li>Launched in 1980 by Defense Advanced Research Projects Agency (DARPA) </...
<ul><ul><ul><ul><li>December 1987IEEE Standard 1076-1987 </li></ul></ul></ul></ul><ul><ul><ul><ul><li>1988VHDL became an A...
<ul><li>For RTL design VITAL added </li></ul><ul><ul><li>VITAL(VHDL Initiative Towards ASIC Library) </li></ul></ul><ul><u...
VHDL  vs.  Verilog <ul><li>Complex grammar </li></ul><ul><ul><li>Complicated compiler </li></ul></ul><ul><ul><li>Large mem...
VHDL  vs.  Verilog <ul><li>User defined types </li></ul><ul><li>Strong type checking </li></ul><ul><ul><li>(ie it checks t...
<ul><li>Verilog modeled after C, VHDL is modeled after Ada </li></ul><ul><li>Verilog is case sensitive while VHDL is not <...
Data Types <ul><li>bit  values: '0', '1'  </li></ul><ul><li>boolean  values: TRUE, FALSE  </li></ul><ul><li>integer  value...
Additional standardized packages provide definitions of data types and expressions of timing data –  IEEE 1164 (data types...
Hardware description languages  describe a system –  Systems can be described from many different points of view •  Behavi...
Synthesis <ul><li>Synthesis:  Conversion of behavioral level description to structural level netlist </li></ul><ul><li>Str...
Simulation <ul><li>Simulation is modeling the output response of a circuit to given input stimuli </li></ul><ul><li>For ou...
Module/Unit Logic module A B C Out put In puts Full Adder
Defining Modules in VHDL <ul><li>1.Define block by giving name </li></ul><ul><li>2.Specify i/p ,o/p lines (ports).  </li><...
VHDL language elements VHDL is composed of language  building blocks  that consist of more than  75  reserved words  and a...
Reserved VHDL keywords VARIABLE WAIT WHEN WHILE WITH XNOR XOR   RETURN SELECT SEVERITY SIGNAL SHARED SLA SLL SRA SRL SUBTY...
Levels of Abstraction <ul><li>Digital system can be represented at different levels of abstraction </li></ul><ul><ul><li>B...
<ul><li>VHDL Programming </li></ul><ul><li>Dataflow </li></ul><ul><li>Behavioral </li></ul><ul><li>Structural </li></ul><u...
VHDL structure <ul><li>Library </li></ul><ul><ul><li>Definitions, constants </li></ul></ul><ul><li>Entity </li></ul><ul><u...
Libraries <ul><li>Library ieee; </li></ul><ul><li>Use ieee.std_logic_1164.all; </li></ul><ul><li>Use ieee.std_logic_arith....
Entity <ul><li>Define inputs and outputs </li></ul><ul><li>Example: </li></ul><ul><li>Entity  test  is </li></ul><ul><li>P...
Entity <ul><li>Describes the interface of a module </li></ul>entity  Reg4  is port  ( d0, d1, d2, d3, en, clk :  in  std_l...
<ul><li>Basic Identifiers </li></ul><ul><ul><li>Can Only Use  </li></ul></ul><ul><ul><ul><li>alphabetic letters ( A-Z, a-z...
<ul><li>Not case sensitive, but recommended to use always  the same  way.  </li></ul><ul><li>It is also recommended to  us...
The mode of the port <ul><li><mode>  =  in, out, inout, buffer, linkage </li></ul><ul><li>in : Component only read the sig...
Concurrent operation  <ul><li>Q=a+ b .c </li></ul><ul><li><=a or (b and c) </li></ul><ul><li>=/ a or b and c=(a+ b) .c </l...
Architecture <ul><li>Define functionality of the chip </li></ul><ul><li>X <= A AND B; </li></ul><ul><li>Y <= C AND D; </li...
Dataflow Model <ul><li>The flow of data through the entity is modeled primarily using concurrent signal assignment stateme...
<ul><li>library IEEE; </li></ul><ul><li>use IEEE.STD_LOGIC_1164.ALL; </li></ul><ul><li>use IEEE.STD_LOGIC_ARITH.ALL; </li>...
Logical operators defined in VHDL  <ul><li>NOT </li></ul><ul><li>AND </li></ul><ul><li>NAND </li></ul><ul><li>OR </li></ul...
Delay in Signal Assignment <ul><li>There are two types of delay that can be applied when assigning a time/value pair into ...
Inertial Delay <ul><li>Inertial delay models the delays often found in switching circuits. An input value must remain stab...
Transport Delay <ul><li>This delay models pure propagation delay; ie, any change in the input (no matter how small) is tra...
Example: 1-bit Full Adder  (with delay) <ul><li>entity  FullAdder  is </li></ul><ul><li>port  (X, Y, Cin:  in  bit; -- Inp...
Example: 1-bit Full Adder (contd.) <ul><li>Architecture  Equations  of  FullAdder  is </li></ul><ul><li>begin -- Concurren...
Example   of  Communicating Processes -  the full adder . This example shows a model of a full adder constructed from 2  h...
library  IEEE; use  IEEE.std_logic_1164.all; entity  full_adder  is port (in1, in2, c_in:  in  std_ulogic; sum, c_out:  ou...
Structural Model <ul><li>Digital circuits consist of components and interconnection between them </li></ul><ul><li>A compo...
VHDL Structural Elements <ul><li>Entity: Interface </li></ul><ul><li>Architecture: Implementation, behavior, function </li...
<ul><li>--Structural Description </li></ul><ul><li>entity AOI_Network is </li></ul><ul><li>port(A,B.C,D:in std_logic; </li...
<ul><li>component or2 </li></ul><ul><li>port(x,y:in std_logic; </li></ul><ul><li>z:out std_logic); </li></ul><ul><li>end c...
<ul><li>Before this the module should be previously defined </li></ul><ul><li>use library…. </li></ul><ul><li>entity AND2 ...
Example: 4-bit Adder <ul><li>entity   Adder4  is </li></ul><ul><li>port   (A, B:  in  bit_vector(3  downto  0); </li></ul>...
Example: 4-bit Adder (contd.) <ul><li>Architecture  Structure  of   Adder4  is </li></ul><ul><li>Component  FullAdder </li...
<ul><li>The concept of component can be understood using the concept of a design library, which is a collection of differe...
Modeling the Behavior way <ul><li>Architecture body </li></ul><ul><ul><li>describes an implementation of an entity </li></...
Full Adder – using Processes <ul><li>library  ieee; </li></ul><ul><li>use  ieee.std_logic_1164 .all ; </li></ul><ul><li>en...
<ul><li>architecture  BEHAV_FA  of  FULL_ADDER  is </li></ul><ul><li>signal  int1, int2, int3: std_logic; </li></ul><ul><l...
Multiplexers A B Z A B I 3 A B’ I 2 A’ B’ I 0 Z Data inputs versus control inputs Use of muxes in  control  and  data path...
Concurrent Conditional Assignment: 4 to 1 Multiplexer <ul><li>y <= x0 when sel = 0 </li></ul><ul><li>else x1 when sel = 1 ...
CASE Statement:  4 to 1 Multiplexer <ul><li>Case sel is   </li></ul><ul><li>when  0 =>  y <= x0 </li></ul><ul><li>when  1 ...
2-to-4-decoder with enable, DeMUX
Example: DFF (contd.) <ul><li>Architecture  Beh  of  DFF  is </li></ul><ul><li>begin   process  (CLK) </li></ul><ul><li>be...
Internal Structure of a PLA Inputs A A’ B B’ C C’ AND ARRAY OR ARRAY F 0 F 1 F 2 F 3 Outputs A’B’ AC’ B BC’ AC
<ul><li>THANK YOU ALL </li></ul>
Upcoming SlideShare
Loading in...5
×

Spdas2 vlsibput

1,687

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,687
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
137
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • 1
  • 3
  • Spdas2 vlsibput

    1. 1. What’s VHDL? Basic Concept <ul><li>VHDL </li></ul><ul><li>Very Hard Difficult Language </li></ul><ul><li>V ery High Speed Integrated Circuit H ardware D escription L anguage </li></ul><ul><li>Front end/Back end Design </li></ul>
    2. 2. <ul><li>Why VHDL? (Using an HDL) </li></ul><ul><ul><li>Can be used to </li></ul></ul><ul><ul><li>Describing, </li></ul></ul><ul><ul><li>Modeling, and </li></ul></ul><ul><ul><li>Designing digital systems </li></ul></ul><ul><li>For the goals of </li></ul><ul><ul><li>Requirement specification </li></ul></ul><ul><ul><li>Documentation </li></ul></ul><ul><ul><li>Testing using simulation </li></ul></ul><ul><ul><li>Verification </li></ul></ul><ul><ul><li>Synthesizing digital circuits </li></ul></ul>
    3. 3. VHDL Development <ul><li>US DoD initiated in 80’s </li></ul><ul><li>V ery H igh Speed ASIC D escription L anguage </li></ul><ul><li>Initial objective was modeling only and thus only a simulator was envisaged </li></ul><ul><li>Subsequently tools for VHDL synthesis were developed </li></ul>
    4. 4. <ul><li>History of VHDL </li></ul><ul><ul><ul><li>Launched in 1980 by Defense Advanced Research Projects Agency (DARPA) </li></ul></ul></ul><ul><ul><ul><li>July 1983Intermetrics, IBM and Texas Instruments were awarded a contract to develop VHDL </li></ul></ul></ul><ul><ul><ul><li>August 1985 release of final version of the language under government contract, VHDL Version 7.2 </li></ul></ul></ul>
    5. 5. <ul><ul><ul><ul><li>December 1987IEEE Standard 1076-1987 </li></ul></ul></ul></ul><ul><ul><ul><ul><li>1988VHDL became an American National </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Standards Institute (ANSI ) standard </li></ul></ul></ul></ul><ul><ul><ul><ul><li>In 1990 Cadence opened the language to the public </li></ul></ul></ul></ul>
    6. 6. <ul><li>For RTL design VITAL added </li></ul><ul><ul><li>VITAL(VHDL Initiative Towards ASIC Library) </li></ul></ul><ul><ul><li>IEEE revised VHDL & VITAL in 1993 September </li></ul></ul><ul><li>Final review of standard in 2001 </li></ul>
    7. 7. VHDL vs. Verilog <ul><li>Complex grammar </li></ul><ul><ul><li>Complicated compiler </li></ul></ul><ul><ul><li>Large memory for simulation </li></ul></ul><ul><ul><li>Hard to learn </li></ul></ul><ul><li>A lot of data types </li></ul><ul><li>High level data types, </li></ul><ul><ul><li>Pointers </li></ul></ul><ul><ul><li>Alias </li></ul></ul><ul><li>Easy language </li></ul><ul><ul><li>Simple & fast compiler </li></ul></ul><ul><ul><li>Efficient memory usage and faster </li></ul></ul><ul><ul><li>Easy to learn for beginner </li></ul></ul><ul><li>A few data types </li></ul><ul><li>Hardware related </li></ul><ul><ul><li>Wires </li></ul></ul><ul><ul><li>Registers </li></ul></ul>
    8. 8. VHDL vs. Verilog <ul><li>User defined types </li></ul><ul><li>Strong type checking </li></ul><ul><ul><li>(ie it checks the typing more rigorously) </li></ul></ul><ul><li>User defined Library & package </li></ul><ul><li>Open Language </li></ul><ul><li>All primitive types </li></ul><ul><li>Some castings are allowed </li></ul><ul><li>No user defined packages </li></ul><ul><li>Cadence’s language at first </li></ul>
    9. 9. <ul><li>Verilog modeled after C, VHDL is modeled after Ada </li></ul><ul><li>Verilog is case sensitive while VHDL is not </li></ul><ul><li>VHDL is more flexible </li></ul><ul><li>Verilog used extensively in the US while VHDL is used internationally </li></ul>
    10. 10. Data Types <ul><li>bit values: '0', '1' </li></ul><ul><li>boolean values: TRUE, FALSE </li></ul><ul><li>integer values: -(231) to +(231 - 1) </li></ul><ul><li>std_logic values: 'U','X','1','0','Z','W','H','L','-' </li></ul><ul><ul><li>U' = uninitialized </li></ul></ul><ul><ul><li>'X' = unknown </li></ul></ul><ul><ul><li>'W' = weak 'X‘ </li></ul></ul><ul><ul><li>'Z' = floating </li></ul></ul><ul><ul><li>'H'/'L' = weak '1'/'0‘ </li></ul></ul><ul><ul><li>'-' = don't care </li></ul></ul><ul><li>Std_logic_vector (n downto 0); </li></ul><ul><li>Std_logic_vector (0 upto n); </li></ul>
    11. 11. Additional standardized packages provide definitions of data types and expressions of timing data – IEEE 1164 (data types) – IEEE 1076.3 (numeric) – IEEE 1076.4 (timing)
    12. 12. Hardware description languages describe a system – Systems can be described from many different points of view • Behavior: what does it do? • Structure: what is it composed of? • Functional properties: how do I interface to it? • Physical properties: how fast is it? Usage (Using an HDL) Descriptions can used for – Simulation • Verification, performance evaluation – Synthesis • First step in hardware design
    13. 13. Synthesis <ul><li>Synthesis: Conversion of behavioral level description to structural level netlist </li></ul><ul><li>Structural level netlist </li></ul><ul><ul><li>Implementation of behavioral description </li></ul></ul><ul><ul><li>Describes interconnection of gates </li></ul></ul><ul><li>Synthesis tool we shall use: Leonardo Spectrum/ISE inbuilt synthesizer </li></ul>
    14. 14. Simulation <ul><li>Simulation is modeling the output response of a circuit to given input stimuli </li></ul><ul><li>For our example circuit: </li></ul><ul><ul><li>Given the values of A, B and S </li></ul></ul><ul><ul><li>Determine the values of X and Y </li></ul></ul><ul><li>Many types of simulators used </li></ul><ul><ul><li>Event driven simulator is used popularly </li></ul></ul><ul><ul><li>Simulation tool we shall use: ModelSim/inbuilt simulator ISE </li></ul></ul>A B S X Y my_ckt
    15. 15. Module/Unit Logic module A B C Out put In puts Full Adder
    16. 16. Defining Modules in VHDL <ul><li>1.Define block by giving name </li></ul><ul><li>2.Specify i/p ,o/p lines (ports). </li></ul>
    17. 17. VHDL language elements VHDL is composed of language building blocks that consist of more than 75 reserved words and about 200 descriptive words or word combinations
    18. 18. Reserved VHDL keywords VARIABLE WAIT WHEN WHILE WITH XNOR XOR RETURN SELECT SEVERITY SIGNAL SHARED SLA SLL SRA SRL SUBTYPE THEN TO TRANSPORT TYPE UNAFFECTED UNITS UNTIL USE OF ON OPEN OR OTHERS OUT PACKAGE PORT POSTPONED PROCEDURE PROCESS PURE RANGE RECORD REGISTER REM REPORT ROL ROR IN INERTIAL INOUT IS LABEL LIBRARY LINKAGE LITERAL LOOP MAP MOD NAND NEW NEXT NOR NOT NULL DISCONNECT DOWNTO ELSE ELSIF END ENTITY EXIT FILE FOR FUNCTION GENERATE GENERIC GROUP GUARDED IF IMPURE ABS ACCESS AFTER ALIAS ALL AND ARCHITECTURE ARRAY ASSERT ATTRIBUTE BEGIN BLOCK BODY BUFFER BUS CASE COMPONENT CONFIGURATION CONSTANT
    19. 19. Levels of Abstraction <ul><li>Digital system can be represented at different levels of abstraction </li></ul><ul><ul><li>Behavioral—relationship between input and output signals, usually boolean expressions </li></ul></ul><ul><ul><li>Structural—description of the collection of gates and connections, more like a schematic </li></ul></ul><ul><ul><li>Physical (Layout) </li></ul></ul>
    20. 20. <ul><li>VHDL Programming </li></ul><ul><li>Dataflow </li></ul><ul><li>Behavioral </li></ul><ul><li>Structural </li></ul><ul><li>Mixed Structural and Behavioral </li></ul>
    21. 21. VHDL structure <ul><li>Library </li></ul><ul><ul><li>Definitions, constants </li></ul></ul><ul><li>Entity </li></ul><ul><ul><li>Interface </li></ul></ul><ul><li>Architecture </li></ul><ul><ul><li>Implementation, function </li></ul></ul>
    22. 22. Libraries <ul><li>Library ieee; </li></ul><ul><li>Use ieee.std_logic_1164.all; </li></ul><ul><li>Use ieee.std_logic_arith.all; </li></ul><ul><li>Use ieee.std_logic_signed.all; </li></ul><ul><li>Use ieee.std_logic_unsigned.all; </li></ul>
    23. 23. Entity <ul><li>Define inputs and outputs </li></ul><ul><li>Example: </li></ul><ul><li>Entity test is </li></ul><ul><li>Port ( A,B,C,D: in std_logic ; </li></ul><ul><li> E: out std_logic ); </li></ul><ul><li>End test; </li></ul>Inputs and Outputs Chip A B C D E
    24. 24. Entity <ul><li>Describes the interface of a module </li></ul>entity Reg4 is port ( d0, d1, d2, d3, en, clk : in std_logic; q0, q1, q2, q3 : out std_logic); end Reg4; entity name port names port mode (direction) port type
    25. 25. <ul><li>Basic Identifiers </li></ul><ul><ul><li>Can Only Use </li></ul></ul><ul><ul><ul><li>alphabetic letters ( A-Z, a-z ), or </li></ul></ul></ul><ul><ul><ul><li>Decimal digits ( 0-9 ), or </li></ul></ul></ul><ul><ul><ul><li>Underline character ( _ ) </li></ul></ul></ul><ul><ul><li>Must Start With Alphabetic Letter </li></ul></ul><ul><ul><li>May NOT end with underline ( MyVal_ ) </li></ul></ul><ul><ul><li>May NOT contain sequential underlines (My__Val) </li></ul></ul>
    26. 26. <ul><li>Not case sensitive, but recommended to use always the same way. </li></ul><ul><li>It is also recommended to use capitals for language components </li></ul><ul><ul><li>Examples </li></ul></ul><ul><ul><li>B3,b3,ram1,ram_1,ram_1_c, MyVal. </li></ul></ul><ul><ul><li>The followings are not used </li></ul></ul><ul><ul><li>_Basic_gate </li></ul></ul><ul><ul><li>Ram_2_ </li></ul></ul><ul><ul><li>Ram__2 </li></ul></ul>
    27. 27. The mode of the port <ul><li><mode> = in, out, inout, buffer, linkage </li></ul><ul><li>in : Component only read the signal </li></ul><ul><li>out : Component only write to the signal </li></ul><ul><li>inout : Component read or write to the signal (bidirectional signals) </li></ul><ul><li>buffer : Component write and read back the signal (no bidirectional signals, the signal is going out from the component) </li></ul><ul><li>linkage : Used only in the documentation </li></ul>
    28. 28. Concurrent operation <ul><li>Q=a+ b .c </li></ul><ul><li><=a or (b and c) </li></ul><ul><li>=/ a or b and c=(a+ b) .c </li></ul><ul><li>H= a + b . c’ + d </li></ul><ul><li>(not (a or (b and not c) or d)) </li></ul><ul><li>g<=(x or y) and (z or not (w and v)) </li></ul>
    29. 29. Architecture <ul><li>Define functionality of the chip </li></ul><ul><li>X <= A AND B; </li></ul><ul><li>Y <= C AND D; </li></ul><ul><li>E <= X OR Y; </li></ul>Chip A B C D E X Y
    30. 30. Dataflow Model <ul><li>The flow of data through the entity is modeled primarily using concurrent signal assignment statements. (uses statements that defines the actual flow of data.....) </li></ul><ul><li>The structure of the entity is not explicitly specified but it can be implicitly deduced. </li></ul><ul><li>Architecture MYARCH of MYENT is </li></ul><ul><li>begin </li></ul><ul><li> SUM <= A xor B after 8ns </li></ul><ul><li>end MYARCH; </li></ul>
    31. 31. <ul><li>library IEEE; </li></ul><ul><li>use IEEE.STD_LOGIC_1164.ALL; </li></ul><ul><li>use IEEE.STD_LOGIC_ARITH.ALL; </li></ul><ul><li>use IEEE.STD_LOGIC_UNSIGNED.ALL; </li></ul>entity half_adder is Port ( a : in STD_LOGIC; b : in STD_LOGIC; carry : out STD_LOGIC; sum : out STD_LOGIC); end half_adder; architecture Behavioral of half_adder is begin sum<= a xor b; carry<= a and b; end Behavioral; XOR & a b sum carry
    32. 32. Logical operators defined in VHDL <ul><li>NOT </li></ul><ul><li>AND </li></ul><ul><li>NAND </li></ul><ul><li>OR </li></ul><ul><li>NOR </li></ul><ul><li>XOR </li></ul><ul><li>XNOR </li></ul>
    33. 33. Delay in Signal Assignment <ul><li>There are two types of delay that can be applied when assigning a time/value pair into the driver of a signal </li></ul><ul><ul><li>Inertial Delay </li></ul></ul><ul><ul><li>Transport Delay </li></ul></ul>
    34. 34. Inertial Delay <ul><li>Inertial delay models the delays often found in switching circuits. An input value must remain stable for a specified time (pulse rejection limit) before the value is allowed to propagate to the output. </li></ul><ul><li>This is the delay due to the fact that electronic gates require a short amount of time to respond to the movement of energy within the circuit. </li></ul><ul><li>The value appears at the output after the specified inertial-delay. </li></ul>
    35. 35. Transport Delay <ul><li>This delay models pure propagation delay; ie, any change in the input (no matter how small) is transported to the output after the specified delay time period </li></ul><ul><li>To use a transport delay model, the keyword transport must be used in a signal assignment statement </li></ul><ul><li>Ideal delay modeling can be obtained by using this delay model, where spikes would be propagated through instead of being ignored </li></ul><ul><li>Output<=transport (x) after 10ps; </li></ul>
    36. 36. Example: 1-bit Full Adder (with delay) <ul><li>entity FullAdder is </li></ul><ul><li>port (X, Y, Cin: in bit; -- Inputs </li></ul><ul><li>Cout, Sum: out bit); -- Outputs </li></ul><ul><li>end FullAdder; </li></ul>X Y Cin Sum Cout Full Adder
    37. 37. Example: 1-bit Full Adder (contd.) <ul><li>Architecture Equations of FullAdder is </li></ul><ul><li>begin -- Concurrent Assignment </li></ul><ul><li>Sum <= X xor Y xor Cin after 10 ns; </li></ul><ul><li>Cout <= (X and Y) or (X and Cin) or (Y and Cin) after 15 ns; </li></ul><ul><li>end Equations; </li></ul>
    38. 38. Example of Communicating Processes - the full adder . This example shows a model of a full adder constructed from 2 half-adders and a 2 input OR gate. The behavior of the 3 components is described using processes that communicate through signals . When there is an event on either of the input signals , process HA1 executes (see code in next slide), which creates events on internal signals s1 and s2. In1 In2 s1 c_in sum c_out HA HA OR s2 s3
    39. 39. library IEEE; use IEEE.std_logic_1164.all; entity full_adder is port (in1, in2, c_in: in std_ulogic; sum, c_out: out std_ulogic); end full_adder; architecture dataflow of full_adder is signal s1, s2, s3 : std_ulogic; constant gate_delay: Time :=5 ns ; begin L1: s1<=(in1 xor in2) after gate_delay; L2: s2<=(c_in and s1) after gate_delay; L3: s3<=(in1 and in2) after gate_delay; L4: sum<=(s1 xor c_in) after gate_delay; L5: c_out<=(s2 or s3) after gate_delay; end dataflow; Architecture Body Architecture Declarative Statement
    40. 40. Structural Model <ul><li>Digital circuits consist of components and interconnection between them </li></ul><ul><li>A component can in turn be composed of sub-components and their interconnections </li></ul><ul><li>A component interacts with other components through pins </li></ul><ul><li>Component is modeled as entity </li></ul><ul><li>Component pins are modeled as ports </li></ul><ul><li>Interconnections between components are modeled as signals </li></ul>
    41. 41. VHDL Structural Elements <ul><li>Entity: Interface </li></ul><ul><li>Architecture: Implementation, behavior, function </li></ul><ul><li>Process: Concurrency, event controlled </li></ul><ul><li>Configuration: Model chaining, structure, hierarchy </li></ul><ul><li>Package: Modular design, standard solution, data types, constants </li></ul><ul><li>Library: Compilation, object code </li></ul>
    42. 42. <ul><li>--Structural Description </li></ul><ul><li>entity AOI_Network is </li></ul><ul><li>port(A,B.C,D:in std_logic; </li></ul><ul><li>E:out std_logic); </li></ul><ul><li>end AOI_Network </li></ul><ul><li>architecture structural of AOI_Network is </li></ul><ul><li>component AND2 </li></ul><ul><li>port(x,y:in std_logic; </li></ul><ul><li>z:out std_logic); </li></ul><ul><li>end component; </li></ul>Chip A B C D E X Y
    43. 43. <ul><li>component or2 </li></ul><ul><li>port(x,y:in std_logic; </li></ul><ul><li>z:out std_logic); </li></ul><ul><li>end component; </li></ul><ul><li>signal X,Y:std_logic; </li></ul><ul><li>Begin </li></ul><ul><li>G1:AND2 port map (A,B,X); </li></ul><ul><li>G2:AND2 port map (C,D,Y); </li></ul><ul><li>G3:OR2 port map (X,Y,E); </li></ul><ul><li>End structural; </li></ul>
    44. 44. <ul><li>Before this the module should be previously defined </li></ul><ul><li>use library…. </li></ul><ul><li>entity AND2 is </li></ul><ul><li>port (u,v:in std_logic; </li></ul><ul><li>q:out std_logic); </li></ul><ul><li>end AND2; </li></ul><ul><li>architecture of AND2 is </li></ul><ul><li>begin </li></ul><ul><li>q<=u and v; </li></ul><ul><li>end AND2; </li></ul><ul><li>Similarly for OR2, module should be defined. </li></ul>
    45. 45. Example: 4-bit Adder <ul><li>entity Adder4 is </li></ul><ul><li>port (A, B: in bit_vector(3 downto 0); </li></ul><ul><li>Ci: in bit; -- Inputs </li></ul><ul><li>S: out bit_vector(3 downto 0); </li></ul><ul><li>Co: out bit); -- Outputs </li></ul><ul><li>end Adder4; </li></ul>
    46. 46. Example: 4-bit Adder (contd.) <ul><li>Architecture Structure of Adder4 is </li></ul><ul><li>Component FullAdder </li></ul><ul><li>port (X, Y, Cin: in bit; Cout, Sum: out bit); </li></ul><ul><li>signal C: bit_vector (3 downto 1); </li></ul><ul><li>begin -- Instantiations </li></ul><ul><li>FA0: FullAdder port map (A(0), B(0), Ci, C(1), S(0)); </li></ul><ul><li>FA1: FullAdder port map (A(1), B(1), C(1), C(2), S(1)); </li></ul><ul><li>FA2: FullAdder port map (A(2), B(2), C(2), C(3), S(2)); </li></ul><ul><li>FA3: FullAdder port map (A(3), B(3), C(3), Co, S(3)); </li></ul><ul><li>end Structure; </li></ul>
    47. 47. <ul><li>The concept of component can be understood using the concept of a design library, which is a collection of different modules, each defined by entity and architecture statement. </li></ul><ul><li>Once cells are used in library we can use copies by component command </li></ul><ul><li>This is called instancing the cell, and component itself is called an instance of the original. </li></ul>
    48. 48. Modeling the Behavior way <ul><li>Architecture body </li></ul><ul><ul><li>describes an implementation of an entity </li></ul></ul><ul><ul><li>may be several per entity </li></ul></ul><ul><li>Behavioral architecture </li></ul><ul><ul><li>describes the algorithm performed by the module </li></ul></ul><ul><ul><li>contains </li></ul></ul><ul><ul><ul><li>process statements , each containing </li></ul></ul></ul><ul><ul><ul><ul><li>sequential statements , including </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>signal assignment statements and </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>wait statements </li></ul></ul></ul></ul></ul>
    49. 49. Full Adder – using Processes <ul><li>library ieee; </li></ul><ul><li>use ieee.std_logic_1164 .all ; </li></ul><ul><li>entity FULL_ADDER is </li></ul><ul><li>port (A, B, Cin : in std_logic; </li></ul><ul><li>Sum, Cout : out std_logic); </li></ul><ul><li>end FULL_ADDER; </li></ul>                   
    50. 50. <ul><li>architecture BEHAV_FA of FULL_ADDER is </li></ul><ul><li>signal int1, int2, int3: std_logic; </li></ul><ul><li>begin </li></ul><ul><li>-- Process P1 that defines the first half adder </li></ul><ul><li>P1: process (A, B) </li></ul><ul><li>begin </li></ul><ul><li>int1<= A xor B ; </li></ul><ul><li>int2<= A and B; </li></ul><ul><ul><li>end process; </li></ul></ul><ul><li>-- Process P2 that defines the second half adder and the OR -- gate </li></ul><ul><li>P2: process (int1, int2, Cin) </li></ul><ul><li>begin </li></ul><ul><li>Sum <= int1 xor Cin; </li></ul><ul><li>int3 <= int1 and Cin; </li></ul><ul><li>Cout <= int2 or int3; </li></ul><ul><li>end process; </li></ul><ul><li>end BEHAV_FA; </li></ul>
    51. 51. Multiplexers A B Z A B I 3 A B’ I 2 A’ B’ I 0 Z Data inputs versus control inputs Use of muxes in control and data path 4-to-1 MUX I 0 I 1 I 2 I 3 A’ B I 1 A B Z 0 0 I 0 0 1 I 1 1 0 I 2 1 1 I 3 +
    52. 52. Concurrent Conditional Assignment: 4 to 1 Multiplexer <ul><li>y <= x0 when sel = 0 </li></ul><ul><li>else x1 when sel = 1 </li></ul><ul><li>else x2 when sel = 2 </li></ul><ul><li>else x3 when sel = 3 </li></ul>x0 x1 x2 x3 sel y
    53. 53. CASE Statement: 4 to 1 Multiplexer <ul><li>Case sel is </li></ul><ul><li>when 0 => y <= x0 </li></ul><ul><li>when 1 => y <= x1 </li></ul><ul><li>when 2 => y <= x2 </li></ul><ul><li>when 3 => y <= x3 </li></ul><ul><li>end case </li></ul>x0 x1 x2 x3 y
    54. 54. 2-to-4-decoder with enable, DeMUX
    55. 55. Example: DFF (contd.) <ul><li>Architecture Beh of DFF is </li></ul><ul><li>begin process (CLK) </li></ul><ul><li>begin if (CLK = ‘1’ then </li></ul><ul><li>Q <= D after 10 ns; </li></ul><ul><li>QN <= not D after 10 ns; </li></ul><ul><li>endif; </li></ul><ul><li>endprocess; </li></ul><ul><li>end Beh; </li></ul>
    56. 56. Internal Structure of a PLA Inputs A A’ B B’ C C’ AND ARRAY OR ARRAY F 0 F 1 F 2 F 3 Outputs A’B’ AC’ B BC’ AC
    57. 57. <ul><li>THANK YOU ALL </li></ul>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×