Verilog Module
Verilog Module
Introduction
What is Verilog?
Introduction to Verilog
Data Types
Verilog Syntax
Verilog Arrays
Building Blocks
Verilog Module
Verilog Port
Verilog Operators
Verilog Concatenation
Verilog in a nutshell
Verilog generate
Behavioral modeling
Verilog Blocking/Non-blocking
Verilog if-else-if
Verilog Functions
Verilog Tasks
Verilog Parameters
Gate/Switch modeling
Gate Delays
User-Defined Primitives
Simulation
Verilog Testbench
Verilog Timescale
Verilog Timeformat
Code Examples
Hello World!
JK Flip-Flop
D Flip-Flop
T Flip-Flop
D Latch
Counters
4-bit counter
Ripple Counter
Johnson Counter
Mod-N Counter
Gray Counter
Misc
Priority Encoder
4x1 multiplexer
Full adder
Verilog module
1. Syntax
2. Example
1. Hardware Schematic
3. What is the purpose of a module ?
1. Hardware Schematic
4. What are top-level modules ?
1. Design Top Level
2. Testbench Top Level
5. Hierarchical Names
A module is a block of Verilog code that implements a certain
functionality. Modules can be embedded within other modules
and a higher level module can communicate with its lower level
modules using their input and output ports.
Syntax
Example
The module dff represents a D flip flop which has three input
ports d , clk , rstn and one output port q . Contents of the
module describe how a D flip flop should behave for different
combinations of inputs. Here, input d is always assigned to
output q at positive edge of clock if rstn is high because it is
an active low reset.
1 // Module called "dff" has 3 inputs and 1 output
2 module dff ( input d,
3 input clk,
4 input rstn,
5 output reg q);
6
7 // Contents of the module
8 always @ (posedge clk) begin
9 if (!rstn)
10 q <= 0;
11 else
12 q <= d;
13 end
14 endmodule
Hardware Schematic
Hardware Schematic
Note that the dff instances are connected together with wires
as described by the Verilog RTL module.
Hierarchical Names
Works
Where You
Write
Grammarly offers
suggestions to ensure
you write at your best.
Download it now.
Grammarly
Install
Interview Questions
Digital Fundamentals
Verilog Tutorial
Verification
SystemVerilog Tutorial
UVM Tutorial
Verilog Testbench
Synchronous FIFO