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.

Boolean algebra expressions

Boolean algebra expressions - FPGA Tutorial

From the course: Learning Verilog for FPGA Development

Start my 1-month free trial

Boolean algebra expressions

- [Instructor] Boolean algebra expressions are possible in Verilog because, well, sometimes all you have is an equation. For this purpose, Verilog implements the usual bitwise operators implemented in the syntax of C and java. The AND operator is the ampersand character. For OR, we use the vertical bar character. XOR is represented with the caret character, and the NOT operator is the tilde character, and it's used as a prefix operator. These expressions can be used either in a continuous assignment using the assigned keyword anywhere in your code, just as you instantiate gates or modules. Or, in blocking or non-blocking assignments, which can either go inside Initial blocks, or Always blocks. We'll look closer into these structures up next.

Contents