1 / 84

Data Flow Modeling of Combinational Logic

ECE 545 Lecture 5. Data Flow Modeling of Combinational Logic. R equired reading. P. Chu, RTL Hardware Design using VHDL Chapter 4, Concurrent Signal Assignment Statements of VHDL. Dataflow VHDL Design Style. VHDL Design Styles. dataflow. VHDL Design Styles.

walterjones
Télécharger la présentation

Data Flow Modeling of Combinational Logic

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. ECE 545 Lecture 5 Data Flow Modeling of Combinational Logic

  2. Required reading • P. Chu, RTL Hardware Design using VHDL • Chapter 4, Concurrent Signal Assignment • Statements of VHDL

  3. Dataflow VHDL Design Style ECE 448 – FPGA and ASIC Design with VHDL

  4. VHDL Design Styles dataflow VHDL Design Styles • Testbenches behavioral(sequential) structural Components and interconnects Concurrent statements Sequential statements • Registers • State machines • Instruction decoders Subset most suitable for synthesis

  5. Synthesizable VHDL Dataflow VHDL Design Style VHDL code synthesizable Dataflow VHDL Design Style VHDL code synthesizable

  6. Register Transfer Level (RTL) Design Description Combinational Logic Combinational Logic Today’s Topic … Registers

  7. Data-Flow VHDL Concurrent Statements • concurrent signal assignment () • conditional concurrent signal assignment • (when-else) • selected concurrent signal assignment • (with-select-when) • generate scheme for equations • (for-generate)

  8. Data-flow VHDL Major instructions Concurrent statements • concurrent signal assignment () • conditional concurrent signal assignment • (when-else) • selected concurrent signal assignment • (with-select-when) • generate scheme for equations • (for-generate)

  9. Data-flow VHDL: Example x y s cin cout

  10. Data-flow VHDL: Example (1) LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY fulladd IS PORT (x : IN STD_LOGIC ; y: IN STD_LOGIC ; cin : IN STD_LOGIC ; s : OUT STD_LOGIC ; cout : OUT STD_LOGIC ) ; END fulladd ;

  11. Data-flow VHDL: Example (2) ARCHITECTURE dataflow OF fulladd IS BEGIN s <= x XOR y XOR cin ; cout <= (x AND y) OR (cin AND x) OR (cin AND y) ; END dataflow ;

  12. Logic Operators • Logic operators • Logic operators precedence and or nand nor xor not xnor only in VHDL-93 Highest not and or nand nor xor xnor Lowest

  13. No Implied Precedence Wanted: y = ab + cd Incorrect y <= a and b or c and d ; equivalent to y <= ((a and b) or c) and d ; equivalent to y = (ab + c)d Correct y <= (a and b) or (c and d) ;

  14. E.g., status <= '1'; even <= (p1 and p2) or (p3 and p4); arith_out <= a + b + c - 1; • Implementation of last statement Chapter 4

  15. Signal assignment statement with a closed feedback loop • a signal appears in both sides of a concurrent assignment statement • E.g., q <= ((not q) and (not en)) or (d and en); • Syntactically correct • Form a closed feedback loop • Should be avoided Chapter 4

  16. Data-flow VHDL Major instructions Concurrent statements • concurrent signal assignment () • conditional concurrent signal assignment • (when-else) • selected concurrent signal assignment • (with-select-when) • generate scheme for equations • (for-generate)

  17. Conditional concurrent signal assignment When - Else target_signal <= value1whencondition1else value2whencondition2else . . . valueN-1whenconditionN-1else valueN;

  18. Most often implied structure Value N … Value N-1 Target Signal Value 2 Value 1 Condition N-1 Condition 2 Condition 1 When - Else target_signal <= value1whencondition1else value2whencondition2else . . . valueN-1whenconditionN-1else valueN; 0 1 .… 0 1 0 1

  19. 2-to-1 “abstract” mux • sel has a data type of boolean • If sel is true, the input from “T” port is connected to output. • If sel is false, the input from “F” port is connected to output. Chapter 4

  20. Chapter 4

  21. Chapter 4

  22. Chapter 4

  23. E.g., Chapter 4

  24. E.g., Chapter 4

  25. Chapter 4

  26. E.g., Chapter 4

  27. Operators • Relational operators • Logic and relational operators precedence = /= < <= > >= Highest not = /= < <= > >= and or nand nor xor xnor Lowest

  28. Priority of logic and relational operators compare a = bc Incorrect … when a = b and c else … equivalent to … when (a = b) and c else … Correct … when a = (b and c) else …

  29. VHDL operators

  30. Data-flow VHDL Major instructions Concurrent statements • concurrent signal assignment () • conditional concurrent signal assignment • (when-else) • selected concurrent signal assignment • (with-select-when) • generate scheme for equations • (for-generate)

  31. Selected concurrent signal assignment With –Select-When withchoice_expressionselect target_signal <= expression1whenchoices_1, expression2whenchoices_2, . . . expressionNwhenchoices_N;

  32. Most Often Implied Structure With –Select-When withchoice_expressionselect target_signal <= expression1whenchoices_1, expression2whenchoices_2, . . . expressionNwhenchoices_N; choices_1 expression1 expression2 choices_2 target_signal expressionN choices_N choice expression

  33. Allowed formats of choices_k WHEN value WHEN value_1 | value_2 | .... | value N WHEN OTHERS

  34. Allowed formats of choice_k - example WITH sel SELECT y <= a WHEN "000", c WHEN "001" | "111", d WHEN OTHERS;

  35. Syntax • Simplified syntax: with select_expression select signal_name <= value_expr_1 when choice_1, value_expr_2 when choice_2, value_expr_3 when choice_3, . . . value_expr_n when choice_n; Chapter 4

  36. select_expression • Discrete type or 1-D array • With finite possible values • choice_i • A value of the data type • Choices must be • mutually exclusive • all inclusive • others can be used as last choice_i Chapter 4

  37. E.g., 4-to-1 mux Chapter 4

  38. Can “11” be used to replace others? Chapter 4

  39. E.g., 2-to-22 binary decoder Chapter 4

  40. E.g., 4-to-2 priority encoder Chapter 4

  41. Can we use ‘-’? Chapter 4

  42. E.g., simple ALU Chapter 4

  43. E.g., Truth table Chapter 4

  44. Conceptual implementation • Achieved by a multiplexing circuit • Abstract (k+1)-to-1 multiplexer • sel is with a data type of (k+1) values:c0, c1, c2, . . . , ck Chapter 4

  45. select_expression is with a data type of 5 values: c0, c1, c2, c3, c4 Chapter 4

  46. Chapter 4

  47. E.g., Chapter 4

  48. 3. Conditional vs. selected signal assignment • Conversion between conditional vs. selected signal assignment • Comparison Chapter 4

  49. From selected assignment to conditional assignment Chapter 4

  50. From conditional assignment to selected assignment Chapter 4

More Related