//-------------------------------test bench------------------------------------------------------- #include //#include //#include "and_gate_source.cpp" //int and_gate (int a, int b, int c); // calling the and_gate function void and_gate (int a, int b, int c); int main() { int x,y; int j,c=0b00; printf("\n Test Initiated"); for (j=0; j<4;j++) { switch(j) { case 0: x=0b00; y=0b00; break; case 1: x=0b00; y=0b01; break; case 2: x=0b01; y=0b00; break; case 3: x=0b01; y=0b01; break; default: printf("\nerror!"); } and_gate(x ,y, c); printf("\nresult:%d",c); } }