Home / Learn Verilog / integer, time and real

integer, time and real

Variable types for testbenches.

In shortVariable types for testbenches.

What's actually going on

Typesinteger - loop counters, 32-bit signedtime - $time values, 64-bitreal - floating point maths
Types

Definition

integer is a 32-bit signed variable, time a 64-bit unsigned, real floating point.

Why you need this

Used for loops and measurements in testbenches; not for RTL signals.

How it works

Use $time to read simulation time.

Where you'll see this

  • Everyday RTL design
  • FPGA and ASIC projects
  • Testbenches and debugging

Try it

Measure a delayVerilog: edit and run

integer can be negative.

Test what you just read

1. integer is...