wire |
reg |
wire elements are used to connect input and output ports of a module instantiation together with some other element in your design. |
reg elements can be connected to the input port of a module instantiation. |
reg elements cannot be connected to the output port of a module instantiation. |
|
wire elements are used as inputs and outputs within an actual module declaration. |
reg elements can be used as outputs within an actual module declaration. |
reg elements cannot be used as inputs within an actual module declaration. |
|
wire elements cannot be used as the left-hand side of an = or <= sign in an always@ block. |
reg is the only legal type on the left-hand side of an always@ block = or <= sign. |
wire elements are the only legal type on the left-hand side of an assign statement. |
reg cannot be used on the left-hand side of an assign statement. |
wire elements are a stateless way of connecting two pieces in a Verilog-based design. |
|
|
reg can be used to create registers when used in conjunction with always@(posedge Clock) blocks. |
wire elements can only be used to model combinational logic. |
reg can be used to create both combinational and sequential logic |
Both can appear on the right-hand side of assign statements and always@ block = or <= signs. |
|
Both can be connected to the input ports of module instantiations. |
|
|
|
module Div20x (rst, clk, cet, cep, count, tc); // TITLE 'Divide-by-20 Counter with enables' // enable CEP is a clock enable only // enable CET is a clock enable and // enables the TC output // a counter using the Verilog language
parameter size = 5; parameter length = 20;
input rst; // These inputs/outputs represent input clk; // connections to the module. input cet; input cep;
output [size-1:0] count; output tc;
reg [size-1:0] count; // Signals assigned // within an always // (or initial)block // must be of type reg
wire tc; // Other signals are of type wire
// The always statement below is a parallel // execution statement that // executes any time the signals // rst or clk transition from low to high
always @ (posedge clk or posedge rst) if (rst) // This causes reset of the cntr count <= {size{1'b0}}; else if (cet && cep) // Enables both true begin if (count == length-1) count <= {size{1'b0}}; else count <= count + 1'b1; end
// the value of tc is continuously assigned // the value of the expression assign tc = (cet && (count == length-1));
endmodule |
- پاییز 83
- جایگاه FPGA و DSP در کاربری های نظامی
- انجام پروژه های VHDL و Verilog و FPGA
- سیستم عامل بلادرنگ - RTOS
- رفع مشکل بسته شدن ISE Design Suite 14.7 در ویندوز 8 و 10
- ماشین حالت ... میلی و مور
- بررسی گزینه های انتخاب FPGA در سیستمهای اویونیک و فضاپیماها
- معرفی پردازنده ی سیگنال دیجیتال TMS320F2812
- مقدمه ای بر SystemC
- درایور مبدل USB به RS485 (چیپ CH340 و CH341)
پربیننده ترین مطالب
- راه اندازی دوربین OV7670 و نمایشگر TFT با برد پازج
- پشت پرده انفجار پیجرها در لبنان
- یادداشت هایی برای برنامه نویسان کیوت - یادداشت دوم
- یادداشت هایی برای برنامه نویسان کیوت
- RS485 Auto Addressing by Isolators
- TPS61041
- MMC5883MA - Low Cost 3-axis Magnetic Sensor
- Screen Flickering
- ATtiny45
- SSD1963