SlideShare a Scribd company logo
1 of 15
Download to read 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’;

More Related Content

Viewers also liked

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
 

Viewers also liked (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
 

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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’;