# How to change value of the variable which we have given the value using \`define?

**URL:** <https://verificationacademy.com/forums/t/how-to-change-value-of-the-variable-which-we-have-given-the-value-using-define/33081>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, SV, generate-macro-define\
**Created:** [April 27, 2017, 5:19am UTC](https://verificationacademy.com/forums/t/how-to-change-value-of-the-variable-which-we-have-given-the-value-using-define/33081 "2017-04-27T05:19:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![RajaBandi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@RajaBandi](https://verificationacademy.com/forums/u/RajaBandi)\
**Post date:** [April 27, 2017, 10:08am UTC](https://verificationacademy.com/forums/t/how-to-change-value-of-the-variable-which-we-have-given-the-value-using-define/33081/4 "2017-04-27T10:08:26Z")

</div>

_In reply to [Vyom](https://verificationacademy.com/forums/t/how-to-change-value-of-the-variable-which-we-have-given-the-value-using-define/33081/3):_

Yes You can. Using `define along with parameter

`define P 2  
module tb;

parameter T=`P;

initial  
$display (T);

Use below switch along the compilation command line  
+define+P=20

The value of parameter T now becomes 20

---

_[View the full topic](https://verificationacademy.com/forums/t/how-to-change-value-of-the-variable-which-we-have-given-the-value-using-define/33081)._
