1 CS120: Lecture 2 MP Johnson Hunter College

Slides:



Advertisements
Similar presentations
Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte.
Advertisements

The Binary Numbering Systems
ENGR2216 FORTRAN PROGRAMMING FOR ENGINEERS. Chapter 1 The computer CPU MEMORY INPUT/OUTPUT DEVICES DATA REPRESENTATION BINARY SYSTEM OCTAL & HEXADECIMAL.
Chapter 5 Computing Components. The (META) BIG IDEA Cool, idea but maybe too big DATA – Must be stored somewhere in a storage device PROCESSING – Data.
Information Technology Foundation Dr. Robert Chi Chair and Professor, IS department Chief editor, Journal of Electronic Commerce Research.
Chapter 1: Data Storage.
Storage of Bits Computers represent information as patterns of bits
1 CS120: Lecture 4 MP Johnson Hunter College
Chapter 1 Data Storage. 2 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns.
Chapter 3 – Computer Hardware Computer Components – Hardware (cont.) Lecture 3.
Bits and Data Storage. Basic Hardware Units of a Computer.
Comp 1001: IT & Architecture - Joe Carthy 1 Information Representation: Summary All Information is stored and transmitted in digital form in a computer.
1 Part I: Machine Architecture 4 A major process in the development of a science is the construction of theories that are confirmed or rejected by experimentation.
Understanding Computer Basics. Computer Case- The part of a computer system that houses the microprocessor, the RAM (Random Access Memory), and the Motherboard.
Working with text ASCII and UNICODE.   
Chapter 1 Data Storage(2) Yonsei University 1 st Semester, 2014 Sanghyun Park.
HARDWARE: CPU & STORAGE How to Buy a Multimedia Computer System.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Adding some light to computing ….
CS 111 – Aug – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp , In other.
Data Representation Int 2 Computing Unit 1 – Computer Systems St Kentigern’s Academy.
Pengantar Teknologi Informasi dan Ilmu Komputer Information Technology and Data Representation PTIIK- UB.
Why does it matter how data is stored on a computer? Example: Perform each of the following calculations in your head. a = 4/3 b = a – 1 c = 3*b e = 1.
1 i206: Lecture 2: Computer Architecture, Binary Encodings, and Data Representation Marti Hearst Spring 2012.
Chapter 1: Data Storage.
CS 111 – Sept. 10 Quiz Data compression –text –images –sounds Commitment: –Please read rest of chapter 1. –Department picnic next Wednesday.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
CS41B MACHINE David Kauchak CS 52 – Fall Admin  Assignment 3  due Monday at 11:59pm  one small error in 5b (fast division) that’s been fixed.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
Quiz # 1 Chapters 1,2, & 3.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Copyright © 2015 Pearson Education, Inc. Chapter 1: Data Storage.
Lecture 10: Binary Representation Intro to IT COSC1078 Introduction to Information Technology Lecture 10 Binary Representation James Harland
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
How Computers Work. All Computers process data process data 1-- Input dataInput data 2--Store data while being processedStore data while being processed.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Sequential Circuit Design By : Pn Siti Nor Diana Ismail CHAPTER 6.
CS 125 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk drive Software.
Memory The term memory is referred to computer’s main memory, or RAM (Random Access Memory). RAM is the location where data and programs are stored (temporarily),
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Computer Basics Just How Does a Computer Work?
Digital logic COMP214  Lecture 1 Dr. Sarah M.Eljack Chapter 1 1.
Computer Graphics HARDWARE. Computers  Computers are automatic, electronic machines that –accept data & instructions from a user (INPUT) –store the data.
Chapter 1: Data Storage.
Binary and Hard Disk PEOPLE Program
Computer Science: An Overview Eleventh Edition
Basic Computer Hardware and Software.
Data Representation.
Introduction to Computer Architecture
David Kauchak CS 52 – Spring 2016
Introduction to Computers
COMPUTER MEMORY & DATA STORAGE
Introduction to Computers
Basic Computer Hardware and Software.
COMPUTER MEMORY & DATA STORAGE
Chapter 1 Data Storage.
Introduction to Computers
Number Systems Lecture 2.
Storage.
Presentation transcript:

1 CS120: Lecture 2 MP Johnson Hunter College

2 Agenda: data Review ops/gates Abstract storage: flipflops Storage methods representation: –Test –Images –Sound –Numbers Positive Negative Fractions Compression

3 Circuits as memory Flipflop: special circuit that can store data –1 bit per FF To store, send pulse in top or bottom (0 is ddf) Go through

4 Another FF Go through

5 circuits Q: where do inputs come from? A: other circuits! Connect worker circuit to mem circuit This kind of mem is in RAM or maybe CPU –Fast: measured in ns –Fast everywhere – “random” –But Requires constant power

6 Memory cells arranged by address

7 Metric units “Kilo-” normally means 1,000; Kilobyte = 210 = 1024 “Mega-” normally means 1,000,000; Megabyte = 220 = 1,048,576 “Giga-” normally means 1,000,000,000; Megabyte = 230 = 1,073,741,824

8 Hard drive: Disk spins, head moves –Partly mechanical! –Usually larger, but slower Measured in ms Time depends somewhat on location Other (perm) kinds of mem

9 Optical: CD/DVD –Slower, less random –Read-only/read-once Flash: USB, MP3 Tape: very slow, sequential

10 Storage devices Hardware varies a lot Q: what stays the same? A: all store bits / 1-of-2 choices Q: why not base 3 or base 10? A: easier! High (voltage) v. low or pos v neg or 0 v 1 High v. low v. medium Q: why do we ever use base 10?

11 Claim: data = nums = bits Eg, letters: can’t write ‘A’ on a HD Q: what to do? A: pick some num to rep ‘A’ –Turns out: ‘A’ = 65, ‘B’ = 66 –ANSI’s ASCII Q: but how to rep 65? –Can’t write num 65 on a HD A: write 65 in binary

12 base mathematically, any base will do On machine, must use base 2: –65 = 6*10 + 5*1 = 1*64 + 1*1 = 1*2^5 + 1*2^0 = b  = =

13 ANSI ANSI only uses 7 bits (128 vals) Insert a 1 at front to get 8 bits = 1 byte (255) Usually: think in terms of bytes, not bits Q: what about negatives, fractions? A: next time…

14 hex Sometimes base-16 is used for as shorthand –1 base-16 val = 4 bits Also octal

15 Rep’ing images? One way: –Bitmaps (.bmp) –b/w: 2-d table of brightness values Pixel = picture element –Col: one table each of r/g/b –Size: 1000*1000*3 = 3MB! Another: –Vector methods…

16 Rep’ing sounds? One way: –Sample soundwave ampl at intervals –Phones: 8000/s –CD: 44,1000/s Another: –MIDI –For 10s constant tone, record tone + length

17 Data compression NB: vectors and MIDI sound smarter But whatever you do, must still be stored as bits Must find a way to encode these instructions as bits Harder than storing directly!

18 Base 2 v. base 10

19 Convert base10  base2 Alg: while x is not 0 –Write x%2 to right –Set x = x/2

20 Integers with bits Unsigned (non-neg): just base2 Signed: 0.Just use sign bit How to add/sub? 1.1’s comp –How to add/sub? –Two 0’s 2.2’s comp –How to add/sub? –See app. B for neg, add circuits 3.Also: excess notation (skip?)

21 Fractions in binary (naïve)

22 IEEE floating-pt standard

23 IEEE floats Used for all fractions in C/C++/Java Strength: very large range (billions) Weakness: merely approximate –Can depend on order!

24 Compression Saw MIDI for sound Saw vectors for images Other methods: –Relative methods for images (why works?) GIF, JPEG –Relative methods for video (why works?) MPEG –Run-length encoding –Frequency-based (why works?) –LZ (zip files)

25 Recognizing errors Idea: include extra info Parity bits:

26 Correcting errors “Error-correcting codes” If only one bad bit, can recover,e.g.,

27 Future No class Tuesday Reading for Wednesday is on website Hw posted soon ( /web)