Professional Documents
Culture Documents
Electrical Engineering
Handout#02Verilog
Operators
Instructor: Engr Irsa Jan
Note: Submit the lab report (solved activities and exercises) before the next lab.
Lab Hardware and Software Required:
Background Theory:
Every computer language has a set of predefined operators to perform arithmetic and
logical operations. In this lab, you will explore numerous operators available in Verilog
HDL. These operators are listed in table #1.
1. Explain the working of the four shift operators through a Verilog HDL design. You
may use 2 places for shifting.
2. Make a 2-bits max comparator HDL design using ‘?’ operator. You may take three
2-bit inputs (a, b, c), and a 2-bit output should be a max number of all the three
inputs.
Note: You also need to write a testbench code for the above exercises. Please provide your explanation
with supporting waveforms obtained from your design.