fixed bitwise not
Merge branch 'master' into verilog
fixed bug in ref