SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
Introduction to VHDL
            Fall 2008


          Jason Lor
   jlor@engmail.uwaterloo.ca
Outline
•   Brief Overview of VHDL
•   Structural Elements of VHDL
     •   Entity
     •   Architecture
     •   Signals

•   Data Types & Operators in VHDL
•   Assignment Execution
     •   Concurrent
     •   Sequential (Process)
Brief Overview of VHDL
• VHDL
 ... stands for Very High Speed Integrated Circuit
                 Hardware
                 Description
                 Language
 ... can be translated into an actual hardware implementation
 ... allows complex digital circuits to be easily created

 In VHDL, strong understanding of your code is more important
 than syntax & style.
Structural Elements
•   Entity

    •   Interface
        •   Example: Ports, I/O


•   Architecture

    •   Implementation
    •   Behaviour
    •   Function
Entity
• Describes the interactions of a module
entity GarageDoorOpener is             entity BlockName is
  port(                                  port(
        i_button : in std_logic;                clock_gen : in std_logic;
        i_sensor : in std_logic;                input1    : inout boolean;
        i_stop    : in std_logic;               input2    : in std_integer;

        o_active    : out std_logic;           output     : out string;
        o_direction : out std_logic            output1    : buffer character
     );                                     );
end entity;                            end entity;

 •    Port is a keyword that describes the data flow
 •    PortName : Mode DataType
 •    ‘;’ is used to separate elements, not for terminating the
      statement
Entity
          • Clock Generator

1
                                             Periodic Function
0


    Rising Edge               Falling Edge
Architecture

• Specifies the implementation of the module
• One entity can have several architectures
   architecture ArchitectureName of EntityName is
      begin
            a AND b => c;
   end ArchitectureName;



• Entity ports are available as signals within
  the architecture
Signals
• are intermediary ‘ports’ within the
  architecture
• represents wires and storage elements
• statements are concurrent

  architecture rtl of GarageDoorOpener is

    signal stop_door    : std_logic;
    signal SignalName   : datatype

  begin
    <architecture code here>
  end rtl;
Data Types
•   similar to programming, all signals and ports should
    have a data type
•   all signals and port must have a data type


      Data Types

       Boolean            Integer      std_logic_vector

          Bit              Real            std_logic

      Character                              type
Data Types
std_logic_vector is an array of std_logic variables
                      std_logic
                 U : uninitialized
                  X : unknown
                     0 : logic 0
                     1 : logic 1
               Z : high impedance
          W : weak signal (either 1 or 0)
           L : weak signal (leaning 0)
           H : weak signal (leaning 1)
                   - : don’t care
Data Types
• ‘type’                                        enumerable type
  • ... is an array of data types and values similar to std_logic_vector &
        std_logic
  • ... can be defined by you

  type TrafficLightState is
    (INIT, RED, REDYELLOW,YELLOW, GREEN);

  type LightSwitchState is
    (‘0’, ‘1’);

  type TypeName is
    (datatype, variablename);
Typical Operators
Logical Operators            Relational Operators
AND   NOR        NOT            =               Equal

                                /=            Not Equal
OR    NAND
                                <             Less than
XOR   XNOR
                                >            Greater than

             Mathematical Operators
             +                Addition
             -               Subtraction
             *              Multiplication
             /                Division
Assignment Execution
•   Concurrent/Continously or Combinational Logic
    • To give a signal a concurrent assignment
      SignalName <= expression;
    • Once your VHDL files compile, the compiler will
      assign your specifications to hardware components
      which operate in parallel with one another
•   Sequential Logic
    • Sequential logic is like programming in that your code
      executes in sequence
    • You can use conditional assignments like ‘if’, ‘case’ etc.
Assignment Execution
• In order to utilize sequential logic you
  have to use process statements
• There are two types of process
  statements, inside processes and outside
  processes
• ‘Process’ Statements
   • ... specifies a block of sequentially executed statements
   • ... run concurrently with each other
   • ... allows the use of if, else if, case, when, with, select statements
Assignment Execution
  library ieee;
  use ieee.std_logic_1164.all;
  use ieee.numeric_std.all;
Entity                                                        Architecture continued, Processes, Cases and If/elses
  entity TrafficLight is
     port(                                                      process(i_clock)
          i_clock : in std_logic;                                  begin
          i_pedestrian : out std_logic;                               if rising_edge(traffic_clock) then
                                                                       if i_pedestrian = ‘1’ then
         o_red : out std_logic;                                             current_state = YELLOW;
         o_yellow : out std_logic;                                     else
         o_green : out std_logic;                                           case current_state is
     );                                                                          when RED =>
  end entity;                                                                          current_state <= GREEN;
Architecture, Signal, Type                                                       when GREEN =>
 architecture RTL of TrafficLight is                                                    current_state <= RED;
    type state_t is (RED, YELLOW, GREEN);                                        when YELLOW =>
                                                                                   current_state <= RED;
    signal current_state : state_t;                                         end case;
                                                                         end if;
 begin                                                                 end if;
    o_red <= ‘1’ when (current_state = RED) else ‘0’;              end process;
    o_yellow <= ‘1’ when (current_state = YELLOW) else ‘0’;     end rtl;
    o_green <= ‘1’ when (current_state = GREEN) else ‘0’;

Mais conteúdo relacionado

Destaque

Komunikasi data pendahuluan_rev1
Komunikasi data pendahuluan_rev1Komunikasi data pendahuluan_rev1
Komunikasi data pendahuluan_rev1Pendidikan
 
Limeryki o zdrowiu z cyklu między kleksami
Limeryki o zdrowiu  z cyklu między kleksamiLimeryki o zdrowiu  z cyklu między kleksami
Limeryki o zdrowiu z cyklu między kleksamiEwelina Os
 
Early intervention 1.23.2012
Early intervention 1.23.2012Early intervention 1.23.2012
Early intervention 1.23.2012Healthy City
 
BHC webinar_General Users
BHC webinar_General UsersBHC webinar_General Users
BHC webinar_General UsersHealthy City
 
Motivation, Organisation and Campaigning
Motivation, Organisation and CampaigningMotivation, Organisation and Campaigning
Motivation, Organisation and Campaigningmore like people
 
How to Use HealthyCity.org for Uploading Your Own Data
How to Use HealthyCity.org for Uploading Your Own Data How to Use HealthyCity.org for Uploading Your Own Data
How to Use HealthyCity.org for Uploading Your Own Data Healthy City
 
211 Healthy City Webinar 3 25 10
211 Healthy City Webinar 3 25 10211 Healthy City Webinar 3 25 10
211 Healthy City Webinar 3 25 10Healthy City
 
Healthy City Presentation 3 23 10
Healthy City Presentation 3 23 10Healthy City Presentation 3 23 10
Healthy City Presentation 3 23 10Healthy City
 
Healthy City Community Planning and Development webinar
Healthy City Community Planning and Development webinarHealthy City Community Planning and Development webinar
Healthy City Community Planning and Development webinarHealthy City
 
ندوة الدراما التليفزيونية الأردنية
ندوة الدراما التليفزيونية الأردنيةندوة الدراما التليفزيونية الأردنية
ندوة الدراما التليفزيونية الأردنيةUrdun Mubdi3
 
Cwex and apprenticeship credits 2012
Cwex and apprenticeship credits 2012Cwex and apprenticeship credits 2012
Cwex and apprenticeship credits 2012V
 
Healthy City WEBINAR Introductory Training
Healthy City WEBINAR Introductory TrainingHealthy City WEBINAR Introductory Training
Healthy City WEBINAR Introductory TrainingHealthy City
 
How to make_godly_decisions
How to make_godly_decisionsHow to make_godly_decisions
How to make_godly_decisionsDon McClain
 

Destaque (18)

Komunikasi data pendahuluan_rev1
Komunikasi data pendahuluan_rev1Komunikasi data pendahuluan_rev1
Komunikasi data pendahuluan_rev1
 
Limeryki o zdrowiu z cyklu między kleksami
Limeryki o zdrowiu  z cyklu między kleksamiLimeryki o zdrowiu  z cyklu między kleksami
Limeryki o zdrowiu z cyklu między kleksami
 
Historiaurrea
HistoriaurreaHistoriaurrea
Historiaurrea
 
Early intervention 1.23.2012
Early intervention 1.23.2012Early intervention 1.23.2012
Early intervention 1.23.2012
 
BHC webinar_General Users
BHC webinar_General UsersBHC webinar_General Users
BHC webinar_General Users
 
Motivation, Organisation and Campaigning
Motivation, Organisation and CampaigningMotivation, Organisation and Campaigning
Motivation, Organisation and Campaigning
 
Sutro & AdX
Sutro  & AdXSutro  & AdX
Sutro & AdX
 
How to Use HealthyCity.org for Uploading Your Own Data
How to Use HealthyCity.org for Uploading Your Own Data How to Use HealthyCity.org for Uploading Your Own Data
How to Use HealthyCity.org for Uploading Your Own Data
 
211 Healthy City Webinar 3 25 10
211 Healthy City Webinar 3 25 10211 Healthy City Webinar 3 25 10
211 Healthy City Webinar 3 25 10
 
Healthy City Presentation 3 23 10
Healthy City Presentation 3 23 10Healthy City Presentation 3 23 10
Healthy City Presentation 3 23 10
 
Badakizue blog
Badakizue blogBadakizue blog
Badakizue blog
 
Unibertsoa
UnibertsoaUnibertsoa
Unibertsoa
 
Healthy City Community Planning and Development webinar
Healthy City Community Planning and Development webinarHealthy City Community Planning and Development webinar
Healthy City Community Planning and Development webinar
 
ندوة الدراما التليفزيونية الأردنية
ندوة الدراما التليفزيونية الأردنيةندوة الدراما التليفزيونية الأردنية
ندوة الدراما التليفزيونية الأردنية
 
Cwex and apprenticeship credits 2012
Cwex and apprenticeship credits 2012Cwex and apprenticeship credits 2012
Cwex and apprenticeship credits 2012
 
Healthy City WEBINAR Introductory Training
Healthy City WEBINAR Introductory TrainingHealthy City WEBINAR Introductory Training
Healthy City WEBINAR Introductory Training
 
Historiaurrea
HistoriaurreaHistoriaurrea
Historiaurrea
 
How to make_godly_decisions
How to make_godly_decisionsHow to make_godly_decisions
How to make_godly_decisions
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Introduction to VHDL

  • 1. Introduction to VHDL Fall 2008 Jason Lor jlor@engmail.uwaterloo.ca
  • 2. Outline • Brief Overview of VHDL • Structural Elements of VHDL • Entity • Architecture • Signals • Data Types & Operators in VHDL • Assignment Execution • Concurrent • Sequential (Process)
  • 3. Brief Overview of VHDL • VHDL ... stands for Very High Speed Integrated Circuit Hardware Description Language ... can be translated into an actual hardware implementation ... allows complex digital circuits to be easily created In VHDL, strong understanding of your code is more important than syntax & style.
  • 4. Structural Elements • Entity • Interface • Example: Ports, I/O • Architecture • Implementation • Behaviour • Function
  • 5. Entity • Describes the interactions of a module entity GarageDoorOpener is entity BlockName is port( port( i_button : in std_logic; clock_gen : in std_logic; i_sensor : in std_logic; input1 : inout boolean; i_stop : in std_logic; input2 : in std_integer; o_active : out std_logic; output : out string; o_direction : out std_logic output1 : buffer character ); ); end entity; end entity; • Port is a keyword that describes the data flow • PortName : Mode DataType • ‘;’ is used to separate elements, not for terminating the statement
  • 6. Entity • Clock Generator 1 Periodic Function 0 Rising Edge Falling Edge
  • 7. Architecture • Specifies the implementation of the module • One entity can have several architectures architecture ArchitectureName of EntityName is begin a AND b => c; end ArchitectureName; • Entity ports are available as signals within the architecture
  • 8. Signals • are intermediary ‘ports’ within the architecture • represents wires and storage elements • statements are concurrent architecture rtl of GarageDoorOpener is signal stop_door : std_logic; signal SignalName : datatype begin <architecture code here> end rtl;
  • 9. Data Types • similar to programming, all signals and ports should have a data type • all signals and port must have a data type Data Types Boolean Integer std_logic_vector Bit Real std_logic Character type
  • 10. Data Types std_logic_vector is an array of std_logic variables std_logic U : uninitialized X : unknown 0 : logic 0 1 : logic 1 Z : high impedance W : weak signal (either 1 or 0) L : weak signal (leaning 0) H : weak signal (leaning 1) - : don’t care
  • 11. Data Types • ‘type’ enumerable type • ... is an array of data types and values similar to std_logic_vector & std_logic • ... can be defined by you type TrafficLightState is (INIT, RED, REDYELLOW,YELLOW, GREEN); type LightSwitchState is (‘0’, ‘1’); type TypeName is (datatype, variablename);
  • 12. Typical Operators Logical Operators Relational Operators AND NOR NOT = Equal /= Not Equal OR NAND < Less than XOR XNOR > Greater than Mathematical Operators + Addition - Subtraction * Multiplication / Division
  • 13. Assignment Execution • Concurrent/Continously or Combinational Logic • To give a signal a concurrent assignment SignalName <= expression; • Once your VHDL files compile, the compiler will assign your specifications to hardware components which operate in parallel with one another • Sequential Logic • Sequential logic is like programming in that your code executes in sequence • You can use conditional assignments like ‘if’, ‘case’ etc.
  • 14. Assignment Execution • In order to utilize sequential logic you have to use process statements • There are two types of process statements, inside processes and outside processes • ‘Process’ Statements • ... specifies a block of sequentially executed statements • ... run concurrently with each other • ... allows the use of if, else if, case, when, with, select statements
  • 15. Assignment Execution library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; Entity Architecture continued, Processes, Cases and If/elses entity TrafficLight is port( process(i_clock) i_clock : in std_logic; begin i_pedestrian : out std_logic; if rising_edge(traffic_clock) then if i_pedestrian = ‘1’ then o_red : out std_logic; current_state = YELLOW; o_yellow : out std_logic; else o_green : out std_logic; case current_state is ); when RED => end entity; current_state <= GREEN; Architecture, Signal, Type when GREEN => architecture RTL of TrafficLight is current_state <= RED; type state_t is (RED, YELLOW, GREEN); when YELLOW => current_state <= RED; signal current_state : state_t; end case; end if; begin end if; o_red <= ‘1’ when (current_state = RED) else ‘0’; end process; o_yellow <= ‘1’ when (current_state = YELLOW) else ‘0’; end rtl; o_green <= ‘1’ when (current_state = GREEN) else ‘0’;