100% found this document useful (3 votes)
6K views

Logic Gates Using Dataflow Modeling

This document defines Verilog modules for basic logic gates - NOT, OR, AND, NOR, NAND, XOR, and XNOR gates. Each module specifies the gate's input(s), output, and assigns the output value using the appropriate logic operator(s) of the inputs.

Uploaded by

Murali
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
6K views

Logic Gates Using Dataflow Modeling

This document defines Verilog modules for basic logic gates - NOT, OR, AND, NOR, NAND, XOR, and XNOR gates. Each module specifies the gate's input(s), output, and assigns the output value using the appropriate logic operator(s) of the inputs.

Uploaded by

Murali
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

These programs are using Data Flow Modeling

//NOT gate
module notgate(a,y);
input a;
output y;
assign y= ~a;
endmodule

//OR gate
module orgate(a,b,y);
inpput a,b;
output y;
assign y=(a|b);
endmodule

//AND gate
module andgate(a,b,y);
input a,b;
output y;
assign y=(a&b);
endmodule

//NOR gate
module norgate(a,b,y);
inpput a,b;
output y;
assign y=~(a|b);
endmodule



//NAND gate
module nandgate(a,b,y);
input a,b;
output y;
assign y=~(a&b);
endmodule




//XOR gate
module xorgate(a,b,y);
input a,b;
output y;
assign y=(a^b);
endmodule

//XNOR gate
module xnorgate(a,b,y);
input a,b;
output y;
assign y=(~(a^b));
endmodule

You might also like