1 / 23

Tutorial 1

Tutorial 1. Combinational Logic Synthesis. Introduction to VHDL. VHDL = Very high speed Hardware Description Language VHDL and Verilog are the industry standards for describing digital systems. Introduction to VHDL. Like C++, a working knowledge of VHDL can be gained relatively quickly

nash
Download Presentation

Tutorial 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tutorial 1 Combinational Logic Synthesis

  2. Introduction to VHDL • VHDL = Very high speed Hardware Description Language • VHDL and Verilog are the industry standards for describing digital systems

  3. Introduction to VHDL • Like C++, a working knowledge of VHDL can be gained relatively quickly • Like C++, a solid understanding of what you’re writing and why you’re writing it can take years • It’s especially important in VHDL to focus not on style and syntax, but on comprehension

  4. Introduction to VHDL • VHDL is a HARDWARE DESCRIPTIVE LANGUAGE • Every line of code translates directly to hardware

  5. Entities and Architectures • Creating a module in VHDL involves creating an entity and an architecture

  6. Entities and Architectures Entity MyEntity is port ( a, b : in std_logic; c : out std_logic); End entity; • When you define an entity, you define the black-box structure that’s visible to outside modules • a and b aren’t “parameters”. They’re WIRES. c isn’t a ‘return value’. It’s a WIRE.

  7. Entities and Architectures architecture main of MyEntity is begin <your code here> end archicture; • Each entity is actually implemented inside an architecture • You can have more than one architecture for each entity, but in general, you should just have one

  8. Component instantiation • Other blocks can then use these sub-modules, but first you have to declare it as a component component DFF port( d : in std_logic; q : out std_logic); end component; • This component can now be instantiated inside this top-level entity as many times as you want

  9. Component Instantiation • A component is instantiated as follows MyDff : DFF Port map (d => foo, q => bar); • Foo and bar are signals or ports in the top-level entity • d and q are ports of the component being instantiated • d is connected to foo with a wire. Likewise with q and bar. • MyDFF is a label given to the component instance. VHDL requires all component instances to have unique labels to differentiate between multiple instances of the same component

  10. Combinational Logic A <= B; • Textbooks call this a “Concurrent Assignment” • This is a WIRE

  11. Combinational Logic A <= B AND C; • This is an AND gate, where ‘A’ is the output node and ‘B’ and ‘C’ are input nodes

  12. Combinational Logic A <= B AND C; D <= A; E <= D AND A; • What does this look like? Remember, think of this as not code, but a description of a circuit • Bonus point: Simplify this logic. What VHDL code would represent your simplified circuit?

  13. Combinational Logic

  14. Select Statements With std_logic_vector’(A,B) select Q <= “0” when “00” <= “0” when “01” <= “1” when “10” <= “0” when “11” <= “0” when others; • This LOOKS like a case statement. It can be more accurately described as a “description of a truth table” • What does the truth table look like? What does the hardware look like?

  15. Select Statement

  16. Conditional Assignment Q <= ‘1’ when A = ‘1’ else ‘0’ when B = ‘1’ else ‘0’; • This differs from select statements because Conditional Assignment has a priority of conditions. The first condition is evaluated before the second. • If A = ‘1’ and B = ‘1’, Q becomes ‘1’, because that condition comes first

  17. Conditional Assignment • In evaluating this block, statement priority is considered in populating the truth table • The truth table is then used to generate hardware. The hardware itself has no sequential nature. • What does the truth table look like? What does the hardware look like? • Any conditional assignment can be expressed with a select block

  18. Conditional Assignment

  19. Combinational Processes • Combinational processes do not involve registers. Registered processes are covered in Tutorial 2. • Combinational processes allow combinational logic to be described in a sequential way. • Any combinational process can be described using concurrent statements (though the code may look uglier)

  20. Combinational Processes process(a) begin b <= a; end process; • The bracketed ‘a’ is part of a process’ sensitivity list. This should list out all the signals used as inputs to this process

  21. If-then-else If A = ‘1’ then Q <= ‘0’ Else Q <= ‘1’ End if; • This is an if-then-else construct similar to most programming languages • It implies a sequential priority, which is similar to conditional assignment

  22. Case Case Sel is when ‘1’ => Q <= ‘1’; when others => Q <= ‘0’; End case • The case statement implies no priority, and is similar to the select statement

  23. Combinational Processes • So why bother with if-then-else and case statements when you can use selects and conditional assignments? • Sometimes what you’re trying to describe is just ‘nicer looking’ or shorter in one or the other

More Related