Top "Twos-complement" questions

Two's complement is a mathematical operation on binary numbers, as well as a binary signed number representation based on this operation.

Convert a signed decimal to hex encoded with two's complement

I need to encode a signed integer as hexadecimal using via the two's complement notation. For example I would like …

javascript twos-complement
Java binary literals - Value -128 for byte

Since SE 7 Java allows to specify values as binary literal. The documentation tells me 'byte' is a type that can …

java binary byte literals twos-complement
Hex Twos Complement Arithmetic

I'm trying to do the following problem: E8B2035D -FB60528D ---------- In which, the integers represented are hex …

subtraction hex twos-complement base-conversion
VHDL complement counter issues: converting std_logic to integer

Essentially, my question is: "can this not be done any easier?"; and what 'this' is, follows below (code too): I …

integer logic counter vhdl twos-complement
carry/overflow & subtraction in x86

I'm trying to wrap my head around overflow & carry flags in x86. As I understand it, for addition of …

math x86 overflow twos-complement carryflag
How to convert a negative integer into two's complement binary form? (Java)

I need to convert numbers, positive and negative, into binary format - so, 2 into "00000010", and -2 into "11111110", for example. I …

java binary twos-complement
~x + ~y == ~(x + y) is always false?

Does this code always evaluate to false? Both variables are two's complement signed ints. ~x + ~y == ~(x + y) I feel …

c bit-manipulation signed twos-complement
What is ^0 in golang?

I am seeing ^0 in the code base. Example: type stat struct { ... min int64 ... } newStat := stat{min: ^0} What does ^0 mean?

go bitwise-operators twos-complement