Posts

Showing posts with the label concatenation

VERILOG 8 : Verilog Operators Explained with Examples

Image
Learning Verilog becomes much easier when you master operators . Just like in C or Java , operators in Verilog help perform mathematical, logical, relational, and bit-level operations . Whether you’re simulating a design or writing RTL code , operators simplify coding and make it more readable. In this blog, we’ll explore all Verilog operators with clear explanations, syntax, and practical examples. 🔹 1. Arithmetic Operators Arithmetic operators work on numbers (integers, registers, parameters). Binary Operators : + , - , * , / , % Unary Operators : + , - 👉 Key Points: Integer division truncates fractions. Modulus % takes the sign of the first operand. If operands contain unknown x , the result is x . 📌 Example: module arithmetic_operators(); initial begin $display (" 5 + 10 = %d", 5 + 10); $display (" 10 * 5 = %d", 10 * 5); $display (" 10 / -5 = %d", 10 / -5); $display (" 10 % 3 = %d", 10 % 3); $display ...