# Timescale

**URL:** <https://verificationacademy.com/forums/t/timescale/35510>\
**Category:** SystemVerilog\
**Tags:** Timescale-issue, SystemVerilog\
**Created:** [December 25, 2018, 7:33pm UTC](https://verificationacademy.com/forums/t/timescale/35510 "2018-12-25T19:33:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raja7052](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@raja7052](https://verificationacademy.com/forums/u/raja7052)\
**Post date:** [December 25, 2018, 7:33pm UTC](https://verificationacademy.com/forums/t/timescale/35510/1 "2018-12-25T19:33:12Z")

</div>

This is a small program I found on the web for timescale

```verilog
`timescale 1ns/100ps
module tscale();

   time a;

   initial
     begin
        a = 0;
        #1 a = 1ns;
        #1 a = 5ns;
        #1 a = 20;
        #5 a = 100;                
     end

   initial
     begin
        $monitor("%t a=%t",$time,a);        
     end
   
endmodule

```

This is the output I am getting

```
               0 a= 0
              10 a= 10
              20 a= 50
              30 a= 200
              80 a= 1000

```

I was expecting the %t to be printed as 0,1,2,3 and 8 since time unit is 1ns but not sure why I am getting 0,10,20,30 and 80  
also when assigning a=1ns why does the simulator print the value as 10? can someone clarify? Thanks

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [December 27, 2018, 5:26am UTC](https://verificationacademy.com/forums/t/timescale/35510/2 "2018-12-27T05:26:57Z")

</div>

_In reply to [raja7052](https://verificationacademy.com/forums/t/timescale/35510):_

See the $timeformat system function.

---

<div class="post-metadata">

**Author:** ![raja7052](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@raja7052](https://verificationacademy.com/forums/u/raja7052)\
**Post date:** [December 27, 2018, 7:56pm UTC](https://verificationacademy.com/forums/t/timescale/35510/3 "2018-12-27T19:56:51Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/timescale/35510/2):_

Thanks Dave
