Combinational Logic
Bitwise Operators
module gates(input logic [3:0] a, b,
output logic [3:0] y1, y2, y3
y4, y5, y6);
/* five different two-input logic
gates acting on 4-bit busses */
assign y1 = a & b; // AND
assign y2 = a | b; // OR
assign y3 = a ^ b; // XOR
assign y4 = ~(a ^ b); // XNOR
assign y5 = ~(a & b); // NAND
assign y6 = ~(a | b); // NOR
endmodulemodule gates(input [3:0] a, b,
output [3:0] y1, y2, y3
y4, y5, y6);
/* Five different two-input logic
gates acting on 4 bit busses */
assign y1 = a & b; // AND
assign y2 = a | b; // OR
assign y3 = a ^ b; // XOR
assign y4 = ~(a ^ b); // XNOR
assign y5 = ~(a & b); // NAND
assign y6 = ~(a | b); // NOR
endmodule
Operators, Operands, Expression and Statements
Continuous Assignment Statement
Comments and White Space
Reduction Operators
Conditional Assignment
Internal Variables
Precedence

Numbers
Numbers
Bits
Base
Val
Stored
Z's and X's
Bit Swizzling
Delays
Last updated