Binary Representations for Integers PDF

Summary

This document explains binary representations for integers, specifically how computers store and work with positive and negative integers. The different methods discussed are sign magnitude, one's complement, and two's complement. This document is helpful for understanding fundamental concepts in computer science.

Full Transcript

# Binary Representations for Integers In the early days of computing, designers made computers express numbers using unsigned binary. And they were content... * 00101010 Until there were negative numbers. * (What's negation?) To include negative numbers, designers came up with sign magnitude. T...

# Binary Representations for Integers In the early days of computing, designers made computers express numbers using unsigned binary. And they were content... * 00101010 Until there were negative numbers. * (What's negation?) To include negative numbers, designers came up with sign magnitude. That took care of the negative numbers... * 10000101 But the computer had to count backwards for the negative numbers. * 00000000? * 10000000? * Set the sign bit! Plus, this introduced positive and negative zero. Then designers created one's complement. Now computers only had to count in one direction... * 11111010 But there were still two zeroes! * 00000000? * 11111111? * Flip the bits! Finally, designers developed two's complement. Now, there was only one zero... * 00000000 And they were content. * Flip the bits and add 1!

Use Quizgecko on...
Browser
Browser