FAQs - Frequently Asked Questions (FAQs) 9/17/2007 I am...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Frequently Asked Questions (FAQs) 9/17/2007 I am having some issues with problem 4-17 in the homework. The code that I am using compiles just fine however I think I am getting some of the syntax messed up because the program appears to not be counting at all. Here is the code that I am using. module Count_4b_10 (count, enable, clock, reset); output [3:0] count; input enable, clock, reset; reg [3:0] count; always @ (count or enable) begin for(count=0; count <=10; count=count+1) if(count==10) begin count = 0; end end endmodule any suggestions you might have would be greatly appreciated. Reply: The for loop that increments count is inside the cyclic behavior that is waiting to detect a change in count. The behavior cannot execute because count can’t change before the behavior executes. FAQ #1: What is the advantage of using a fork … join block in a testbench? Answer: Using a fork join instead of a begin end block can simplify the bookkeeping to manage the description of waveforms in complex stimulus generators. FAQ #2 : What is the use of a ? in a literal number? Answer : Note that x and z are valid characters in binary, octal, and hex formats of literal numbers. A ? in a literal number is interpreted as the value z. FAQ #3:
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

FAQs - Frequently Asked Questions (FAQs) 9/17/2007 I am...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online