Logical Functions, Sign Extensions, and Overflow

Brendan Massey
6 min readJun 19, 2021

As discussed here, bits are essential building blocks for information and data. The value of a bit comes from the electrical pulses: the voltage, received by the bit. We use a standard known as 2’s Complement to write binary such that addition and subtraction work. In the last segment, we showcased an edge-case where addition would fail: overflow.

Overflow occurs when the most significant bit is incremented beyond the range of bits. For example, 0111 + 0001 = 7 + 1 should equal 8; however, this equals 1000, which is -8 in 2’s Complement, as the…

--

--

Brendan Massey

I write about programming and computer science as well as review Coursera courses I have taken related to the aforementioned topics.