16
More Examples Dataflow/Behavioral Modeling Section 4.12

More Examples Dataflow/Behavioral Modeling Section 4.12

Embed Size (px)

Citation preview

Page 1: More Examples Dataflow/Behavioral Modeling Section 4.12

More Examples Dataflow/Behavioral Modeling

Section 4.12

Page 2: More Examples Dataflow/Behavioral Modeling Section 4.12

Schedule14 3/3 Monday More example of data flow versus behavior. 15 3/5 Wednesday Test 1L 3/6 Thursday Random number generator, mixed signal scope16 3/10 Monday Latches (1)17 3/12 Wednesday Flip-flops, L 3/13 Thursday Flip-flops, D-latch,N/A 3/17 Monday Spring breakN/A 3/19 Wednesday Spring breakN/A 3/20 Thursday Spring break18 3/24 Monday Analysis of clocked sequential circuit (1), 19 3/26 Wednesday Analysis of clocked sequential circuit (2)L 3/27 Thursday Clocked sequential circuit

Assign course project: hamming decoder.

Page 3: More Examples Dataflow/Behavioral Modeling Section 4.12

Homework

• Hw2, hw2 & labs have been graded.• Preview the lecture materials before

the lab.

Page 4: More Examples Dataflow/Behavioral Modeling Section 4.12

Verilog Modeling

• Verilog Modeling Styles– Gate-Level Modeling– Dataflow Modeling– Behavioral Modeling

Page 5: More Examples Dataflow/Behavioral Modeling Section 4.12

Data Flow Modeling

Data flow modeling of a combinational logic uses a number of operatorsthat act on operands to produce desired results. The keyword assign is used frequently in the dataflow modeling.

Page 6: More Examples Dataflow/Behavioral Modeling Section 4.12

Behavior Modeling

• Behavioral modeling represents the digital circuits at a functional and algorithmic level. It is used mostly to describe sequential circuits, but can also be used to describe combinational circuits.

• Behavioral description use the keyword always. The event control expression

• Specifies when the statements will execute.

• The target output statement must be of reg data type.

Page 7: More Examples Dataflow/Behavioral Modeling Section 4.12

More Examples of Dataflow

Page 8: More Examples Dataflow/Behavioral Modeling Section 4.12

Verilog HDL Operators

A and B are both 4-bit binary numbers. A_gt_B is a logic 1 if A is greater than B.A_lt_B is a logic 1 if A is less than B.A_eq_B is a logic 1 if A is equal to B.

A==B is not the same as A=B.

Page 9: More Examples Dataflow/Behavioral Modeling Section 4.12

Partial Test Bench for mag_compare.v

Use concatenation to form a4-bit array called B.

Page 10: More Examples Dataflow/Behavioral Modeling Section 4.12

Output

Page 11: More Examples Dataflow/Behavioral Modeling Section 4.12

Four-Bit Adder Example

{C4,S0, S1, S2, S3)=5-bit binary number{A0, A1, A2, A3)=4-bit binary number{B0, B1, B2, B3)=4-bit binary numberC0 is a 1-bit binary number

Page 12: More Examples Dataflow/Behavioral Modeling Section 4.12

Four-Bit Adder Output

Page 13: More Examples Dataflow/Behavioral Modeling Section 4.12

More Examples of Behavioral Modeling

Page 14: More Examples Dataflow/Behavioral Modeling Section 4.12

4-to-1 MUX

Page 15: More Examples Dataflow/Behavioral Modeling Section 4.12

8-to-1 Mux

if and else example

Page 16: More Examples Dataflow/Behavioral Modeling Section 4.12

8-to-1 MUX