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

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Recently uploaded (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
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
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

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