SlideShare a Scribd company logo
1 of 17
Download to read offline
POLITECNICO DI MILANO


         VHDL – esempi
VHSIC-HDL, Very High Speed Integrated
Circuit Hardware Description Language
       DRESD How To (DHow2) – L6B


                 DRESD Team
                info@dresd.org
Processi
    Un process è un'istruzione concorrente che contiene un'area
    sequenziale.
    Un processo viene eseguito parallelamente alle altre istruzioni
    concorrenti.
       L'esecuzione del suo body può essere condizionata da una
       sensitivity list, una lista di segnali.
       La sensitivity list non si usa quando il body contiene
       un'istruzione wait.
           In questo caso l'esecuzione viene avviata e si sospende nel modo
           indicato da wait.
    Note:
       I segnali assegnati all'interno di un processo ricevono il valore
       solo dopo la sospensione del processo.
       In un processo le variabili locali conservano in proprio valore
       nel tempo tra un'esecuzione e l'altra.


2
Processi - Esempio



    p1: process (B, C)
                             p1_2: process
    begin
                             begin
      A <= B and C;
                               A <= B and C;
      C <= '0';
                               C <= '0';
    end;
                               wait on B, C;
                             end;




3
Struttura generale di un programma

                   use libreria

                   entity circuito is
                   ...
                   end circutio;

                   architecture archi of circuito is
                   -- istruzione concorrente 1
                   -- istruzione concorrente 2
                   begin
                         pa: process
                                                                  Area sequenziale
                         begin
                                -- istruzione sequenziale pa_1
Area concorrente                -- istruzione sequenziale pa_2
                                  -- ...
                          end;

                                                                  Area sequenziale
                          pb: process
                          begin
                                 -- istruzione sequenziale pa_2
                                 -- ...
                          end;
                   end;
Controllo dei processi: IF-THEN-ELSE

SIGNAL a : STD_LOGIC_VECTOR(2 downto 0);
SIGNAL y : STD_LOGIC_VECTOR(2 downto 0);
SIGNAL enable : STD_LOGIC;


PROCESS( enable)
                                           a2
BEGIN
                                                y2
   IF (enable = ‘1’) THEN
          y <= a;
                                           a1
   ELSE
                                                y1
        y <= ”000”;
   END IF;
END PROCESS;
                                           a0   y0
                               enable
Controllo dei processi: CASE


SIGNAL a : STD_LOGIC;
SIGNAL y : STD_LOGIC;
SIGNAL enable : STD_LOGIC_VECTOR(1 downto 0);

PROCESS ( enable )
BEGIN
   CASE enable IS
        WHEN “00” =>
                   y <= a;
        WHEN “01” =>
                   y <= ‘0’;
        WHEN “10” =>
                   y <= ‘0’;
        WHEN OTHERS =>
                   y <= ‘1’;
   END CASE;
END PROCESS;
Controllo dei processi: CASE - DECODER


SIGNAL y : STD_LOGIC_VECTOR(3 downto 0);
SIGNAL a : STD_LOGIC_VECTOR(1 downto 0);

PROCESS (a)
BEGIN
   CASE a IS
                                                    y3
        WHEN “00” =>
                                 a1                 y2
                y <= “0001”;
                                           DECODE
        WHEN “01” =>             a0                 y1
                                           R
                y <= “0010”;
                                                    y0
        WHEN “10” =>
                y <= “0100”;
        WHEN “11” =>
                y <= “1000”;
        WHEN OTHERS => ;
   END CASE;
END PROCESS;
Circuiti Sequenziali: FF-D

entity ffd is
port(
   d:              in std_logic;
   clk:            in std_logic;
   q:              out std_logic
);
                                        d                q
end ffd;
                                             Flip-Flop
                                       clk
ARCHITECTURE arch OF ffd IS
                                             D
BEGIN
   PROCESS(clk)
   BEGIN
        IF (clk’EVENT AND clk = ‘1’)
   THEN
                  q <= d;
        END IF;
   END PROCESS;
END arch;
Circuiti Sequenziali: FF-D con RESET


entity ffd is
port(
   d:                in std_logic;
   clk:              in std_logic;
   reset:            in std_logic;
                                                  d                q
   q:                out std_logic
);
end ffd;                                               Flip-Flop
                                                 clk
                                                       D
ARCHITECTURE arch OF ffd IS
BEGIN
    PROCESS(clk, reset)
    BEGIN
          IF (reset = ‘1’) THEN
                                                         reset
                       q <= ‘0’;
          ELSIF (clk’EVENT AND clk = ‘1’) THEN
                       q <= d;
          END IF;
    END PROCESS;
END arch;
Contatore
ARCHITECTURE arch OF counter IS
BEGIN
   PROCESS(clk, reset)
   BEGIN
           IF (reset = ‘1’) THEN
                       q <= ‘000’;
           ELSIF (clk’EVENT AND clk = ‘1’) THEN
                      IF q >= 9 THEN
                                   q <= ‘000’;
                      ELSE
                                   q <= q + 1;
                      END IF;
           END IF;
   END PROCESS;
END arch;
Double DRIVEN


ARCHITECTURE arch OF circ IS
SIGNAL s : BIT;
BEGIN
   PROCESS
   BEGIN
         s <= operazione1;
                                       operazione1
   END PROCESS;


                                                     S
   PROCESS
   BEGIN
         s <= operazione2;
   END PROCESS;
                                       operazione2
END arch;
Macchina a stati finiti: FSM
FSM 1/4 - Entity
     -----------------------------------------------------

     library ieee ;
     use ieee.std_logic_1164.all;

     -----------------------------------------------------

     entity seq_design is
     port(
        a:               in std_logic;
         clock:                     in std_logic;
         reset:                     in std_logic;
         x:              out std_logic
     );
     end seq_design;

     -----------------------------------------------------




13
FSM 2/4 – Architecture: process#1
     architecture FSM of seq_design is

       -- define the states of FSM model

       type state_type is (S0, S1, S2, S3);
       signal next_state, current_state: state_type;

     begin

       -- cocurrent process#1: state registers
       state_reg: process(clock, reset)
       begin

         if (reset='1') then
              current_state <= S0;
         elsif (clock'event and clock='1') then
             current_state <= next_state;
         end if;

       end process;




14
FSM 3/4 – Architecture: process#2

     -- cocurrent process#2: combinational logic
        comb_logic: process(current_state, a)
        begin

        -- use case statement to show the
        -- state transistion

        case current_state is

           when S0 =>     x <= '0';
                          if a='0' then
                             next_state <= S0;
                          elsif a ='1' then
                             next_state <= S1;
                          end if;

           when S1 =>     x <= '0';
                          if a='0' then
                             next_state <= S1;
                          elsif a='1' then
                             next_state <= S2;
                          end if;
15
FSM 4/4 – Architecture: process#2


           when S2 =>       x <= '0';
                            if a='0' then
                               next_state <= S2;
                            elsif a='1' then
                               next_state <= S3;
                            end if;

           when S3 =>       x <= '1';
                            if a='0' then
                               next_state <= S3;
                            elsif a='1' then
                               next_state <= S0;
                            end if;

           when others =>
                            x <= '0';
                            next_state <= S0;

         end case;

       end process;

     end FSM;
16
Questions




17

More Related Content

What's hot

Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical fileArchita Misra
 
Introduction to Verilog & code coverage
Introduction to Verilog & code coverageIntroduction to Verilog & code coverage
Introduction to Verilog & code coverageJyun-Kai Hu
 
Day4 Lab
Day4 LabDay4 Lab
Day4 LabRon Liu
 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogsumedh23
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical FileSoumya Behera
 
94257825 bao-cao-pld
94257825 bao-cao-pld94257825 bao-cao-pld
94257825 bao-cao-pldbuianhminh
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesRicardo Castro
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECERamesh Naik Bhukya
 
radix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdfradix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdfsakthi1986
 
Indirect Communications (Concurrency)
Indirect Communications (Concurrency)Indirect Communications (Concurrency)
Indirect Communications (Concurrency)Sri Prasanna
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 CardOmar Sanchez
 
SPICE MODEL of TC7WZ74FK in SPICE PARK
SPICE MODEL of TC7WZ74FK in SPICE PARKSPICE MODEL of TC7WZ74FK in SPICE PARK
SPICE MODEL of TC7WZ74FK in SPICE PARKTsuyoshi Horigome
 

What's hot (20)

Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical file
 
Introduction to Verilog & code coverage
Introduction to Verilog & code coverageIntroduction to Verilog & code coverage
Introduction to Verilog & code coverage
 
Day4 Lab
Day4 LabDay4 Lab
Day4 Lab
 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilog
 
گزارش کار
گزارش کارگزارش کار
گزارش کار
 
Lab9 processos
Lab9 processosLab9 processos
Lab9 processos
 
Direct analog
Direct analogDirect analog
Direct analog
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
 
94257825 bao-cao-pld
94257825 bao-cao-pld94257825 bao-cao-pld
94257825 bao-cao-pld
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
 
Appsec obfuscator reloaded
Appsec obfuscator reloadedAppsec obfuscator reloaded
Appsec obfuscator reloaded
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECE
 
Flip flops
Flip flopsFlip flops
Flip flops
 
radix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdfradix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdf
 
Reporte vhd10
Reporte vhd10Reporte vhd10
Reporte vhd10
 
Indirect Communications (Concurrency)
Indirect Communications (Concurrency)Indirect Communications (Concurrency)
Indirect Communications (Concurrency)
 
Functions for Nano 5 Card
Functions for Nano 5 CardFunctions for Nano 5 Card
Functions for Nano 5 Card
 
07 sequential verilog
07 sequential verilog07 sequential verilog
07 sequential verilog
 
Ds flip flop
Ds flip flopDs flip flop
Ds flip flop
 
SPICE MODEL of TC7WZ74FK in SPICE PARK
SPICE MODEL of TC7WZ74FK in SPICE PARKSPICE MODEL of TC7WZ74FK in SPICE PARK
SPICE MODEL of TC7WZ74FK in SPICE PARK
 

Viewers also liked (8)

3rd 3DDRESD: BSS
3rd 3DDRESD: BSS3rd 3DDRESD: BSS
3rd 3DDRESD: BSS
 
RCIM 2008 - - ALTERA
RCIM 2008 - - ALTERARCIM 2008 - - ALTERA
RCIM 2008 - - ALTERA
 
RCIM 2008 - - UniCal
RCIM 2008 - - UniCalRCIM 2008 - - UniCal
RCIM 2008 - - UniCal
 
DHow2 - L5
DHow2 - L5DHow2 - L5
DHow2 - L5
 
RCIM 2008 - - ALaRI
RCIM 2008 - - ALaRIRCIM 2008 - - ALaRI
RCIM 2008 - - ALaRI
 
DHow2 - L6 Ant
DHow2 - L6 AntDHow2 - L6 Ant
DHow2 - L6 Ant
 
RCIM 2008 - - hArtes Atmel
RCIM 2008 - - hArtes AtmelRCIM 2008 - - hArtes Atmel
RCIM 2008 - - hArtes Atmel
 
indian fun
indian funindian fun
indian fun
 

Similar to DHow2 - L6 VHDL

Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLOmkar Rane
 
Writing more complex models
Writing more complex modelsWriting more complex models
Writing more complex modelsMohamed Samy
 
VHdl lab report
VHdl lab reportVHdl lab report
VHdl lab reportJinesh Kb
 
HDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdfHDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdfkaarthikK6
 
VHDL summary.pdf
VHDL summary.pdfVHDL summary.pdf
VHDL summary.pdfwafawafa52
 
Data Acquisition
Data AcquisitionData Acquisition
Data Acquisitionazhar557
 
Digital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsDigital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsIndira Priyadarshini
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitorssgpraju
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manualSanthosh Poralu
 
Practical file
Practical filePractical file
Practical filerajeevkr35
 
Pipeline stalling in vhdl
Pipeline stalling in vhdlPipeline stalling in vhdl
Pipeline stalling in vhdlSai Malleswar
 
Home automation system
Home automation system Home automation system
Home automation system Hira Shaukat
 

Similar to DHow2 - L6 VHDL (20)

Verilog_Examples (1).pdf
Verilog_Examples (1).pdfVerilog_Examples (1).pdf
Verilog_Examples (1).pdf
 
vhdll.docx
vhdll.docxvhdll.docx
vhdll.docx
 
Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDL
 
Writing more complex models
Writing more complex modelsWriting more complex models
Writing more complex models
 
Uart
UartUart
Uart
 
Basic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.pptBasic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.ppt
 
VHdl lab report
VHdl lab reportVHdl lab report
VHdl lab report
 
Behavioral modelling in VHDL
Behavioral modelling in VHDLBehavioral modelling in VHDL
Behavioral modelling in VHDL
 
HDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdfHDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdf
 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational Circuits
 
VHDL summary.pdf
VHDL summary.pdfVHDL summary.pdf
VHDL summary.pdf
 
m4_VHDL_ED.pdf
m4_VHDL_ED.pdfm4_VHDL_ED.pdf
m4_VHDL_ED.pdf
 
Data Acquisition
Data AcquisitionData Acquisition
Data Acquisition
 
Digital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsDigital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential Circuits
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitors
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
Practical file
Practical filePractical file
Practical file
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
 
Pipeline stalling in vhdl
Pipeline stalling in vhdlPipeline stalling in vhdl
Pipeline stalling in vhdl
 
Home automation system
Home automation system Home automation system
Home automation system
 

More from Marco Santambrogio (20)

RCIM 2008 - Modello Scheduling
RCIM 2008 - Modello SchedulingRCIM 2008 - Modello Scheduling
RCIM 2008 - Modello Scheduling
 
RCIM 2008 - HLR
RCIM 2008 - HLRRCIM 2008 - HLR
RCIM 2008 - HLR
 
RCIM 2008 -- EHW
RCIM 2008 -- EHWRCIM 2008 -- EHW
RCIM 2008 -- EHW
 
RCIM 2008 - Modello Generale
RCIM 2008 - Modello GeneraleRCIM 2008 - Modello Generale
RCIM 2008 - Modello Generale
 
RCIM 2008 - Allocation Relocation
RCIM 2008 - Allocation RelocationRCIM 2008 - Allocation Relocation
RCIM 2008 - Allocation Relocation
 
RCIM 2008 - - hArtes_Ferrara
RCIM 2008 - - hArtes_FerraraRCIM 2008 - - hArtes_Ferrara
RCIM 2008 - - hArtes_Ferrara
 
RCIM 2008 - Janus
RCIM 2008 - JanusRCIM 2008 - Janus
RCIM 2008 - Janus
 
RCIM 2008 - Intro
RCIM 2008 - IntroRCIM 2008 - Intro
RCIM 2008 - Intro
 
DHow2 - L2
DHow2 - L2DHow2 - L2
DHow2 - L2
 
DHow2 - L4
DHow2 - L4DHow2 - L4
DHow2 - L4
 
DHow2 - L1
DHow2 - L1DHow2 - L1
DHow2 - L1
 
RCW@DEI - Treasure hunt
RCW@DEI - Treasure huntRCW@DEI - Treasure hunt
RCW@DEI - Treasure hunt
 
RCW@DEI - ADL
RCW@DEI - ADLRCW@DEI - ADL
RCW@DEI - ADL
 
RCW@DEI - Design Flow 4 SoPc
RCW@DEI - Design Flow 4 SoPcRCW@DEI - Design Flow 4 SoPc
RCW@DEI - Design Flow 4 SoPc
 
RCW@DEI - Real Needs And Limits
RCW@DEI - Real Needs And LimitsRCW@DEI - Real Needs And Limits
RCW@DEI - Real Needs And Limits
 
RCW@DEI - Basic Concepts
RCW@DEI - Basic ConceptsRCW@DEI - Basic Concepts
RCW@DEI - Basic Concepts
 
RCW@DEI - Reconf Comp
RCW@DEI - Reconf CompRCW@DEI - Reconf Comp
RCW@DEI - Reconf Comp
 
Blanket project presentation
Blanket project presentationBlanket project presentation
Blanket project presentation
 
3rd 3DDRESD: DRESD Future Plan 0809
3rd 3DDRESD: DRESD Future Plan 08093rd 3DDRESD: DRESD Future Plan 0809
3rd 3DDRESD: DRESD Future Plan 0809
 
UIC Panella Thesis
UIC Panella ThesisUIC Panella Thesis
UIC Panella Thesis
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
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
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
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
 

DHow2 - L6 VHDL

  • 1. POLITECNICO DI MILANO VHDL – esempi VHSIC-HDL, Very High Speed Integrated Circuit Hardware Description Language DRESD How To (DHow2) – L6B DRESD Team info@dresd.org
  • 2. Processi Un process è un'istruzione concorrente che contiene un'area sequenziale. Un processo viene eseguito parallelamente alle altre istruzioni concorrenti. L'esecuzione del suo body può essere condizionata da una sensitivity list, una lista di segnali. La sensitivity list non si usa quando il body contiene un'istruzione wait. In questo caso l'esecuzione viene avviata e si sospende nel modo indicato da wait. Note: I segnali assegnati all'interno di un processo ricevono il valore solo dopo la sospensione del processo. In un processo le variabili locali conservano in proprio valore nel tempo tra un'esecuzione e l'altra. 2
  • 3. Processi - Esempio p1: process (B, C) p1_2: process begin begin A <= B and C; A <= B and C; C <= '0'; C <= '0'; end; wait on B, C; end; 3
  • 4. Struttura generale di un programma use libreria entity circuito is ... end circutio; architecture archi of circuito is -- istruzione concorrente 1 -- istruzione concorrente 2 begin pa: process Area sequenziale begin -- istruzione sequenziale pa_1 Area concorrente -- istruzione sequenziale pa_2 -- ... end; Area sequenziale pb: process begin -- istruzione sequenziale pa_2 -- ... end; end;
  • 5. Controllo dei processi: IF-THEN-ELSE SIGNAL a : STD_LOGIC_VECTOR(2 downto 0); SIGNAL y : STD_LOGIC_VECTOR(2 downto 0); SIGNAL enable : STD_LOGIC; PROCESS( enable) a2 BEGIN y2 IF (enable = ‘1’) THEN y <= a; a1 ELSE y1 y <= ”000”; END IF; END PROCESS; a0 y0 enable
  • 6. Controllo dei processi: CASE SIGNAL a : STD_LOGIC; SIGNAL y : STD_LOGIC; SIGNAL enable : STD_LOGIC_VECTOR(1 downto 0); PROCESS ( enable ) BEGIN CASE enable IS WHEN “00” => y <= a; WHEN “01” => y <= ‘0’; WHEN “10” => y <= ‘0’; WHEN OTHERS => y <= ‘1’; END CASE; END PROCESS;
  • 7. Controllo dei processi: CASE - DECODER SIGNAL y : STD_LOGIC_VECTOR(3 downto 0); SIGNAL a : STD_LOGIC_VECTOR(1 downto 0); PROCESS (a) BEGIN CASE a IS y3 WHEN “00” => a1 y2 y <= “0001”; DECODE WHEN “01” => a0 y1 R y <= “0010”; y0 WHEN “10” => y <= “0100”; WHEN “11” => y <= “1000”; WHEN OTHERS => ; END CASE; END PROCESS;
  • 8. Circuiti Sequenziali: FF-D entity ffd is port( d: in std_logic; clk: in std_logic; q: out std_logic ); d q end ffd; Flip-Flop clk ARCHITECTURE arch OF ffd IS D BEGIN PROCESS(clk) BEGIN IF (clk’EVENT AND clk = ‘1’) THEN q <= d; END IF; END PROCESS; END arch;
  • 9. Circuiti Sequenziali: FF-D con RESET entity ffd is port( d: in std_logic; clk: in std_logic; reset: in std_logic; d q q: out std_logic ); end ffd; Flip-Flop clk D ARCHITECTURE arch OF ffd IS BEGIN PROCESS(clk, reset) BEGIN IF (reset = ‘1’) THEN reset q <= ‘0’; ELSIF (clk’EVENT AND clk = ‘1’) THEN q <= d; END IF; END PROCESS; END arch;
  • 10. Contatore ARCHITECTURE arch OF counter IS BEGIN PROCESS(clk, reset) BEGIN IF (reset = ‘1’) THEN q <= ‘000’; ELSIF (clk’EVENT AND clk = ‘1’) THEN IF q >= 9 THEN q <= ‘000’; ELSE q <= q + 1; END IF; END IF; END PROCESS; END arch;
  • 11. Double DRIVEN ARCHITECTURE arch OF circ IS SIGNAL s : BIT; BEGIN PROCESS BEGIN s <= operazione1; operazione1 END PROCESS; S PROCESS BEGIN s <= operazione2; END PROCESS; operazione2 END arch;
  • 12. Macchina a stati finiti: FSM
  • 13. FSM 1/4 - Entity ----------------------------------------------------- library ieee ; use ieee.std_logic_1164.all; ----------------------------------------------------- entity seq_design is port( a: in std_logic; clock: in std_logic; reset: in std_logic; x: out std_logic ); end seq_design; ----------------------------------------------------- 13
  • 14. FSM 2/4 – Architecture: process#1 architecture FSM of seq_design is -- define the states of FSM model type state_type is (S0, S1, S2, S3); signal next_state, current_state: state_type; begin -- cocurrent process#1: state registers state_reg: process(clock, reset) begin if (reset='1') then current_state <= S0; elsif (clock'event and clock='1') then current_state <= next_state; end if; end process; 14
  • 15. FSM 3/4 – Architecture: process#2 -- cocurrent process#2: combinational logic comb_logic: process(current_state, a) begin -- use case statement to show the -- state transistion case current_state is when S0 => x <= '0'; if a='0' then next_state <= S0; elsif a ='1' then next_state <= S1; end if; when S1 => x <= '0'; if a='0' then next_state <= S1; elsif a='1' then next_state <= S2; end if; 15
  • 16. FSM 4/4 – Architecture: process#2 when S2 => x <= '0'; if a='0' then next_state <= S2; elsif a='1' then next_state <= S3; end if; when S3 => x <= '1'; if a='0' then next_state <= S3; elsif a='1' then next_state <= S0; end if; when others => x <= '0'; next_state <= S0; end case; end process; end FSM; 16