/* 1-bit Full adder using continuous assignment.*/


module fa_behav (sum,cout,test,a,b,cin);

input a,b,cin;
output sum,cout,test;

//Using "continous assignment" to evaluate the expressions.
//All of the assignments will be evaluated concurrently.
//The target of the "continous assignment" (sum,cout and test) 
//must be wires. 
//By default, all signals are wires, hence they need not be
//explicitly declared.
//The three statements will be continuously monitored and re-evaluted if any of the inputs
//(a,b or cin) change.

assign sum = a ^ b ^ cin;	   //sum and cout default to wires.
wire cout = (a & b) | (cin & a )| ( cin & b); //This is another way to do "continuous 						//assignment"
assign test = (a > b)? 0: 1;	  //Simply testing an if operator
				  //If a>b, test = 0 else test =1


endmodule