PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, December 9, 2022

[FIXED] What is the meaning of the hex value syntax with an underscore? eg:parameter FOO = 20'h0002_0

 December 09, 2022     parameters, syntax, system-verilog, verilog     No comments   

Issue

Pretty much just the title. What does that underscore mean? How is this different from:

parameter FOO = 20'h00020;

I don't know what to look for to find an answer to this question as I don't know what this type of syntax is called.


Solution

From the IEEE Std (1800-2009), section "5.7.1 Integer literal constants":

The underscore character (_) shall be legal anywhere in a number except as the first character. The underscore character is ignored. This feature can be used to break up long numbers for readability purposes.

So, 20'h00020 is the same as 20'h0002_0.

I found this by searching in the above spec for "underscore".



Answered By - toolic
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing