Verilog Help (quote mark)

Status
Not open for further replies.

jihadmoussa

Newbie level 5
Joined
Sep 28, 2010
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,342
can somebody please explain the following assign for me:
bit_counter <= `COMMAND_BITS;

I couldn't know what does the quote mark do?
thank
 

Code:
`define COMMAND_BITS 4

bit_counter <= `COMMAND_BITS;

Does the same as:
Code:
bit_counter <= 4;

But with regard to coding style, you will probably want to use the "parameter" or "localparam" verilog directive for that.

Code:
parameter COMMAND_BITS = 4;

bit_counter <= (COMMAND_BITS); // better style IMO

Hope that helps.
 
Reactions: jihadmoussa

    V

    Points: 2
    Helpful Answer Positive Rating

    jihadmoussa

    Points: 2
    Helpful Answer Positive Rating
Thank you very much.
you were really helpful.

thanks again.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…