SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
• Click to edit Master text styles
  – Second level
     • Third level
         – Fourthg i t a l D e s i g n u s i n g V H D L
              D i level
                     Session Four
              » Fifth level



                                               Introduced by




                                                                            Cairo-Egypt

                                                               Version 03 – June 2012 1
about Start Group


• Click to edit Master text styles
   Mahmoud Abdellatif
  – Second level
  Alaa Salah Shehata
   Mohamed level
     • Third Salah
   Mohamed Talaat
         – Fourth level
               » Fifth level
    start.courses@gmail.com              www.slideshare.net/StartGroup

    www.facebook.com/groups/start.group

    www.startgroup.weebly.com           Start.courses@gmail.com

   + 02 0122-4504158 M.A                 www.youtube.com/StartGroup2011
   + 02 0128-0090250 A.S

                                Session Four                              2
mini-Project Discussion
                                                              Sel    Operation
                                                              0000   Y<= a
• Click to edit Master text styles                            0001   Y<= a+1
A(7:0)               Logic                                    0010   Y<= a-1
   – Second level
B(7:0)               Unit                                     0011   Y<= b

           • Third level                             C(7:0)
                                                              0100   Y<= b+1
                                                              0101   Y<= b-1
              – Fourth level
                   Arithmetic                                 0110   Y<= a+b
                  » Fifth level
                      Unit                                    0111   Y<= a+b+cin
    Cin
                                                              1000   Y<= not a
SEL(3:0)
                                                              1001   Y<= not b
                                                              1010   Y<= a AND b
                                                              1011   Y<= a OR b
                                                              1100   Y<= a NAND b
                                                              1101   Y<= a NOR b
                     Synchronous ALU
                     Using transcript & Pretty waveform       1110   Y<= a XOR b
                                                              1111   Y<= a XNOR b
                                      Session Four                                  3
Outline


• Click to edit Master text styles
   – Second level
      • Third level
                       Data Operators
                               - Concatenation
                                             - Aggregation
                                             - Attributes

                              Counters and Shifting registers
                                                                4
          – Fourth level
              » Fifth level




                              Session Four                      4
Outline


• Click to edit Master text styles
                       Data Operators
                               - Concatenation
   – Second level                            - Aggregation
                                             - Attributes
      • Third level
          – Fourth level      Counters and Shifting registers
              » Fifth level




                              Session Four                      5
Data Operators                      [Concatenation]


• Click to edit Master text styles
Used to merge two operands together using the concatenation operator ( & ).
This result is an array in which length is the sum of lengths of both operands.
      – Second level
       C <= A & B
           • Third level
                 – Fourth level
                     » Fifth level
                                                               A                  B




                                                                      C

                                            Session Four                              6
Example 18

Shift Registers
 • Click to edit Master text styles
      – Second level
A <= 0 & A(7 downto 1);
         --Shift right
A <= A(6 downto 0) & 0;
           • Third level
         --Shift left
                  – Fourth level
                      » Fifth level
    A7                           A0                  A7        A0



                                 0                   0
    A6                      A0                            A7   A1

                                      Session Four                  7
Example 19

Division/ Multiplication by 2^n
 • Click to edit Master text styles
                                 A7                               A0
      – Second level
A <= A(7) & A(7 downto 1);
         --Shift right
           • Third level
         -- devision by 2
A <= A(6 downto 0) & A(0);
               – left
         --Shift Fourth level
         -- Multiplication by 2
                   » Fifth level
         -- Note (multiplication need
                                                  A7    A7        A1
one more bit for each shift)




                                                  A7         A7   A1

                                                   A7

                                   Session Four                        8
Example 20

Rotate Registers
 • Click to edit Master text styles
      – Second level
A <= A(0) & A(7 downto 1);
         --Rotate right
A <= A(6 downto 0) & A(7);
          • Third level
         -- Rotate left
               – Fourth level
                   » Fifth level
   A7                         A0                       A7        A0




    A6                   A0                                 A7   A1
                                   A7            A0
                                        Session Four                  9
Data Operators                       [Aggregation]


• Click to edit Master text styles
Provides an easy way of assigning objects of composite types
      – Second level
The aggregate assigns values to a selected elements of an array or a record.
Keyword ‘others’ is used here
           • Third level
                 – Fourth level
data : std_logic_vector(15 downto 0);
                     » Fifth level
data <= (15 downto 8 => '0' , others => '1');
         -- data = 0000000011111111

data <= (1 | 4 | 7 => '1', 2 | 3 => '0', others => 'Z');
         -- data = ZZZZZZZZ1ZZ1001Z

data <= (others => ‘1');
         -- fill data with ones




                                            Session Four                       10
Data Operators                       [Attributes]


• Click to edit Master text styles
Attributes can be used to poll characteristics/information of objects (e.g. signals).
      – Second level
The general form of an attribute name is name'attribute_identifier.

            • Third level
The most commonly used attribute is 'EVENT, used to detect and trigger activity at a
certain clock edge (for example rising edge) only.
              – Fourth level
   if   (clk’event and clk =           ‘1’) then
                  » Fifth level


Examples of attributes :
‘left, ‘right, ‘high, ‘length, ’range, ‘event, …
Note
              Pronounce the apostrophe as “tick “




                                             Session Four                               11
Outline


• Click to edit Master text styles
                       Data Operators
                               - Concatenation
   – Second level                            - Aggregation
                                             - Attributes
      • Third level
          – Fourth level      Counters and Shifting registers
              » Fifth level




                              Session Four                      12
Lab 04


• Click to edit Master text styles
Title:
        – Second level
COUNTERS in VHDL

Goal:      • Third level
              Be familiar with implementations of different counter schemes
                – Fourth level
                    » Fifth level




                                          Session Four                         13
Lab 04

4-bit Free binary counter
 • Click to edit Master text styles
Library ieee;
use ieee.std_logic_1164.all;
      – Second level
use ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;
Entity counter is
           • Third level
Port( clk, rst : in std_logic;
      count : out std_logic_vector(3 downto 0));
end entity;
              – Fourth level
Architecture behav » Fifth level
                   of d_ff is
   Signal count_i : std_logic_vector(7 downto 0);
Begin
   process(clk, rst)
   begin
     If (rst = '1') then
       count_i <= "00000000";
     elsif rising_edge(clk) then
       count_i <= count_i + '1';
     end if;
   end process;
count <= count_i;
end behav;
                                   Session Four     14
Lab 04


 • Click to edit Master text styles
4-Bit binary Counter with Synchronous/Asynchronous load


     – Second level
          • Third
       Assignment   level
              – Fourth level
                  » Fifth level




                                     Session Four         15
Lab 04


 • Click to edit Master text styles
4-Bit binary UP-Down Counter


     – Second level
         • Third
      Assignment   level
              – Fourth level
                  » Fifth level




                                  Session Four   16
Lab 05


• Click to edit Master text styles
Title:
        – Second level
Rotating LEDs

Goal:      • Third level
               Be familiar with Shift registers
                 – Fourth level
                     » Fifth level




                                             Session Four   17
Lab 05


 • Click to edit Master text styles
One way rotating LEDs


     – Second level
         • Third
      Assignment   level
              – Fourth level
                  » Fifth level




                                  Session Four   18
Lab 05


 • Click to edit Master text styles
Two ways rotating LEDs


     – Second level
          • Third
       Assignment   level
              – Fourth level
                  » Fifth level




                                  Session Four   19
Start Notes          [Synthesis Notes]


• Click to edit Master text styles
     – Second level Example : Write a code describing this Adder
Area Optimization           Note that the selector can select one addition at a time, the
          • Third level     operators are mutually exclusive
During writing a code for
implementation – Fourth level
                you must                        OpSel                Function
save your resources, many
                     » Fifth level                 00                   A+B
ways maybe used to
reduce area used from                              01                  C+D
your FPGA. Here, we will                           10                   E+F
introduce an example of
thinking how to reduce                             11                  G+H
your area in your design.




                                        Session Four                                        20
Start Notes            [Synthesis Notes]


• Click to edit Master text styles
It is better to write a code that describe the circuit on the right as adders take much bigger
      – Second level
area than multiplexers
his transformation of operators is called Resource Sharing
            • Third level
                 – Fourth level
                     » Fifth level




                                             Session Four                                        21
Start Notes        [Synthesis Notes]


• Click to edit Master text styles
Possible Solutions
           Solution 1

      – Second level
process (OpSel,A,B,C,D,E,F,G,H)
begin
         case OpSel is
           • Third level
                  when "00" => Z        <= A   + B    ;
                  when "01" => Z
             – Fourth level => Z        <= C   + D    ;
                  when "10"             <= E   + F    ;
                  » Fifth level
                  when "11" => Z        <= G   + H    ;
                  when others =>        Z <=   ‘0’    ;
         end case ;
end process ;


Here the code is Tool Driven Resource Sharing, the tool understand that we don’t need to
make four adders and one Adder is implemented.

General Note
To ensure resource sharing, operators must be coded in the same process, and same code
(case or if) structure.
                                           Session Four                                    22
Start Notes             [Synthesis Notes]

Possible Solutions

• Click to edit Master text styles
           Solution 2

X <= Mux4(OpSel, A, C, E, G) ;              -- 4x1 MUX in vhdl
      – Second level
Y <= Mux4(OpSel, B, D, F, H) ;
Z <= X + Y ;
           • Third level
Here the code is Code Drivenlevel
                 – Fourth Resource Sharing, You forced the tool to use only one Adder.
          Solution 3    » Fifth level
Process (OpSel, A,        B, C, D, E, F, G, H)
begin
         if (OpSel       =   "00")   then   Z   <=   A   +   B;   end   if;
         if (OpSel       =   "01")   then   Z   <=   C   +   D;   end   if;
         if (OpSel       =   "10")   then   Z   <=   E   +   F;   end   if;
         if (OpSel       =   "11")   then   Z   <=   G   +   H;   end   if;
end process ;

Bad Code that may defeat Resource Sharing.
Synthesis tool may create a separate resource for each adder.                 Don’t do that!
                                                Session Four                                   23
Summary


• Counters are essential in Master text styles
-  Click to edit most of design blocks.
-   Different types of counters can be implemented using vhdl
      – Second level
      - Free Counters
      - UP-DOWN Counters
            • Third
      - BDC Counterslevel
      - Counters with external LOAD signals
-
                  – Fourth level
    Shift Registers are also important for Dividing and Multiplying by 2 and also for Parallel to Serial
                        » Fifth level
    and Serial to Parallel conversion.




                                                                  Examples     Exercises    Labs
                                                                  18-20        -            4-5


                                             Session Four                                          24
Time for Your Questions


• Click to edit Master text styles
  – Second level
     • Third level
        – Fourth level
            » Fifth level




                            Session Four   25
Download Session 04 Files


• Click to edit Master text styles
  –Attributes www.startgroup.weebly.com/vhdl-examples.html
    Second level
       • Third level
          – Fourth level
    Example on Do Fifth level
               » file www.startgroup.weebly.com/vhdl-examples.htm




                                    Session Four                    26
Take Your Notes
                                       Print the slides and take your notes here
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
   • Click to edit Master text styles
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
          – Second level
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
                 • Third level
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
                        – Fourth level
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
                            » Fifth level
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------
See You Next Session .. Don’t miss


• Click to edit Master text styles
  – Second level
     • Third level
        – Fourth level
                        Thank
            » Fifth level

                        You

Mais conteúdo relacionado

Último

PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environmentelijahj01012
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCRashishs7044
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607dollysharma2066
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Anamaria Contreras
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Peter Ward
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy Verified Accounts
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyotictsugar
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCRashishs7044
 
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxFinancial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxsaniyaimamuddin
 
Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Americas Got Grants
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024Adnet Communications
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607dollysharma2066
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africaictsugar
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckHajeJanKamps
 

Último (20)

PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environment
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail Accounts
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyot
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
 
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxFinancial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
 
Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africa
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Session 04 v.3

  • 1. • Click to edit Master text styles – Second level • Third level – Fourthg i t a l D e s i g n u s i n g V H D L D i level Session Four » Fifth level Introduced by Cairo-Egypt Version 03 – June 2012 1
  • 2. about Start Group • Click to edit Master text styles Mahmoud Abdellatif – Second level Alaa Salah Shehata Mohamed level • Third Salah Mohamed Talaat – Fourth level » Fifth level start.courses@gmail.com www.slideshare.net/StartGroup www.facebook.com/groups/start.group www.startgroup.weebly.com Start.courses@gmail.com + 02 0122-4504158 M.A www.youtube.com/StartGroup2011 + 02 0128-0090250 A.S Session Four 2
  • 3. mini-Project Discussion Sel Operation 0000 Y<= a • Click to edit Master text styles 0001 Y<= a+1 A(7:0) Logic 0010 Y<= a-1 – Second level B(7:0) Unit 0011 Y<= b • Third level C(7:0) 0100 Y<= b+1 0101 Y<= b-1 – Fourth level Arithmetic 0110 Y<= a+b » Fifth level Unit 0111 Y<= a+b+cin Cin 1000 Y<= not a SEL(3:0) 1001 Y<= not b 1010 Y<= a AND b 1011 Y<= a OR b 1100 Y<= a NAND b 1101 Y<= a NOR b Synchronous ALU Using transcript & Pretty waveform 1110 Y<= a XOR b 1111 Y<= a XNOR b Session Four 3
  • 4. Outline • Click to edit Master text styles – Second level • Third level Data Operators - Concatenation - Aggregation - Attributes Counters and Shifting registers 4 – Fourth level » Fifth level Session Four 4
  • 5. Outline • Click to edit Master text styles Data Operators - Concatenation – Second level - Aggregation - Attributes • Third level – Fourth level Counters and Shifting registers » Fifth level Session Four 5
  • 6. Data Operators [Concatenation] • Click to edit Master text styles Used to merge two operands together using the concatenation operator ( & ). This result is an array in which length is the sum of lengths of both operands. – Second level C <= A & B • Third level – Fourth level » Fifth level A B C Session Four 6
  • 7. Example 18 Shift Registers • Click to edit Master text styles – Second level A <= 0 & A(7 downto 1); --Shift right A <= A(6 downto 0) & 0; • Third level --Shift left – Fourth level » Fifth level A7 A0 A7 A0 0 0 A6 A0 A7 A1 Session Four 7
  • 8. Example 19 Division/ Multiplication by 2^n • Click to edit Master text styles A7 A0 – Second level A <= A(7) & A(7 downto 1); --Shift right • Third level -- devision by 2 A <= A(6 downto 0) & A(0); – left --Shift Fourth level -- Multiplication by 2 » Fifth level -- Note (multiplication need A7 A7 A1 one more bit for each shift) A7 A7 A1 A7 Session Four 8
  • 9. Example 20 Rotate Registers • Click to edit Master text styles – Second level A <= A(0) & A(7 downto 1); --Rotate right A <= A(6 downto 0) & A(7); • Third level -- Rotate left – Fourth level » Fifth level A7 A0 A7 A0 A6 A0 A7 A1 A7 A0 Session Four 9
  • 10. Data Operators [Aggregation] • Click to edit Master text styles Provides an easy way of assigning objects of composite types – Second level The aggregate assigns values to a selected elements of an array or a record. Keyword ‘others’ is used here • Third level – Fourth level data : std_logic_vector(15 downto 0); » Fifth level data <= (15 downto 8 => '0' , others => '1'); -- data = 0000000011111111 data <= (1 | 4 | 7 => '1', 2 | 3 => '0', others => 'Z'); -- data = ZZZZZZZZ1ZZ1001Z data <= (others => ‘1'); -- fill data with ones Session Four 10
  • 11. Data Operators [Attributes] • Click to edit Master text styles Attributes can be used to poll characteristics/information of objects (e.g. signals). – Second level The general form of an attribute name is name'attribute_identifier. • Third level The most commonly used attribute is 'EVENT, used to detect and trigger activity at a certain clock edge (for example rising edge) only. – Fourth level if (clk’event and clk = ‘1’) then » Fifth level Examples of attributes : ‘left, ‘right, ‘high, ‘length, ’range, ‘event, … Note Pronounce the apostrophe as “tick “ Session Four 11
  • 12. Outline • Click to edit Master text styles Data Operators - Concatenation – Second level - Aggregation - Attributes • Third level – Fourth level Counters and Shifting registers » Fifth level Session Four 12
  • 13. Lab 04 • Click to edit Master text styles Title: – Second level COUNTERS in VHDL Goal: • Third level  Be familiar with implementations of different counter schemes – Fourth level » Fifth level Session Four 13
  • 14. Lab 04 4-bit Free binary counter • Click to edit Master text styles Library ieee; use ieee.std_logic_1164.all; – Second level use ieee.std_logic_arith.all; use ieee.std_logic_signed.all; Entity counter is • Third level Port( clk, rst : in std_logic; count : out std_logic_vector(3 downto 0)); end entity; – Fourth level Architecture behav » Fifth level of d_ff is Signal count_i : std_logic_vector(7 downto 0); Begin process(clk, rst) begin If (rst = '1') then count_i <= "00000000"; elsif rising_edge(clk) then count_i <= count_i + '1'; end if; end process; count <= count_i; end behav; Session Four 14
  • 15. Lab 04 • Click to edit Master text styles 4-Bit binary Counter with Synchronous/Asynchronous load – Second level • Third Assignment level – Fourth level » Fifth level Session Four 15
  • 16. Lab 04 • Click to edit Master text styles 4-Bit binary UP-Down Counter – Second level • Third Assignment level – Fourth level » Fifth level Session Four 16
  • 17. Lab 05 • Click to edit Master text styles Title: – Second level Rotating LEDs Goal: • Third level  Be familiar with Shift registers – Fourth level » Fifth level Session Four 17
  • 18. Lab 05 • Click to edit Master text styles One way rotating LEDs – Second level • Third Assignment level – Fourth level » Fifth level Session Four 18
  • 19. Lab 05 • Click to edit Master text styles Two ways rotating LEDs – Second level • Third Assignment level – Fourth level » Fifth level Session Four 19
  • 20. Start Notes [Synthesis Notes] • Click to edit Master text styles – Second level Example : Write a code describing this Adder Area Optimization Note that the selector can select one addition at a time, the • Third level operators are mutually exclusive During writing a code for implementation – Fourth level you must OpSel Function save your resources, many » Fifth level 00 A+B ways maybe used to reduce area used from 01 C+D your FPGA. Here, we will 10 E+F introduce an example of thinking how to reduce 11 G+H your area in your design. Session Four 20
  • 21. Start Notes [Synthesis Notes] • Click to edit Master text styles It is better to write a code that describe the circuit on the right as adders take much bigger – Second level area than multiplexers his transformation of operators is called Resource Sharing • Third level – Fourth level » Fifth level Session Four 21
  • 22. Start Notes [Synthesis Notes] • Click to edit Master text styles Possible Solutions Solution 1 – Second level process (OpSel,A,B,C,D,E,F,G,H) begin case OpSel is • Third level when "00" => Z <= A + B ; when "01" => Z – Fourth level => Z <= C + D ; when "10" <= E + F ; » Fifth level when "11" => Z <= G + H ; when others => Z <= ‘0’ ; end case ; end process ; Here the code is Tool Driven Resource Sharing, the tool understand that we don’t need to make four adders and one Adder is implemented. General Note To ensure resource sharing, operators must be coded in the same process, and same code (case or if) structure. Session Four 22
  • 23. Start Notes [Synthesis Notes] Possible Solutions • Click to edit Master text styles Solution 2 X <= Mux4(OpSel, A, C, E, G) ; -- 4x1 MUX in vhdl – Second level Y <= Mux4(OpSel, B, D, F, H) ; Z <= X + Y ; • Third level Here the code is Code Drivenlevel – Fourth Resource Sharing, You forced the tool to use only one Adder. Solution 3 » Fifth level Process (OpSel, A, B, C, D, E, F, G, H) begin if (OpSel = "00") then Z <= A + B; end if; if (OpSel = "01") then Z <= C + D; end if; if (OpSel = "10") then Z <= E + F; end if; if (OpSel = "11") then Z <= G + H; end if; end process ; Bad Code that may defeat Resource Sharing. Synthesis tool may create a separate resource for each adder. Don’t do that! Session Four 23
  • 24. Summary • Counters are essential in Master text styles - Click to edit most of design blocks. - Different types of counters can be implemented using vhdl – Second level - Free Counters - UP-DOWN Counters • Third - BDC Counterslevel - Counters with external LOAD signals - – Fourth level Shift Registers are also important for Dividing and Multiplying by 2 and also for Parallel to Serial » Fifth level and Serial to Parallel conversion. Examples Exercises Labs 18-20 - 4-5 Session Four 24
  • 25. Time for Your Questions • Click to edit Master text styles – Second level • Third level – Fourth level » Fifth level Session Four 25
  • 26. Download Session 04 Files • Click to edit Master text styles –Attributes www.startgroup.weebly.com/vhdl-examples.html Second level • Third level – Fourth level Example on Do Fifth level » file www.startgroup.weebly.com/vhdl-examples.htm Session Four 26
  • 27. Take Your Notes Print the slides and take your notes here -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- • Click to edit Master text styles -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- – Second level -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- • Third level -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- – Fourth level -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- » Fifth level -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------
  • 28. See You Next Session .. Don’t miss • Click to edit Master text styles – Second level • Third level – Fourth level Thank » Fifth level You