Presentation is loading. Please wait.

Presentation is loading. Please wait.

Plan Attendance Files Posted on Campus Cruiser Homework Reminder

Similar presentations


Presentation on theme: "Plan Attendance Files Posted on Campus Cruiser Homework Reminder"— Presentation transcript:

1 Plan Attendance Files Posted on Campus Cruiser Homework Reminder
Chapter 1: Review Questions (Preparation for mini-quiz on Friday): pp Exercises: (Preparation for mini-quiz on Friday): # 3, 4, 5, 6 Binary System History of Python Versions of Python

2 How Computers Store Data
All data in a computer is stored in sequences of 0s and 1s Byte: just enough memory to store letter or small number Divided into eight bits Bit: electrical component that can hold positive or negative charge, like on/off switch The on/off pattern of bits in a byte represents data stored in the byte

3

4

5 Storing Numbers Bit represents two values, 0 and 1
Computers use binary numbering system Position of digit j is assigned the value 2j-1 To determine value of binary number sum position values of the 1s Byte size limits are 0 and 255 0 = all bits off; 255 = all bits on To store larger number, use several bytes

6

7 How to Convert Decimal to Binary
Convert 37 to binary 128 doesn’t fit into 37 b7=0 64 doesn’t fit into 37 b6=0 32 fits into 37 b5=1 37 – 32 = 5, continue the process with 5 16 doesn’t fit into 5 b4=0 8 doesn’t fit into 5 b3=0 4 does fit into 5 b2=1

8 Convert 37 to Binary 128 64 32 16 8 4 2 1 128 doesn’t fit into 37 b7=0
128 doesn’t fit into b7=0 64 doesn’t fit into b6=0 32 fits into b5=1 Subtract: 37 – 32 = 5 Continue the process with 5 16 doesn’t fit into b4=0 8 doesn’t fit into b3=0 4 does fit into b2=1 Subtract: = 1 Continue the process with 1 2 doesn’t fit into b1=0 1 fits into b0=1

9 Convert 37 to Binary - Second Method
Divide by 2 and store the remainder 37/2= b0=1 18/2 = b1=0 9/2= b2=1 4/2= b3=0 2/2= b4=0 1/2= b5=1 Write remainders from bottom up and pad with leading 0’s to fill all 8 bits

10 Convert 259 to binary 259/2 = 129 b0=1 129/2 = 64 b1=1 64/2 = 32 b2=0
2 bytes are needed to store this number

11

12 Storing Characters Data stored in computer must be stored as binary number Characters are converted to numeric code, numeric code stored in memory Most important coding scheme is ASCII ASCII is limited: defines codes for only 128 characters Unicode coding scheme becoming standard Compatible with ASCII Can represent characters for other languages

13

14 Advanced Number Storage
To store negative numbers and real numbers, computers use binary numbering and encoding schemes Negative numbers encoded using two’s complement Real numbers encoded using floating-point notation

15 Other Types of Data Digital: describes any device that stores data as binary numbers Digital images are composed of pixels To store images, each pixel is converted to a binary number representing the pixel’s color Digital music is composed of sections called samples To store music, each sample is converted to a binary number


Download ppt "Plan Attendance Files Posted on Campus Cruiser Homework Reminder"

Similar presentations


Ads by Google