Question

1. give an instance where it would be better to infer logic rather than instantiate it....

1. give an instance where it would be better to infer logic rather than instantiate it.

2. give an instance where it would be better to instantiate logic rather than infer it.

(verilog)

Homework Answers

Answer #1

Here a Verilog inference example. The synthesis tool recognizes (infers) the 8-bit up-counter with synchronous clear, and generates an appropriate register with adder logic.

Code:

module top (clk, clear, count);
  input             clk, clear;
  output reg  [7:0] count=0;

  always @ (posedge clk)
    count <= clear ? 0 : count + 1;
endmodule

If you simply drop a "COUNTER" module from your synthesis tool's library into your HDL, that's instantiation. Of course, your library may not have a COUNTER module, or it may have a different name, or it may have different I/O signals.

Code:

module top (clk, clear, count);
  input             clk, clear;
  output      [7:0] count;

  COUNTER #(.WIDTH(8)) u1 (.CLK(clk), .CLEAR(clear), .OUT(count));
endmodule

Either way, you should get very similar register/logic results in your FPGA/CPLD.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Give an example of a study where you SHOULD infer cause from the results.
Give an example of a study where you SHOULD infer cause from the results.
Why is it better to produce nylon in the lab rather than commercially?
Why is it better to produce nylon in the lab rather than commercially?
Can you give me 2 tape turing machine logic for a*nb*ma*nb*m where n,m>=0. Give the turing...
Can you give me 2 tape turing machine logic for a*nb*ma*nb*m where n,m>=0. Give the turing machine also, and explain the logic. Please give the time complexity ?
If it would be cheaper to give each steelworker $375,000 per year in cash rather than...
If it would be cheaper to give each steelworker $375,000 per year in cash rather than impose restrictions on steel imports, why do we have the import restrictions rather than the cash payments? Who gains and who loses from import restrictions? In answering, you should consider both consumers and producers in both the country that imposes the restrictions and the other countries affected by them
If it would be cheaper to give each steelworker $375,000 per year in cash rather than...
If it would be cheaper to give each steelworker $375,000 per year in cash rather than impose restrictions on steel imports, why do we have the import restrictions rather than the cash payments? Who gains and who loses from import restrictions? In answering, you should consider both consumers and producers in both the country that imposes the restrictions and the other countries affected by them.
Provide an example of an instance in which a record would be maintained for a group...
Provide an example of an instance in which a record would be maintained for a group of animals rather than an individual patient.
Do you think there are circumstances where employee empowerment would hurt rather than improve quality?
Do you think there are circumstances where employee empowerment would hurt rather than improve quality?
Do you think there are circumstances where employee empowerment would hurt rather than improve quality?
Do you think there are circumstances where employee empowerment would hurt rather than improve quality?
Is it always better to allocate all costs rather than leave them in a lump sum?
Is it always better to allocate all costs rather than leave them in a lump sum?
4. You see a graph where the vertical scale begins with a large number rather than...
4. You see a graph where the vertical scale begins with a large number rather than zero. Explain why this should always give you reason to be suspicious.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT