SlideShare a Scribd company logo
VHDL 360© by: Mohamed Samy         Samer El-Saadany
Copyrights Copyright © 2010/2011 to authors. All rights reserved All content in this presentation, including charts, data, artwork and logos (from here on, "the Content"), is the property of Mohamed Samy and Samer El-Saadany or the corresponding owners, depending on the circumstances of publication, and is protected by national and international copyright laws. Authors are not personally liable for your usage of the Content that entailed casual or indirect destruction of anything or actions entailed to information profit loss or other losses. Users are granted to access, display, download and print portions of this presentation, solely for their own personal non-commercial use, provided that all proprietary notices are kept intact.  Product names and trademarks mentioned in this presentation belong to their respective owners. VHDL 360 © 2
Module 4 Synthesis Examples
Objective Getting familiar with code changes' impact on synthesis Skills gained: Writing synthesis friendly code VHDL 360 © 4
Outline Introduction Synthesize and Learn Combinational Logic Latch Inference Sequential Logic Flip-Flop Inference VHDL 360 © 5
Introduction VHDL 360 © 6 VHDL is a H/W modeling language used to model digital circuits Digital circuits can be either Combinational or Sequential Combinational Logic circuits: Implement Boolean functions whose output is only dependant on the present inputs Sequential Logic circuits: Implement circuits whose output depends on the present inputs & the history of the inputs. i.e. Circuits having storage elements
Introduction VHDL 360 © 7 VHDL Standard Synthesizable VHDL Synthesis tools translate the VHDL code to a gate level netlist representing the actual H/W gates [and, or, not, Flip-Flops…etc] Only a subset of the language is synthesizable A model can be either Synthesizable: Used for both Simulation & Synthesis Non-Synthesizable:  Used for Simulation only
Synthesize And Learn 8
Synthesize and Learn In the next slides we will use examples from the previous modules to demonstrate synthesis and study the synthesized logic We will also modify these examples and observe the impact on the synthesized logic 9 VHDL 360 ©
Combinational Logic libraryIEEE; useIEEE.std_logic_1164.all; Entitymux_caseis  Port(a, b, c, d:instd_logic; Sel:instd_logic_vector(1downto0);       F:outstd_logic); Endentity; Architecture rtl ofmux_caseis begin   process(a,b,c,d,sel)is begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase;   Endprocess; Endarchitecture; VHDL 360 © 10 Example 1: 4x1 Multiplexer
Skills Check ,[object Object],Architecture rtl ofmux_caseis begin   process(a,b,c,d,sel)is begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase;   Endprocess; Endarchitecture; VHDL 360 © 11 Example 1: 4x1 Multiplexer Example 2: 4x1 Multiplexer  Architecture rtl ofmux_caseis begin   process(a, sel)is begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase;   Endprocess; Endarchitecture;
Skills Check (Soln.) Architecture rtl ofmux_caseis begin   process(a,b,c,d,sel)is begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase;   Endprocess; Endarchitecture; VHDL 360 © 12 ,[object Object]
Synthesis tools don’t use the sensitivity list to determine the logic, but simulation tools depend on the sensitivity list to execute the process
Example 2 suffers a problem called “Simulation – Synthesis mismatch”Example 1: 4x1 Multiplexer Example 2: 4x1 Multiplexer Architecture rtl ofmux_caseis begin   process(a, sel)is begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase;   Endprocess; Endarchitecture;
Combinational Logic ,[object Object],Architecture rtl ofmux_caseis begin   process(all)is   begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase;   Endprocess; Endarchitecture; VHDL 360 © 13 Example 3 Golden rule of thumb ,[object Object],*Not yet supported by all tools in the market
Combinational Logic 14 VHDL 360 © Example 4: Adder-Subtractor LIBRARYieee; USEieee.std_logic_1164.all; USEieee.std_logic_arith.all; ENTITYadd_subIS port(a, b :ininteger;         result :outinteger; operation:instd_logic); ENDENTITY; ARCHITECTURE behave OFadd_subIS BEGIN process(a, b, operation) begin if(operation = '1')then result <= a + b; else           result <= a - b; endif; endprocess; ENDARCHITECTURE;
Combinational Logic 15 VHDL 360 © Consider that someone tries to re-use that code to implement an adder with an enable  He modifies the add_sub example; removes the else branch & renames the “operation” port to “enable” as shown below, How would these changes affect the logic? Example 5: LIBRARYieee; USEieee.std_logic_1164.all; USEieee.std_logic_arith.all; ENTITY adder IS port(a, b :ininteger;         result :outinteger; enable:instd_logic); ENDENTITY adder; ARCHITECTURE behave OF adder IS BEGIN process(a, b, enable) begin if(enable = '1')then  result <= a + b; endif; endprocess; ENDARCHITECTURE;
Combinational Logic 16 VHDL 360 © This will infer a latch, because we didn’t specify what should happen to “result” when “enable” isn’t equal to '1' Simulation & synthesis tools will just keep the value as is…i.e. It latches the last value Example 5: LIBRARYieee; USEieee.std_logic_1164.all; USEieee.std_logic_arith.all; ENTITY adder IS port(a, b :ininteger;         result :outinteger; enable:instd_logic); ENDENTITY adder; ARCHITECTURE behave OF adder IS BEGIN process(a, b, enable) begin if(enable = '1')then  result <= a + b; endif; endprocess; ENDARCHITECTURE;
Combinational Logic In the below example, the "11" value of "sel" signal is not listed as a case choice, hence signal "F" is not assigned a value in this case A Latch is inferred in this example  Probably that wasn’t needed Example 6: LIBRARYieee; USEieee.std_logic_1164.all; ENTITYincomplete_caseIS port(sel:std_logic_vector(1downto0);        A, B:std_logic;        F   :outstd_logic); ENDENTITY; ARCHITECTURE rtl OFincomplete_caseIS BEGIN   process(sel, A, B)   begin     case(sel)is     when"00"=>       F <= A;     when"01"=>       F <= B;     when"10"=>       F <= A xor B;     whenothers=>null;     endcase;   endprocess; ENDARCHITECTURE; 17 VHDL 360 ©
Skills Check Do you think a Latch would be inferred in the below example? Example 7: LIBRARYieee; USEieee.std_logic_1164.all; ENTITYincomplete_assignmentIS   port(sel:instd_logic_vector(1downto0);        A, B  :instd_logic;        O1, O2:outstd_logic); ENDENTITY; ARCHITECTURE rtl OFincomplete_assignmentIS BEGIN   process(sel, A, B)begin     case(sel)is     when"00"=>       O1 <= A;       O2 <= A and B;     when"01"=>       O1 <= B;       O2 <= A xor B;     when"10"=>       O1 <= A xor B;     when"11"=>       O2 <= A or B;     whenothers=>       O1 <= '0';       O2 <= '0';     endcase;   endprocess; ENDARCHITECTURE; 18 VHDL 360 ©
Skills Check (Soln.) Example 7: LIBRARYieee; USEieee.std_logic_1164.all; ENTITYincomplete_assignmentIS   port(sel:instd_logic_vector(1downto0);        A, B  :instd_logic;        O1, O2:outstd_logic); ENDENTITY; ARCHITECTURE rtl OFincomplete_assignmentIS BEGIN   process(sel, A, B)begin     case(sel)is     when"00"=>       O1 <= A;       O2 <= A and B;     when"01"=>       O1 <= B;       O2 <= A xor B;     when"10"=>       O1 <= A xor B;     when"11"=>       O2 <= A or B;     whenothers=>       O1 <= '0';       O2 <= '0';     endcase;   endprocess; ENDARCHITECTURE; 19 VHDL 360 © Do you think a Latch would be inferred in the below example? ,[object Object]
Though the case is complete & no "null" statement is there, we find that "O1" & "O2" are not assigned in all case's branches  This is called “Incomplete signal assignment”,[object Object]
Enough CombinationalLet's Go Sequential 21
Sequential Logic 22 VHDL 360 © ,[object Object],Example 8: Libraryieee; useieee.std_logic_1164.all; Entity d_ff is Port(d, clk, rst :instd_logic; Q, nQ :outstd_logic); endentity; Architecture behav of d_ff is Begin process(clk) begin If(rising_edge(clk))then If(rst = '1')then          Q <= '0';          nQ <= '0';        else          Q <= d;          nQ <=not (d);        endif;      endif; endprocess; end behav;
Sequential Logic 23 VHDL 360 © ,[object Object],Example 8: Libraryieee; useieee.std_logic_1164.all; Entity d_ff is Port(d, clk, rst :instd_logic; Q, nQ :outstd_logic); endentity; Architecture behav of d_ff is Begin process(clk) begin If(rising_edge(clk))then If(rst = '1')then          Q <= '0';          nQ <='1';        else          Q <= d;          nQ <=not (d);        endif;      endif; endprocess; end behav; Two Flip-Flops ?! Change the code to have only one Flip-Flop
Sequential Logic 24 VHDL 360 © ,[object Object],Example 9: Libraryieee; useieee.std_logic_1164.all; Entity d_ff is Port( d, clk, rst :instd_logic;  Q, nQ :outstd_logic); endentity; Architecture behav of d_ff is signal Q_int:std_logic; Begin process(clk) begin If(rising_edge(clk))then If(rst = '1')then          Q_int <= '0';        else         Q_int <= d;        endif;      endif; endprocess; Q <= Q_int; nQ <=not (Q_int); end behav; Yep…That's what we want!
Sequential Logic 25 VHDL 360 © ,[object Object],Example 10: Libraryieee; useieee.std_logic_1164.all; Entity d_ffs is Port(d: std_logic_vector(3downto0); clk, rst :instd_logic; Q, nQ :outstd_logic_vector(3downto0)); endentity; Architecture behav of d_ffs is signal Q_int:std_logic_vector(3downto0); Begin process(clk) begin If(rising_edge(clk))then If(rst = '1')then          Q_int <= (others => '0');        else         Q_int <= d;        endif;      endif; endprocess; Q <= Q_int; nQ <=not (Q_int); end behav;
Sequential Logic Example 11: 8-bit Shift Register (Shift right) Libraryieee; useieee.std_logic_1164.all; entity shift_register is   Port( clk, D, enable :inSTD_LOGIC;    Q :outSTD_LOGIC); endentity; architecture Behavioral of shift_register is begin process(clk) variable reg:std_logic_vector(7downto0); begin ifrising_edge(clk)then if enable = '1' then for i in1to7loop           reg(i-1):= reg(i); endloop;         reg(7):= d; endif; endif;     Q <= reg(0);   endprocess; end Behavioral; 7    6    5   4    3    2    1    0 VHDL 360 © 26
Flip-Flop Inference Assignments under clock edge where the object value needs to be remembered across multiple process invocations  Flip-Flop Signal assignment under clock edge will always infer a Flip-Flop Variable assignment under clock edge will infer Flip-Flop only when its value ought to be remembered across process invocations 27 VHDL 360 ©

More Related Content

What's hot

Discover the nanoworld
Discover the nanoworldDiscover the nanoworld
Discover the nanoworld
NANOYOU
 
Talambuhay ni jose rizal
Talambuhay ni jose rizalTalambuhay ni jose rizal
Talambuhay ni jose rizal
Kathlyn Malolot
 
Kabanata 34 El Filibusterismo
Kabanata 34 El FilibusterismoKabanata 34 El Filibusterismo
Kabanata 34 El Filibusterismo
Ella Nacino
 
03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...
03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...
03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...
Humi
 
El filibusterismo report
El filibusterismo reportEl filibusterismo report
El filibusterismo reportJessica Nario
 
El-Filibusterismo.pptx
El-Filibusterismo.pptxEl-Filibusterismo.pptx
El-Filibusterismo.pptx
michelle velasco
 
Buod ng Noli Me Tangere
Buod ng Noli Me TangereBuod ng Noli Me Tangere
Buod ng Noli Me Tangere
SCPS
 
Malawakang kahirapan sa pilipinas
Malawakang kahirapan  sa pilipinasMalawakang kahirapan  sa pilipinas
Malawakang kahirapan sa pilipinasKatrin Fernandez
 
Masinop na Pagsulat-Korespondensiya Opisyal.pptx
Masinop na Pagsulat-Korespondensiya Opisyal.pptxMasinop na Pagsulat-Korespondensiya Opisyal.pptx
Masinop na Pagsulat-Korespondensiya Opisyal.pptx
KelvinCruz34
 
Talambuhay ni Jose Rizal
Talambuhay ni Jose RizalTalambuhay ni Jose Rizal
Talambuhay ni Jose Rizal
Don Joreck Santos
 
Katamaran ng mga pilipino
Katamaran ng mga pilipinoKatamaran ng mga pilipino
Katamaran ng mga pilipinoFrans Sarmiento
 
El Filibusterismo (NEW)
El Filibusterismo (NEW)El Filibusterismo (NEW)
El Filibusterismo (NEW)
marvinnbustamante1
 
Introduction to Rizal
Introduction to RizalIntroduction to Rizal
Introduction to Rizal
Edmundo Dantes
 
Buod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdf
Buod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdfBuod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdf
Buod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdf
ayatmarkangelo
 
Pagdulog Pampanitikan (klasisismo at romantisismo)
Pagdulog Pampanitikan (klasisismo at romantisismo)Pagdulog Pampanitikan (klasisismo at romantisismo)
Pagdulog Pampanitikan (klasisismo at romantisismo)
KilroneEtulle1
 
Mga tauhan sa el filibusterismo
Mga tauhan sa el filibusterismoMga tauhan sa el filibusterismo
Mga tauhan sa el filibusterismo
Yokimura Dimaunahan
 

What's hot (20)

Discover the nanoworld
Discover the nanoworldDiscover the nanoworld
Discover the nanoworld
 
Talambuhay ni jose rizal
Talambuhay ni jose rizalTalambuhay ni jose rizal
Talambuhay ni jose rizal
 
Kabanata 34 El Filibusterismo
Kabanata 34 El FilibusterismoKabanata 34 El Filibusterismo
Kabanata 34 El Filibusterismo
 
Sa dapitan
Sa dapitanSa dapitan
Sa dapitan
 
03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...
03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...
03 - Rizal's Family, Childhood, and Early Education | Life and Works of Rizal...
 
Noli Me Tangere, isang pagsusuri
Noli Me Tangere, isang pagsusuriNoli Me Tangere, isang pagsusuri
Noli Me Tangere, isang pagsusuri
 
El filibusterismo report
El filibusterismo reportEl filibusterismo report
El filibusterismo report
 
El-Filibusterismo.pptx
El-Filibusterismo.pptxEl-Filibusterismo.pptx
El-Filibusterismo.pptx
 
Buod ng Noli Me Tangere
Buod ng Noli Me TangereBuod ng Noli Me Tangere
Buod ng Noli Me Tangere
 
Malawakang kahirapan sa pilipinas
Malawakang kahirapan  sa pilipinasMalawakang kahirapan  sa pilipinas
Malawakang kahirapan sa pilipinas
 
Masinop na Pagsulat-Korespondensiya Opisyal.pptx
Masinop na Pagsulat-Korespondensiya Opisyal.pptxMasinop na Pagsulat-Korespondensiya Opisyal.pptx
Masinop na Pagsulat-Korespondensiya Opisyal.pptx
 
Talambuhay ni Jose Rizal
Talambuhay ni Jose RizalTalambuhay ni Jose Rizal
Talambuhay ni Jose Rizal
 
Rizal as historian
Rizal as historianRizal as historian
Rizal as historian
 
Katamaran ng mga pilipino
Katamaran ng mga pilipinoKatamaran ng mga pilipino
Katamaran ng mga pilipino
 
El filibusterismo
El filibusterismoEl filibusterismo
El filibusterismo
 
El Filibusterismo (NEW)
El Filibusterismo (NEW)El Filibusterismo (NEW)
El Filibusterismo (NEW)
 
Introduction to Rizal
Introduction to RizalIntroduction to Rizal
Introduction to Rizal
 
Buod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdf
Buod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdfBuod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdf
Buod ng El Filibusterismo Kabanata 38_20231109_073255_0000.pdf
 
Pagdulog Pampanitikan (klasisismo at romantisismo)
Pagdulog Pampanitikan (klasisismo at romantisismo)Pagdulog Pampanitikan (klasisismo at romantisismo)
Pagdulog Pampanitikan (klasisismo at romantisismo)
 
Mga tauhan sa el filibusterismo
Mga tauhan sa el filibusterismoMga tauhan sa el filibusterismo
Mga tauhan sa el filibusterismo
 

Similar to Synthesis Examples

Unit v. HDL Synthesis Process
Unit v. HDL Synthesis ProcessUnit v. HDL Synthesis Process
Create your first model for a simple logic circuit
Create your first model for a simple logic circuitCreate your first model for a simple logic circuit
Create your first model for a simple logic circuit
Mohamed Samy
 
Writing more complex models
Writing more complex modelsWriting more complex models
Writing more complex models
Mohamed Samy
 
Writing more complex models (continued)
Writing more complex models (continued)Writing more complex models (continued)
Writing more complex models (continued)
Mohamed Samy
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
Mohamed Samy
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
Mohamed Samy
 
&lt;img src="xss.com">
&lt;img src="xss.com">&lt;img src="xss.com">
&lt;img src="xss.com">
"&lt;u>aaa&lt;/u>
 
Learning vhdl by examples
Learning vhdl by examplesLearning vhdl by examples
Learning vhdl by examples
anishgoel
 
Verilog overview
Verilog overviewVerilog overview
Verilog overview
posdege
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
aprilyyy
 
Ds02 flow chart and pseudo code
Ds02 flow chart and pseudo codeDs02 flow chart and pseudo code
Ds02 flow chart and pseudo code
jyoti_lakhani
 
Google mock training
Google mock trainingGoogle mock training
Google mock training
Thierry Gayet
 
Switch case and looping kim
Switch case and looping kimSwitch case and looping kim
Switch case and looping kimkimberly_Bm10203
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.gerrell
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
 
learning vhdl by examples
learning vhdl by exampleslearning vhdl by examples
learning vhdl by examples
anishgoel
 
Prepare a Verilog HDL code for the following register Positive Edge.pdf
Prepare a Verilog HDL code for the following register  Positive Edge.pdfPrepare a Verilog HDL code for the following register  Positive Edge.pdf
Prepare a Verilog HDL code for the following register Positive Edge.pdf
ezonesolutions
 
Basic Coding In VHDL COding
Basic Coding In VHDL COdingBasic Coding In VHDL COding
Basic Coding In VHDL COding
anna university
 

Similar to Synthesis Examples (20)

Unit v. HDL Synthesis Process
Unit v. HDL Synthesis ProcessUnit v. HDL Synthesis Process
Unit v. HDL Synthesis Process
 
Create your first model for a simple logic circuit
Create your first model for a simple logic circuitCreate your first model for a simple logic circuit
Create your first model for a simple logic circuit
 
Writing more complex models
Writing more complex modelsWriting more complex models
Writing more complex models
 
Writing more complex models (continued)
Writing more complex models (continued)Writing more complex models (continued)
Writing more complex models (continued)
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
&lt;img src="xss.com">
&lt;img src="xss.com">&lt;img src="xss.com">
&lt;img src="xss.com">
 
Fav
FavFav
Fav
 
Learning vhdl by examples
Learning vhdl by examplesLearning vhdl by examples
Learning vhdl by examples
 
Verilog overview
Verilog overviewVerilog overview
Verilog overview
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
 
Ds02 flow chart and pseudo code
Ds02 flow chart and pseudo codeDs02 flow chart and pseudo code
Ds02 flow chart and pseudo code
 
Google mock training
Google mock trainingGoogle mock training
Google mock training
 
Switch case and looping kim
Switch case and looping kimSwitch case and looping kim
Switch case and looping kim
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
 
learning vhdl by examples
learning vhdl by exampleslearning vhdl by examples
learning vhdl by examples
 
Prepare a Verilog HDL code for the following register Positive Edge.pdf
Prepare a Verilog HDL code for the following register  Positive Edge.pdfPrepare a Verilog HDL code for the following register  Positive Edge.pdf
Prepare a Verilog HDL code for the following register Positive Edge.pdf
 
Basic Coding In VHDL COding
Basic Coding In VHDL COdingBasic Coding In VHDL COding
Basic Coding In VHDL COding
 
My final requirement
My final requirementMy final requirement
My final requirement
 

Recently uploaded

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

Synthesis Examples

  • 1. VHDL 360© by: Mohamed Samy Samer El-Saadany
  • 2. Copyrights Copyright © 2010/2011 to authors. All rights reserved All content in this presentation, including charts, data, artwork and logos (from here on, "the Content"), is the property of Mohamed Samy and Samer El-Saadany or the corresponding owners, depending on the circumstances of publication, and is protected by national and international copyright laws. Authors are not personally liable for your usage of the Content that entailed casual or indirect destruction of anything or actions entailed to information profit loss or other losses. Users are granted to access, display, download and print portions of this presentation, solely for their own personal non-commercial use, provided that all proprietary notices are kept intact. Product names and trademarks mentioned in this presentation belong to their respective owners. VHDL 360 © 2
  • 4. Objective Getting familiar with code changes' impact on synthesis Skills gained: Writing synthesis friendly code VHDL 360 © 4
  • 5. Outline Introduction Synthesize and Learn Combinational Logic Latch Inference Sequential Logic Flip-Flop Inference VHDL 360 © 5
  • 6. Introduction VHDL 360 © 6 VHDL is a H/W modeling language used to model digital circuits Digital circuits can be either Combinational or Sequential Combinational Logic circuits: Implement Boolean functions whose output is only dependant on the present inputs Sequential Logic circuits: Implement circuits whose output depends on the present inputs & the history of the inputs. i.e. Circuits having storage elements
  • 7. Introduction VHDL 360 © 7 VHDL Standard Synthesizable VHDL Synthesis tools translate the VHDL code to a gate level netlist representing the actual H/W gates [and, or, not, Flip-Flops…etc] Only a subset of the language is synthesizable A model can be either Synthesizable: Used for both Simulation & Synthesis Non-Synthesizable: Used for Simulation only
  • 9. Synthesize and Learn In the next slides we will use examples from the previous modules to demonstrate synthesis and study the synthesized logic We will also modify these examples and observe the impact on the synthesized logic 9 VHDL 360 ©
  • 10. Combinational Logic libraryIEEE; useIEEE.std_logic_1164.all; Entitymux_caseis Port(a, b, c, d:instd_logic; Sel:instd_logic_vector(1downto0); F:outstd_logic); Endentity; Architecture rtl ofmux_caseis begin process(a,b,c,d,sel)is begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase; Endprocess; Endarchitecture; VHDL 360 © 10 Example 1: 4x1 Multiplexer
  • 11.
  • 12.
  • 13. Synthesis tools don’t use the sensitivity list to determine the logic, but simulation tools depend on the sensitivity list to execute the process
  • 14. Example 2 suffers a problem called “Simulation – Synthesis mismatch”Example 1: 4x1 Multiplexer Example 2: 4x1 Multiplexer Architecture rtl ofmux_caseis begin process(a, sel)is begin Caseselis When"00"=> f <= a; When"01"=> f <= b; When"10"=> f <= c; When"11"=> f <= d; whenothers=> f <= a; Endcase; Endprocess; Endarchitecture;
  • 15.
  • 16. Combinational Logic 14 VHDL 360 © Example 4: Adder-Subtractor LIBRARYieee; USEieee.std_logic_1164.all; USEieee.std_logic_arith.all; ENTITYadd_subIS port(a, b :ininteger; result :outinteger; operation:instd_logic); ENDENTITY; ARCHITECTURE behave OFadd_subIS BEGIN process(a, b, operation) begin if(operation = '1')then result <= a + b; else result <= a - b; endif; endprocess; ENDARCHITECTURE;
  • 17. Combinational Logic 15 VHDL 360 © Consider that someone tries to re-use that code to implement an adder with an enable  He modifies the add_sub example; removes the else branch & renames the “operation” port to “enable” as shown below, How would these changes affect the logic? Example 5: LIBRARYieee; USEieee.std_logic_1164.all; USEieee.std_logic_arith.all; ENTITY adder IS port(a, b :ininteger; result :outinteger; enable:instd_logic); ENDENTITY adder; ARCHITECTURE behave OF adder IS BEGIN process(a, b, enable) begin if(enable = '1')then result <= a + b; endif; endprocess; ENDARCHITECTURE;
  • 18. Combinational Logic 16 VHDL 360 © This will infer a latch, because we didn’t specify what should happen to “result” when “enable” isn’t equal to '1' Simulation & synthesis tools will just keep the value as is…i.e. It latches the last value Example 5: LIBRARYieee; USEieee.std_logic_1164.all; USEieee.std_logic_arith.all; ENTITY adder IS port(a, b :ininteger; result :outinteger; enable:instd_logic); ENDENTITY adder; ARCHITECTURE behave OF adder IS BEGIN process(a, b, enable) begin if(enable = '1')then result <= a + b; endif; endprocess; ENDARCHITECTURE;
  • 19. Combinational Logic In the below example, the "11" value of "sel" signal is not listed as a case choice, hence signal "F" is not assigned a value in this case A Latch is inferred in this example  Probably that wasn’t needed Example 6: LIBRARYieee; USEieee.std_logic_1164.all; ENTITYincomplete_caseIS port(sel:std_logic_vector(1downto0); A, B:std_logic; F :outstd_logic); ENDENTITY; ARCHITECTURE rtl OFincomplete_caseIS BEGIN process(sel, A, B) begin case(sel)is when"00"=> F <= A; when"01"=> F <= B; when"10"=> F <= A xor B; whenothers=>null; endcase; endprocess; ENDARCHITECTURE; 17 VHDL 360 ©
  • 20. Skills Check Do you think a Latch would be inferred in the below example? Example 7: LIBRARYieee; USEieee.std_logic_1164.all; ENTITYincomplete_assignmentIS port(sel:instd_logic_vector(1downto0); A, B :instd_logic; O1, O2:outstd_logic); ENDENTITY; ARCHITECTURE rtl OFincomplete_assignmentIS BEGIN process(sel, A, B)begin case(sel)is when"00"=> O1 <= A; O2 <= A and B; when"01"=> O1 <= B; O2 <= A xor B; when"10"=> O1 <= A xor B; when"11"=> O2 <= A or B; whenothers=> O1 <= '0'; O2 <= '0'; endcase; endprocess; ENDARCHITECTURE; 18 VHDL 360 ©
  • 21.
  • 22.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. Sequential Logic Example 11: 8-bit Shift Register (Shift right) Libraryieee; useieee.std_logic_1164.all; entity shift_register is Port( clk, D, enable :inSTD_LOGIC; Q :outSTD_LOGIC); endentity; architecture Behavioral of shift_register is begin process(clk) variable reg:std_logic_vector(7downto0); begin ifrising_edge(clk)then if enable = '1' then for i in1to7loop reg(i-1):= reg(i); endloop; reg(7):= d; endif; endif; Q <= reg(0); endprocess; end Behavioral; 7 6 5 4 3 2 1 0 VHDL 360 © 26
  • 29. Flip-Flop Inference Assignments under clock edge where the object value needs to be remembered across multiple process invocations  Flip-Flop Signal assignment under clock edge will always infer a Flip-Flop Variable assignment under clock edge will infer Flip-Flop only when its value ought to be remembered across process invocations 27 VHDL 360 ©
  • 30. Exercise 1 LIBRARYieee; USEieee.std_logic_1164.all; Entity unknown is port(x:outstd_logic; y:instd_logic_vector(3downto0); c:ininteger); Endentity; Architecture behave of unknown is Begin x <= y(c); End behave; VHDL 360 © 28 Deduce what the below code models Use synthesis tool to validate your answer
  • 31. Contacts You can contact us at: http://www.embedded-tips.blogspot.com/ VHDL 360 © 29