Professional Documents
Culture Documents
SimVision
AND Gate Verilog Code
Declare inputs & outputs
• Using inbuilt pre-defined Instance “AND”
• Using bit wise operator & Assign Statement
Steps :
• Create a file named and_gate.v (can be any name)
• Write the code in and_gate.v
• Execute the code from terminal using
ncverilog and_gate.v
• Up on execution we should ensure that no errors
are present in design
Delay Operator - #
keyword “#” is used to introduce delay in Verilog code
• c
…..
}
# 10
c
…..
}
• In the above code 1 gets executed first, then simulator waits for 10 units of time then runs code 2
Initial & Always Blocks
Initial Block is used to run the code which needs to be executed only once