Lec12 VHDL Versus Verilog
Lec12 VHDL Versus Verilog
Lecture 12:
VHDL versus Verilog
Ming-Chang YANG
[email protected]
Outline
• VHDL vs. Verilog
– Background
– Syntax and Popularity
– Operators
– Overall Structure
– External I/O Declaration
– Concurrent Statements
– Sequential Statements
• Edge Detection
– Wire vs. Reg
– Structural Design
– Design Constructions
– Case Study: Flip-flop
CENG3430 Lec12: VHDL versus Verilog 2
What are VHDL and Verilog?
Component A
Component B Component C
Top Module
Module Module Module
Popularity
VHDL is more popular with Verilog is more popular with
European companies. US companies.
VHDL Verilog
process (clk) always @ (posedge clk)
begin or
sensitivity list
... always @ (negedge clk)
if rising_edge(CLK) begin
or conditions
if falling_edge(CLK) ...
...
end conditions end
CENG3430 Lec12: VHDL versus Verilog 23
Student ID: Date:
Class Exercise 12.3 Name:
Component B Component C
end
endmodule
CENG3430 Lec12: VHDL versus Verilog 40
Posedge Flip-flop with Async Reset (1/2)
VHDL Verilog
entity dff is module dff(
port(D,CLK,RESET: input D,
in std_logic; input CLK,
Q: out std_logic); input RESET,
end dff; output reg Q);
architecture dff_arch of always @(posedge CLK or
dff is begin posedge RESET)
process(CLK,RESET) begin begin
if (RESET = '1') if (RESET) begin
then Q <= 1'b0;
Q <= '0'; end
elsif rising_edge(CLK) else begin
then Q <= D;
Q <= D; end
end if;
end process; end
end dff_arch; endmodule
CENG3430 Lec12: VHDL versus Verilog 41
Posedge Flip-flop with Async Reset (2/2)
Verilog
module dff(
input D,
input CLK,
input RESET,
output reg Q);
always @(posedge CLK or Question: What if we do not
posedge RESET) specify “posedge” for the
begin RESET signal?
if (RESET) begin
Q <= 1'b0; [Synth 8-434] mixed level sensitive
end and edge triggered event controls are
else begin not supported for synthesis!
Q <= D;
end positive level