Lab1-Introduction Verilog
Lab1-Introduction Verilog
input a, b ;
output sum, carry ;
assign sum = a ^ b ;
assign carry = a & b ;
endmodule
Write a Verilog code of Half Adder using structural Modelling
module HalfAdder(a,b,sum,carry);
input a,b;
output sum,carry;
xor x1(sum,a,b);
and a1(carry,a,b);
endmodule
• Simple Testbench: Testbench is written to check the functionality
of the design module.
Point to NOTE:
DUT input list will be define as “reg”
type inside the testbench.
NOTE: synthesis tool will ignore any kind of “#” specified delays
Task 2
:
1. Draw TT and simplify using k-maps if a 3 input function has conditions that
output is high if inputs has exactly 2 zeros or exactly 2 ones
(20mins)