title: Comparison of hex numbers (32'h and 0x) in tcl script
body: <p>I am writing a tcl script (in questasim) which does the following comparison. But the values are same but still not matching. any pointer to this would be helpful.</p>
  
  <h1>Code Snippet:</h1>
  
  <pre><code>set ExpAddr 0xffff0000
  set Addr "sim:/tb_top/dut_top/m1/m2/m3/addr"
  set ActualAddr "[examine -hex $Addr]"
  
  if { $ActualAddr == $ExpAddr } {
      puts  " ADDR MATCH DETECTED @ time [expr $now/1000000.0] us "
  } else {
      puts  " ADDR MATCH NOT DETECTED @ time [expr $now/1000000.0] us " 
      puts $ActualAddr
      puts $ExpAddr
  }
  </code></pre>
  
  <h1>Result:</h1>
  
  <pre>
  ADDR MATCH NOT DETECTED @ time 145.99 us
  Actual Address   : 44'h000ffff0000
  Expected Address : 0xffff0000
  </pre>