From Jason Turner
Watch on YouTube

Summary

In this foundational computer science episode, Jason explores the two's complement representation used for signed integers in computers, now officially mandated by the C++20 standard. He explains how this clever binary number system works by demonstrating operations with 4-bit integers, showing that addition, subtraction, and multiplication operations function consistently whether working with signed or unsigned values. Jason demonstrates the process of negating a number in two's complement (invert all bits, then add 1) and explains how this allows the same underlying binary operations to work for both positive and negative numbers.

Resources

Tags