Перейти к содержимому

Why 255 + 1 = 0: Binary Addition and Overflow | Binary (4)

math-support-jp

0:00 / 0:00

Why 255 + 1 = 0: Binary Addition and Overflow | Binary (4)

8 просмотров · 3 дня назад
math-support-jp
339 подписчиков
8 просмотров · 3 дня назад
Why 255 + 1 = 0: Binary Addition and Overflow | Binary (4) Sheet http://math-support.jp/wp-content/upl... Why does 255 + 1 come out as 0? So far this series has looked at how numbers are written in binary. This time we look at how they are added. There are only four rules for adding one digit to another, and only one of them carries. That single rule is what produces overflow, and with it the Year 2038 problem. In this video 00:00 Introduction 00:17 The rules for adding in binary 00:52 How to set it out 01:07 Example 1: no carries 01:58 Example 2: carries in a chain 03:05 Exercise 1 03:24 Working through the answers 06:31 The number of digits is fixed 07:03 Adding 1 to 255 07:39 Overflow 08:05 The Year 2038 problem 08:36 Why it is hard to fix 09:16 Two faces of being finite What you will learn There are four ways to add one binary digit to another, and only 1 + 1 carries The method is the same as long addition in decimal: add from the right, carry to the left Eight bits give 2⁸ = 256 values, from 0 to 255 255 + 1 produces a ninth digit that does not fit, so it is thrown away and 0 remains The Year 2038 problem is overflow in a 32-digit count of seconds Most systems are already fixed, but finding every last one is the hard part Error and overflow are the same limit seen twice: the number of digits is finite This series (1) Binary and Decimal — converting whole numbers (2) Numbers after the point (3) Repeating fractions and error (4) Binary addition and overflow ← this video A worksheet to go with this video is available at math-support.jp