hardlim(0) should be 1, instead of 0.
hardlim(0) should be 1, instead of 0.