Verilog Exp 1
Verilog Exp 1
Verilog Code:
• Top Module
timescale 1ns / 1ps
module Gates (a, b, out_and, out_or, out_not, out_nand, out_nor,
out_xor, out_xnor);
input [3:0] a, b;
output[3:0] out_and, out_or, out_not, out_nand, out_nor, out_xor,
out_xnor;
assign out_and=a&b;
assign out_or=a|b;
assign out_not=~a;
assign out_nand=~(a&b);
assign out_nor=~(a|b);
assign out_xor=a^b;
assign out_xnor=~(a^b);
endmodule
OUTPUT:
Figure l and Figure 2 shows the Simulation Waveform and RTL Design of
the above Verilog code respectively.
Results :
Verilog code of Digital Logic Gates was simulated, and correct results were
obtained for all the Boolean operations, RTL schematic for the code was
generated.