Professional Documents
Culture Documents
EE-307 Fpga Based System Design: Lecture # 04
EE-307 Fpga Based System Design: Lecture # 04
Verilog
Combinational Logic in Verilog
Lecture # 04
Today’s Lecture
Gate-Level modelling
Verilog gate Primitives
Dataflow Modelling
Continuous Assignment using assign statement
Expressions, Operators, Operands
Behavioural Modelling
Structured Procedures: Initial & always blocks
Blocking & Non-blocking statements
HLL Higher language constructs (if, switch, case, loops)
Moving to Data Flow Model
Dataflow Level
Characterized by assign statement
Allows Expressions, Operators, Operands
Example:
wire c
assign c = a + b;
Example
wire d;
assign d = a || b; // explicit continuous assignment
Example
wire d = a || b; //implicit continuous assignment
Data Flow for full adder
[SHO]
Port Connection Styles
Instantiating a Module in another block
[SHO]
This
method is
better for
block with
greater no.
of ports
Combinational Logic
Output is Boolean
function of its input
variables on
instantaneous basis
CIL
Verilog Operators
Logical Right Logical Left
Arithmetic operators: +, -, *, /, %
Bitwise operators: &, |, ~, ^, ^~
Reduction operators: &, ~&, |, ~|, ^
module mux21(
input in1,in2,sel,
output out);