Lab#3
Lab # 3 Overview
Learn How Negative Numbers are Represented in Computers
Sign-Magnitude and Two’s Complement Representations
Learn How Colors and Text are Represented in Computers
Lab #3 Due Date - September 28, 2018 11:55 PM
CS 1150 - Lab 2 - Exploring Number Systems
1
How to Submit Lab # 3
Soft copy
Go to Pilot Course Page and Use the Dropbox Submission Link to upload your files
CS 1150 - Lab 2 - Exploring Number Systems
2
Sign-Magnitude Representation
CS 1150 - Lab 2 - Exploring Number Systems
3
Sign-Magnitude Representation
Sign – Ordering of the number (Positive or Negative)
Value – Magnitude
Source – CS 1150 Slides for Data Representation by Karen Mayer
Two’s Complement
CS 1150 - Lab 2 - Exploring Number Systems
4
MSB Represents the Sign
Negative – MSB is 1
Convert numbers to Two’s Complement
Invert the bits and add 1
Source – CS 1150 Slides for Data Representation by Karen Mayer
Lab #3 – Exercise 1
CS 1150 - Lab 2 - Exploring Number Systems
5
Run Negative Binary Numbers Applet
Representing Text
CS 1150 - Lab 2 - Exploring Number Systems
6
ASCII Character Set
7 bits to represent a character + 1 check bit
First 32 ASCII characters are special purposes – Eg Tab, Return
Unicode Character Set
16 bits to represent a character
Can represent every character in every language in the world
8 Bits = 1 Byte
Lab #3 – Exercise 2
CS 1150 - Lab 2 - Exploring Number Systems
7
Run Character Codes Applet
Lab #3 – Exercise 3
CS 1150 - Lab 2 - Exploring Number Systems
8
Run Text Encoding in ASCII Applet
Lab #3 – Exercise 4
CS 1150 - Lab 2 - Exploring Number Systems
9
Run Color Maker Applet