Verilog Answers VTU DSDV 2022
Verilog Answers VTU DSDV 2022
----------------------
Explain the operators of Verilog (any 5) and explain the precedence of operators.
Operators:
1. Arithmetic: +, -, *, /, %
4. Bitwise: &, |, ^, ~
1. Unary: ~, !
2. Multiplicative: *, /, %
3. Additive: +, -
6. Equality: ==, !=
8. Bitwise XOR/XNOR: ^, ^~
9. Bitwise OR: |
12. Conditional: ?:
----------------------
Derive a Gate level design of 4-bit adder and show the assignment of ports using Verilog.
Verilog Code:
endmodule
module four_bit_adder(
input [3:0] a, b,
input cin,
output cout
);
endmodule
Question 1c (5 Marks)
---------------------
a <= b;
b <= c;
end
----------------------
|---------------|-----------------------------|-------------------------------|
Task Example:
module task_demo;
task display_num;
begin
end
endtask
initial begin
display_num(4'b1010);
end
endmodule
----------------------
assign y = a ^ b;
endmodule
assign y = a & b;
endmodule
endmodule
Question 4c (5 Marks)
---------------------
endmodule
module top_module;
wire s;
reg a = 1, b = 0;
initial begin
end
endmodule