Verilog-Storage.pptx

# Verilog-Storage.pptx - EE 2730 Spring 2010 Verilog for...

This preview shows pages 1–6. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EE 2730 Spring 2010 Verilog for Sequential Circuits Chapter 7.12.2-7.12.5, 7.13.3 Adapted from a presentation by Dr. Jerry L. Trahan EE 2730 - Spring 2010 2 Implied memory o if statement can specify storage element always @ (control or B) if (control) A = B; // A is variable of reg type o Does not say what happens when control = 0 o In absence of an assigned value, Verilog compiler assumes value of A caused by if statement must be maintained until next time if statement evaluated. o Implied memory realized by a latch in the circuit. EE 2730 - Spring 2010 3 D latch and flip-flop module D_latch (D, Clk, Q); input D, Clk; output reg Q; always @(D, Clk) if (Clk) Q = D; endmodule Figure 7.35. Code for a gated D latch. module flipflop (D, Clock, Q); input D, Clock; output reg Q; always @( posedge Clock ) Q = D; endmodule Figure 7.36. Code for a D flip-flop. EE 2730 - Spring 2010 4 Blocking and Non-Blocking Assignment o Blocking assignment n Example: Q = D; n Verilog compiler in always block evaluates statements in the order in which they are written n If a variable is given a value by a blocking assignment statement, then new value used in evaluating all subsequent statements in the block. n Preferred for combinational logic EE 2730 - Spring 2010 5 Blocking and Non-Blocking Assignment o Non-blocking assignment n Example: Q &lt;= D; n Verilog compiler in always block evaluates statements using the values that the variables have when the always block is entered n Variable has same value for all statements in the block n Preferred for sequential logic EE 2730 - Spring 2010 6...
View Full Document

## Verilog-Storage.pptx - EE 2730 Spring 2010 Verilog for...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online