From the course: Learning Verilog for FPGA Development

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Gates and primitives

Gates and primitives - FPGA Tutorial

From the course: Learning Verilog for FPGA Development

Start my 1-month free trial

Gates and primitives

- [Narrator] We've already seen gates in some of the previous examples. All of the the basic n-input gates are available in Verilog as primitives. So you don't have to write modules for them. These are the OR, AND, XOR, NOR, NAND and XNOR gates. To instantiate multi-input gates, the syntax goes like this. First you must specify the gate you want, all in lowercase. Next, you may optionally name the instance. And finally, you specify the connections in a port list, enclosed by parenthesis. Where the first port is the output, and the remaining are the inputs. Buffers and inverters are also available as primitives. And they may have any number of outputs. First, you specify the buffer type, either buf or not, with an optional instance name. And then, the veriadic order of ports is slightly different to n-input gates. The last one is the input. And the remaining are all outputs. As you may know, tristate buffers are useful…

Contents