Pre-Lecture Prep and Pre-Quiz

Please read the "signed numbers and complements" section and complete the pre-quiz on moodle.

Announcements

Learning Objectives and Outcomes

In this lecture, you will...

By the end of this lecture, you should be able to...

Signed Numbers

When we introduced the variable types byte , unsigned int and int, we discussed how only the int type is signed, and that it had a range of -32,768 to 32,767 instead of the unsigned version, which had a range of 0 to 65,535. Both int and unsigned int are 16-bit binary numbers; the difference is how those $2^{16}-1$ values are allocated.

Let's consider a 3-bit unsigned number first. We can think of binary numbers as a circle:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4f84a4b3-2e6a-435d-adaf-63e949a375bf/BinaryNumber.png