Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Verilog question for first timer - number notation

I'm working on my first verilog project, on an Altera DE2 board

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


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!

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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

    
    assign GPIO_1 = 36'hzzzzzzzzz;
    

    i thought hex only went up to F, so this one is still confusing me.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    "z" means high impedance.

    "x" is also used, for "unknown/don't care".
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ahh thank you. I didint realize I could use the Z and X in that notation. everything is cleared up. thank you very much!