Download presentation
Presentation is loading. Please wait.
1
Lesson 1-10 AP Computer Science Principles
Encoding Text Lesson 1-10 AP Computer Science Principles
2
Objectives Students will be able to:
Create a protocol for sending messages of text and use it to send messages with the Internet Simulator. Explain the need for a ‘unified’ protocol for text- based communication between machines Explore abstractions that allow them to focus on new higher-level problems
3
Journal One of the most powerful uses of the internet is sending text to people. Since the internet can only send bits around we need a way to encode text with bits… If it were up to you, how would you encode text in binary? Quickly, jot down an idea for encoding text.
4
ASCII You just invented your own scheme for encoding text with numbers. There is a standard encoding for most of the symbols you can type on an American keyboard. That encoding is called the American Standard Code for Information Interchange or ASCII (“Ask-ee”).
5
ASCII Facts ASCII codes were originally 7 bits long and so there are 128 possible values 0-31 are “control characters” that largely defunct and go unused, they used to be used to control various aspects of machines and printers. are printable characters and include the numbers 0-9, all 26 letters both lowercase and uppercase, and many common punctuation symbols. 127 is the symbol for delete Over time 8-bits became a standard “chunk-size” for encoding information. ASCII made the transition to this 8-bit encoding by just adding an extra 0 to the front of the old 7-bit codes.
6
Journal In your journals write your full name in ASCII
Mr. Schmidt =
7
ASCII Mr. Schmidt =
8
What about Formatted Text?
Having a standardized protocol like ASCII to encode text enables us to send and receive textual information. This is very useful, but there are still instances when we will want even greater expressive power in our digital communications.
9
What about Formatted Text?
“What if you wanted to send formatted text that included things like the ability to underline, bold, or italicize words....specify a different font size, or color?” Things like:
10
Sending Formatted Text
Download the activity guide for today Develop a protocol for encoding formatting information alongside regular text. Both the text and the formatting instructions must be derived from the printable ASCII character set (i.e. codes ). You protocol must encode at least: bold, italics, and underlining three different font sizes (large, medium, and small) three different font colors (red, black, blue)
11
Develop Your Protocol Write it down! All members of your team must be able to use the protocol. I will split your group up and give you a message to send. The other person must correctly decode the message.
12
Stage 7 Complete Stage 7
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.