گروه فنی مهندسی آرکام

پروژه های دانشجویی ، آموزش ، مشاوره ، فروش آثار

گروه فنی مهندسی آرکام

پروژه های دانشجویی ، آموزش ، مشاوره ، فروش آثار

گروه فنی مهندسی آرکام

گرداننده و نگارنده : محمد نوری

البرز ، کرج ، گلشهر

09125623558
Nouri.Iut@Gmail.Com

جهت حمایت از این وبلاگ، ما را به یک فنجان چای داغ مهمان کنید.
6273-8111-1003-9762

دنبال کنندگان ۳ نفر
این وبلاگ را دنبال کنید

تبلیغات

آخرین نظرات

پیوندها

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

نظرات  (۰)

هیچ نظری هنوز ثبت نشده است

ارسال نظر

ارسال نظر آزاد است، اما اگر قبلا در بیان ثبت نام کرده اید می توانید ابتدا وارد شوید.
شما میتوانید از این تگهای html استفاده کنید:
<b> یا <strong>، <em> یا <i>، <u>، <strike> یا <s>، <sup>، <sub>، <blockquote>، <code>، <pre>، <hr>، <br>، <p>، <a href="" title="">، <span style="">، <div align="">
تجدید کد امنیتی