I need to create a logic gate which will find out whether a number is negative or not.
The input is 8 bits and the output is 1 bit, and if the input is 1 (i.e. negative number) then the output should also be 1, but if the input is 0, then the output should also be 0, so it kinda works like a NOT gate without the inverter.
I've read about the MSB and how it works and that I'd need to feed it in to the input but I'm not entirely sure how to write it. I'm going to be testing this on a HDL, so I'll need to write it a bit like:
Not(in=in[1], out=out[1];
and so on.
Any ideas?
assign signbit = in[7]
and be done. If you have no other option you could cascade two inverters. \$\endgroup\$