Logical Functions, Sign Extensions, and Overflow

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…



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Brendan Massey

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