Week 3 - Monday CS 113.

Slides:



Advertisements
Similar presentations
Introduction to Computers Part II
Advertisements

Chapter 4: Representation of data in computer systems
Week 2: Primitive Data Types 1.  Programming in Java  Everything goes inside a class  The main() method is the starting point for executing instructions.
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
Binary number, Bits and Bytes and memory Sen Zhang.
Connecting with Computer Science, 2e
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
Binary and Decimal Numbers
Computer Systems 1 Fundamentals of Computing
Binary “There are 10 types of people in the world… those that understand binary and those that don’t.”
Digital Data Patrice Koehl Computer Science UC Davis.
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
Week 2 - Monday.  What did we talk about last time?  Software development  Lab 1.
Chapter 2 Computer Hardware
Data Representation A series of eight bits is called a byte. A byte can be used to represent a number or a character. As you’ll see in the following table,
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
What do computers know?  All they really know is on or off.  Kind of like a light switch  Computers aren’t nearly as smart as you are!
Bits & Bytes Created by Chris McAbee For AAMU AGB199 Extra Credit Created from information copied and pasted from
First Program.  The type of all data used in a C program must be specified  A data type is a description of the data being represented ▪ That is, a.
Explosion of Bits Everything is digitized – can store every communication generated by humans Government and other institutions of society are deciding.
1 3 Computing System Fundamentals 3.2 Computer Architecture.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
Data Representation The storage of Text Numbers Graphics.
2.1.4 Data Representation Units.
Know what a computer is used for Understand the difference between hardware and software Be able to describe the way that data is stored in a computer.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Binary Numbers. Base 10 and Base 2  We normally work with numbers in base 10.  In base 10 we use the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.  Everything.
CC111 Lec#2 The System Unit The System Unit: Processing and Memory Lecture 2 Binary System.
Unit 1 Digital Data Section D. Chapter 1, Slide 2Starting Out with Visual Basic 3 rd EditionIntroduction to ComputersUnit 1D – Digital DataSlide 2 Wikipedia.
Information Technology (IT). Information Technology – technology used to create, store, exchange, and use information in its various forms (business data,
Numerical Representation Intro to Computer Science CS1510 Dr. Sarah Diesburg 1.
© OCR 2016 Unit 2.6 Data Representation Lesson 1 ‒ Numbers.
Week 3 - Monday.  What did we talk about last time?  Video games  Lab 2.
Understanding binary Understanding Computers.
Week 2 - Wednesday CS 121.
Data Representation.
Week 3 - Wednesday CS 113.
INFS 211: Introduction to Information Technology
Data Representation N4/N5.
3.1 Denary, Binary and Hexadecimal Number Systems
CMSC201 Computer Science I for Majors Lecture 22 – Binary (and More)
Lesson Objectives Aims
Numerical Representation
Memory Parts of a computer
Introduction to Computers
Information Support and Services
What is Binary? Binary is a two-digit (Base-2) numerical system, which computers use to process and store data. The reason computers use the binary system.
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
The Binary Number System
3 - STORAGE: DATA CAPACITY CALCULATIONS
Tools of Web Development 1: Module A: Numbering Systems
Unit 3—Part A Computer Memory
Data Representation Numbers
Each column represents another power of the base
Representation of Data in Computer Systems
How do computers work? Storage.
Numerical Representation
Unit 3—Part A Computer Memory
(return of the…) Data blast
Numerical Representation
Chapter Four Data Representation in Computers By Bezawit E.
Binary System.
LO1 – Understand Computer Hardware
Technology 3 Bits & Bytes.
UNIT – 3 & 4. Data Representation and Internal
Explosion of Bits Everything is digitized – can store every communication generated by humans Government and other institutions of society are deciding.
Week 1 - Friday COMP 1600.
Numerical Representation
Presentation transcript:

Week 3 - Monday CS 113

Last time What did we talk about last time? Video games Lab 2

Project 1

Questions?

Lessons from Blown to Bits Chapter 1

Tanya Rider What is Tanya Rider's story? How did bits (digital information) save her life? Why wasn't she saved earlier? Should she have been saved earlier?

What's a koan? Rhymes with "go on" A koan is a puzzling or paradoxical statement If you think about it literally, you'll get nowhere, but if you think about it in just the right way… Insight! They are associated with the Zen school of Buddhism

Ganto's ax One day Tokusan told his student Ganto, "I have two monks who have been here for many years. Go and examine them." Ganto picked up an ax and went to the hut where the two monks were meditating. He raised the ax, saying, "If you say a word I will cut off your heads; and if you do not say a word, I will also cut off your heads." Both monks continued their meditation as if he had not spoken. Ganto dropped the ax and said, "You are true Zen students." He returned to Tokusan and related the incident. "I see your side well," Tokusan agreed, "but tell me, how is their side?" "Tozan may admit them," replied Ganto, "but they should not be admitted under Tokusan."

Koans of Bits It's all just bits Perfection is normal There is want in the midst of plenty Processing is power More of the same can be a whole new thing Nothing goes away Bits move faster than thought

Bits and Bytes

Memory Storage for all the data and instructions on your computer Modern computers store everything as binary digits (bits) which have a value of 0 or 1. 1 byte = 8 bits 1 kilobyte (kb) = 210 bytes 1 megabyte (mb) = 220 bytes 1 gigabyte (gb) = 230 bytes 1 terabyte (tb) = 240 bytes

Making sense of memory Memory What Can be Stored 1 byte One character, like Q 4 gigabytes A regular movie on DVD 1 kilobyte A poem 8 gigabytes An action movie on DVD 100 kilobytes A short story 50 gigabytes A movie on Blu-Ray A low resolution photo 1 terabyte Two years of MP3 music 1 megabyte A novel 350,000 copies of War and Peace A medium resolution photo 250 DVD quality movies A minute of MP3 music 85,000 high resolution photos 1 gigabyte Two CD quality albums 24 albums of MP3 music

Data Representation

Data What if you want to write a program that can… Edit music files Stream video from the Internet Organize your photo album Each of these tasks manipulates a lot of data MP3’s, streaming video, and jpegs are complicated kinds of data These kinds of data out of much simpler building blocks We'll start with representing numbers

Binary Hardware You have heard people (me, probably) talking about all the 1’s and 0’s inside of a computer What does that all really mean? Using semiconductor physics, we can make a tiny little piece of a microchip be in one of two states, say, OFF and ON, like a switch If we say that OFF is 0 and ON is 1, then, by using a lot of these switches, we can represent a lot of 1’s and 0’s

Binary Representation What do we do with those 1’s and 0’s? To begin with, we represent numbers How many of you have heard of base 10? How many of you have heard of base 2? What’s the definition of a number system with a given base?

Numbers vs. numerals A number is a concept Three hedgehogs, three complaints, and three notes of music all share threeness No matter how you represent a number, the number is the same The name for a number is called a numeral The following represent the concept of three: 3 III 112

Base 10 (decimal) numbers Our normal number system is base 10 This means that our digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 Base 10 means that you need 2 digits to represent ten, namely 1 and 0 Each place in the numeral as you move left corresponds to an increase by a factor of 10

3,482,931 Base 10 Example Ten thousands Hundreds Millions Ones Hundred Tens

Base 2 (binary) numbers The binary number system is base 2 This means that its digits are: 0 and 1 Base 2 means that you need 2 digits to represent two, namely 1 and 0 Each place in the numeral as you move left corresponds to an increase by a factor of 2 instead of 10

11111100001 Base 2 Example Sixty fours 256’s Sixteens Fours 1024’s Ones 512’s 128’s Thirty twos Eights Twos

So, what’s the value? 11111100001 = 1∙210 + 1∙29 + 1∙28 + 1∙27 + 1∙26 + + 1∙25 + 0∙24 + 0∙23 + 0∙22 + 0∙21 + 1∙20 = 1024 + 512 + 256 + 128 + 64 + 32 + 1 = 2017

Converting from base 2 to base 10 Each 1 in a base 2 numeral represents a power of 2 Add up all those values

Converting from base 10 to base 2 Find the largest power of 2 that is less than or equal to the number Subtract that power of 2 from the number Repeat the process until you have zero Every time you used a power of 2, write a 1 in the representation of the number in base 2 Otherwise, write a 0

Bases Which base we use to represent numbers is arbitrary We use base 10 almost certainly because we have 10 fingers The Duodecimal Society thinks we should use base 12 Is there a base 1? When do we use it?

Base 16 In case you were wondering, there are bases bigger (sometimes much bigger) than 10 Computer scientists like base 16 (hexadecimal) because it is easy between base 2 and base 16, but base 16 takes less space to write The digits in base 16 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F 1A2 in base 16 is 418 in base 10 It is possible to write ridiculous numbers like DEADBEEF

What else? Using a series of 1s and 0s we can represent integers Representing fractional numbers is similar, but messier As you know, we can represent colors as three numbers: red, green, and blue values What about words?

ASCII Table Each character has a number associated with it These numbers can be listed in tables The ASCII table only covers 7 bits of information (0-127) Unicode is a standard that lets us represent characters from all the world's languages

Sounds You can think of sound as a wave On a computer, we cannot record a wave form directly As usual, we have to figure out a way to store a wave as a series of numbers We are going to use these numbers to approximate the heights of the wave at various points

Sample rate Recall that Hertz (Hz) is a unit that means a number of times per second Equivalent to Hz is s-1 We are going to break down the wave into lots of slices We are going to have 44,100 slices in a second Thus, we are slicing at 44,100 Hz

Sample values We slice up a wave and record the height of the wave Each height value is called a sample By getting 44,100 samples per second, we get a pretty accurate picture of the wave

Upcoming

Next time… We will talk about abstraction and variables Read Chapter 1 of Python Programming

Reminders Keep working on Project 1 Read Chapter 1 of Python Programming