APCSP: More Binary

Unit 1, Day 5

Mr. Jones | AP Computer Science Principles

Warmup

Come on in - sit anywhere you like

  • Find your nametag and stand it up on your desk
  • Take a look at your grade in studentvue
  • Discuss these questions with your neighbors:
    1. How many different numbers can we represent with 4 bits?
    2. How many decimal digits would we need to represent the same values?
    3. Can you come up with a new number system that expresses the same values using only one digit?

Terminal Activity

  • Use Nano to make a file on your desktop
  • Read the file in binary using xxd -b
  • Read the file in hex

Recap Unit 1, Day 5

Last time we…

  • Looked at parts of a computer
  • Invented counting systems with everyday objects

Today: Images -> Binary

Vocab review:

  • Analog: Information in the real world
  • Digital: Information converted for storage on a computer
  • Abstraction: Taking something complex and making a simpler version
  • Sampling: Collecting little pieces of information
  • Loss: Information that you lose from sampling

One more - Who is this?

Fidelity

How closely does the digital information match the analog information?

  • Low fideltiy (“lofi”) - the digital version does not match the analog version very well
  • High fidelity (“hifi”) - the digital version does match the analog version well

Images: Levels of abstraction

  1. Divide an image into pixels
  2. Convert each pixel into a single color
  3. Map each color to the closest available color
  4. Convert the color to binary

Practice - Code.org Pixelation Tool

  • Start with B&W

Each pixel is actually 3 lights

Primary colors

Practice - with colors

  • Can you recreate this, using 3 bits per pixel?

Recap Unit 1, Day 5

This is a recap slide

  • asdf