Thread: A little numbers question (verilog).

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    41

    A little numbers question (verilog).

    I'm working on a verilog project(Not C I know, But I think this transfers over. Haven't found a good verilog board yet)

    So i'm working through some demo code/ best practices to try to do a little learning and I havnt seen this before:

    Code:
    assign HEX7 = 7'h7f; 
    assign GPIO_1 = 36'hzzzzzzzzz;
    A <= 4'b0000;
    A <= A + 1'b1;
    specifically the numbers. I think 1'b1 is binary 1. is the number before the ' the base and the number after the number? still seems odd to do things in base 36 and 4.

    any help is greatly appreciated! thanks!

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    I'm thinking you'd be a lot further ahead asking your questions on a Verilog forum....

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    41
    Any recommendations for a good one? I figured this was a basic numerical notation, I think I've seen it on C and assembly before so figured it might transfer over.

  4. #4
    Registered User
    Join Date
    Dec 2009
    Posts
    41
    Ok... I think I got it. I think the number before the ' is the number of bits, and then b for binary, h for hex and then the value... the one that threw me off was the

    Code:
    assign GPIO_1 = 36'hzzzzzzzzz;
    i thought hex only went up to F, so this one is still confusing me.

  5. #5
    Registered User
    Join Date
    Mar 2011
    Posts
    278
    Quote Originally Posted by somekid413 View Post
    i thought hex only went up to F
    Yup!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A Question About Floating Numbers
    By bthomson900 in forum C Programming
    Replies: 10
    Last Post: 11-10-2010, 11:21 AM
  2. Question about random numbers
    By Kempelen in forum C Programming
    Replies: 2
    Last Post: 07-02-2008, 06:28 AM
  3. Question about numbers
    By h3ro in forum C++ Programming
    Replies: 4
    Last Post: 05-14-2007, 09:42 AM
  4. Newbie question on numbers.
    By thes in forum C++ Programming
    Replies: 14
    Last Post: 06-17-2002, 07:18 AM
  5. A (complex) question on numbers
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 02-03-2002, 06:38 PM