BASIC GATES
Logic gates (or simply gates) are the fundamental building blocks
of digital circuitry. As their name implies, they function by
"opening" or "closing" to admit or reject the flow of
digital information. Gates implement electronically simple logical operations
on boolean (Bool’s algebra) variables, i.e. variables that can have only one of
two states (0/1, low/high, false/true). From an electrical point of view and
for the TTL (transistor-transistor-logic) family of digital electronics, any
voltage in the range 0-0,7 V and in the range 2,5-5 V, represent logic states 0
and 1, respectively. In the following figure the accepted electronic symbols
for different gates are shown, along with their corresponding "truth
tables" and their symbolic logical expressions. All variables (X, A, B, …)
are booleans.
VERILOG CODE FOR ANDGATE
OUTPUT WAVE FORM