Professional Documents
Culture Documents
style.
endmodule
Results (Dataflow Modeling):
1. Module
4. Simulation Waveform
Code (Behavioural Modeling):
module Behave_HA(input INA,input INB,
output reg Sum,
output reg Carry
);
always @(INA,INB)
begin
case({INA,INB})
2'b00 : begin
Sum<=0;
Carry<=0;
end
2'b01 : begin
Sum<=1;
Carry<=0;
end
2'b10 : begin
Sum<=1;
Carry<=0;
end
2'b11 : begin
Sum<=0;
Carry<=1;
end
default: begin
Sum<=1;
Carry<=1;
end
endcase
end
endmodule
reg INA,INB;
wire Sum,Carry;
HALF_ADDER DUT(INA,INB,Sum,Carry);
Behave_HA DUT1(INA,INB,Sum,Carry);
initial
begin
INA=0;INB=0;
#10 INA=0;INB=1;
#10 INA=1;INB=0;
#10 INA=1;INB=1;
#10 $finish;
end
always @(INA,INB)
begin
end
endmodule
Results (Test Bench):
1. Simulation Waveform
2. Console Window
Conclusion:
In this experiment, we implemented Half-Adder in Verilog using Dataflow, Structural &
Behavioural Modeling style in Xilinx ISE Design Suite and observed the simulation waveform of
Half-Adder in ISim.