1 / 16

Harvard University CSCI E-2a Life, Liberty, and Happiness After the Digital Explosion

Harvard University CSCI E-2a Life, Liberty, and Happiness After the Digital Explosion. 3B: Representation. Binary counting 1+1=10, or 1+1=0 and carry 1. Positive and Negative Numbers. Signed and unsigned numbers Unsigned: 2 8 =256 bit patterns represent 0 … 255

malise
Download Presentation

Harvard University CSCI E-2a Life, Liberty, and Happiness After the Digital Explosion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Harvard UniversityCSCI E-2aLife, Liberty, and HappinessAfter the Digital Explosion 3B: Representation

  2. Binary counting1+1=10, or 1+1=0 and carry 1

  3. Positive and Negative Numbers • Signed and unsigned numbers • Unsigned: 28=256 bit patterns represent 0 … 255 • Signed: 28 bit patterns represent -128 … +127 • Leftmost bit = sign bit: 0 => 0 or pos, 1 => neg • Largest 8-bit positive number = 01111111 = 127 • 0 = 00000000 • Most negative negative number = 10000000 =-128

  4. Negative numbers -1 = 11111111so addition works the same for positive and negative numbers

  5. Biggest Numbers • Biggest positive number = 01111111 (like 999999 on a car odometer) • Most negative negative number = 10000000

  6. Biggest Positive Number + 1 “=”Most Negative Negative Number

  7. The Comair Christmas “Glitch” • 16 bits for monthly count of crew changes • Biggest positive 16-bit number =32,767 • December was a bad month, lots of snowstorms, lots of flights rescheduled • As Christmas approached the count went from 32,767 to -32,768 by adding 1

  8. Bytes • 1 byte = 8 bits = 2 hex digits = 1 character • 210 =1024 bytes = 1 kilobyte = 1KB • 220 =1,048,576 bytes = 1 megabyte = 1MB • 230 bytes = 1 gigabyte = 1GB = “a billion” • 240 bytes = 1 terabyte = 1TB = “a trillion” • 250 bytes = 1 petabyte = 1PB = “a quadrillion” • 260 bytes = 1 exabyte = 1EB = a quintillion bytes • 270 = zetta • 280 = yotta

  9. K • All this terminology based on the accident that • Which is 1K? • There are new standard names: • 1 kibibyte = 1000 bytes • vs. 1 kilobyte = 1024 bytes • But almost no one uses “kibi-”, “mebi-”, etc.

  10. http://www.ccc.de/congress/2004/fahrplan/files/316-hidden-data-slides.pdfhttp://www.ccc.de/congress/2004/fahrplan/files/316-hidden-data-slides.pdf

More Related