Binary CSCE 101.

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

The Binary Numbering Systems
Connecting with Computer Science, 2e
Image Representation CS105. Data Representation Text representation – ASCII character set – Unicode – Data compression Images!
Computer Arithmetic: Binary, Octal and Hexadecimal Presented by Frank H. Osborne, Ph. D. © 2005 ID 2950 Technology and the Young Child.
Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
Data storage Charles McAnany. What are the ones and zeroes? Hard drive Computer "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
© Maths Support Service 2007 Binary and Hexadecimal Numbers Next Slide AE98FD AE98FD.
Primaries: magenta, yellow, and cyan This color system is called subtractive because: each primary color absorbs (subtracts) a certain part of the color.
Real Numbers and the Decimal Number System
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Lecture 5.
Faculty of Sciences and Social Sciences HOPE Website Development Graphics Stewart Blakeway FML 213
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
THE COLORS OF LIGHT RED, GREEN and BLUE
Image Storage Bitmapped Graphics – in which an image is represented as a collection of dots Vector Graphics – in which an image is represented as a set.
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Data Representation Int 2 Computing Unit 1 – Computer Systems St Kentigern’s Academy.
Data Representation CS280 – 09/13/05. Binary (from a Hacker’s dictionary) A base-2 numbering system with only two digits, 0 and 1, which is perfectly.
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
 Komodo Edit Project › Helping you find your folder  Laptop › Delete what you don’t need › Keep class “doodles” in a single “sandbox” folder  Isis.
Image Representation. Objectives  Bitmaps: resolution, colour depth and simple bitmap file calculations.  Vector graphics: drawing list – objects and.
1 Ethics of Computing MONT 113G, Spring 2012 Session 10 HTML Tables Graphics on the Web.
Agenda Last class: Memory, Digitizing Numbers Today: Digitizing: Text
Computer Images Can store color info about each pixel, but makes file BIG Compression for Web 15.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
44212: Web-site Development Optimising Images for Web-pages Ian Perry Room:C49 Extension:7287
Marr CollegeHigher ComputingSlide 1 Higher Computing: COMPUTER SYSTEMS Part 1: Data Representation – 6 hours.
Unit 1: Task 1 By Abbie Llewellyn. Vector Graphic Software (Corel Draw) Computer graphics can be classified into two different categories: raster graphics.
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Digital Images are represented by manipulating this…
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
Resolution The resolution of an image is determined by the number of individually addressable points that make up the image, whether it is the number.
HNC COMPUTING - COMPUTER PLATFORMS 1 Micro Teach Binary.
Hexadecimal (base 16) BY MAT D. What is hexadecimal  Hexadecimal is a number system like binary or denary that has 16 characters, the numbers 0-9 and.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
What do you think this lesson is all about? Write your answer on a sticky note.
UNITS OF MEASUREMENT 2.01 Understand Digital Raster Graphics.
Some basic concepts underlying computer archi­tecture
Binary and Decimal Numbers
Storing Graphics Nat 5 Data Representation Lesson 4a: Storing Graphics
DIGITAL MEDIA FOUNDATIONS
Data Representation.
Lec 3: Data Representation
Computer Systems Nat 4/5 Data Representation Lesson 4:
Vocabulary byte - The technical term for 8 bits of data.
Computer Science Higher
Image Formats.
How to Convert Pictures into Numbers
Computer Graphics Different Images File.
Reading Netpbm Images.
Intermediate 2 Computing
Simple Data Compression
GRAPHICS Source:
Colors.
Data Representation.
Representing Images 2.6 – Data Representation.
Ch2: Data Representation
Numbering System TODAY AND TOMORROW 11th Edition
Introduction to Binary
Fundamentals of Data Representation
How Computers Store Data
Color and Images.
Multimedia System Image
Abstraction – Number Systems and Data Representation
Computer Systems Nat 4/5 Data Representation Lesson 4:
Binary, Hexadecimal, and Base 10.
Presentation transcript:

Binary CSCE 101

How is Information Stored Information is stored in the computer as binary numbers (0’s and 1’s). Even images are stored in this way, where a combination of 0’s and 1’s represent each color in the picture Each binary number is a switch where 0 is off and 1 is on How to read/write binary: http://www.youtube.com/watch?v=0qjEkh3P9RE

Base 10 The system we generally talk about numbers is in a 10 based system, also called decimal In 10 based system we talk about how many 1’s we have, how many 10’s, how many 100’s etc For example the following number 4567 is 7 ones 6 tens 5 hundreds 4 thousands

Base 10 Each of the categories, ones, tens, hundreds, thousands, … are different powers of 10 103 = 1000 102 = 100 101 = 10 100 = 1 4 5 6 7

Binary (Base 2) Now the categories we use to represent a number are powers of 2 26 = 64 25 = 32 24 = 16 23 = 8 22 = 4 21 = 2 20 = 1

Binary (Base 2) What is the number 1101 in the two based system? First we put the number in the chart, aligning it to the right 1 26 64 25 32 24 16 23 8 22 4 21 2 20 1 Then we add up the numbers 1 (8), 1 (4) and 1 (1) which means the number is 8+4+1 = 13

Practice Convert the binary number to decimal Answer 110110 26 64 25 32 24 16 23 8 22 4 21 2 20 1 1 Answer 110110 = 32 + 16 + 4 + 2 = 54

Practice Convert the binary number to decimal Answer 000111 26 64 25 32 24 16 23 8 22 4 21 2 20 1 1 Answer 000111 = 4 + 2 + 1 = 7

Practice Convert the binary number to decimal Answer 0100011 26 64 25 32 24 16 23 8 22 4 21 2 20 1 1 Answer 0100011 = 32 + 2 + 1= 35

Writing numbers in binary You follow the same process as when you write a number in decimal format. First find the highest power of two that goes into the number Subtract that amount from the number, Put a 1 in that spot and repeat

Example (37) Write 37 in binary First we see that the largest power of 2 that goes into the number is 25 or 32 so we put a 1 in that spot 26 64 25 32 24 16 23 8 22 4 21 2 20 1 1 37 – 32 =5 Now we need to add 5 to this number

Example (37) Now we need to add 5 to our number We see that the largest power of 2 that goes into the number is 22 or 4 so we put a 1 in that spot 26 64 25 32 24 16 23 8 22 4 21 2 20 1 1 5 – 4 =1 Now we need to add 1 to this number

Example (37) Now we need to add 1 to our number We see that the largest power of 2 that goes into the number is 20 or 1 so we put a 1 in that spot 1 1 26 64 25 32 24 16 23 8 22 4 21 2 20 1 We then put zeros everywhere else

Example (37) And we now have represented 37 in binary 100101 26 64 25 32 24 16 23 8 22 4 21 2 20 1 We can add as many 0’s to the left of the numbers as we like and it stays the same. So this number is the same as 000100101

Practice Now write the following numbers in binary 9 17 63 Answers 26 64 25 32 24 16 23 8 22 4 21 2 20 1 Now write the following numbers in binary 9 17 63 Answers 9 = 1001 17 = 010001 63 = 111111

Hexadecimal (Base 16) Now the categories we use to represent a number are powers of 16 Since, our numbers go higher then 10 we need more characters. Our numbers are now… 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15

Hexadecimal (Base 16) Now the categories we use to represent a number are powers of 16 165 = 32 1048576 164 = 65536 163 = 4096 162 = 256 161 = 16 160 = 1

Hexadecimal (Base 16) What is the number 123 in the 16 based system? First we put the number in the chart, aligning it to the right 165 = 32 1048576 164 = 65536 163 = 4096 162 = 256 161 = 16 160 = 1 1 2 3 Then we add up the numbers 1 (256), 2 (16) and 3 (1) which means the number is 256+32+3 = 291

Hexadecimal (Base 16) Let’s try ABC in the 16 based system? First we put the number in the chart, aligning it to the right 165 = 32 1048576 164 = 65536 163 = 4096 162 = 256 161 = 16 160 = 1 A B C Then we add up the numbers 10 (256), 11 (16) and 12 (1) which means the number is 2560+176+12 = 2748

Hexadecimal (Base 16) Let’s try taking a decimal number and converting it to Hexadecimal. Let’s convert the number 3000. We do this by repeatedly dividing by 16, the remainder goes on the farthest right column. 3000/16 = 187 R 8 (Put 8 in farthest right) 187/16 =11 R 11 (But B in next right) 11/16 = 0 R 11 (Put B in next right) 165 = 32 1048576 164 = 65536 163 = 4096 162 = 256 161 = 16 160 = 1 B 8

ASCII Stands for American Standard Code for Information Interchange The way we represent English characters as numbers (binary) Each letter is assigned a number form 0 to 1 A = 01000001 B = 01000010 C = 01000011 …

Text Compression Can take body of text and make it smaller Makes it more feasible for you to send these files Will find simplify repeated patterns so they take up less space. the rain in Spain falls mainly on the plain. becomes ? r! in Sp! falls m!ly on ? pl!. ! = ain ? = the

Color Colors are made up of a certain percent of: Red, Green, and Blue. e.g. We use binary numbers to represent different colors Red Green Blue Color Black 255 White Yellow 130 Pink

Images Each pixel of color in an image is represented by a binary number The more pixels in an image the less pixelated the image looks, the higher the resolution, and the more space it takes up (The extra pixel data needs to be stored)

Image Compression In a vector image there is a lot of repeated color. Hence the compression can be very effective, and you can use lossless compression.

JPG JPG Images is a compressed file format , making it take up less space on your website and become faster to load The compression is lossy. This means that some of the image data is actually lost; however, the change in quality is said to be invisible to the human eye. JPG compression works well for pictures JPG does not work well for lettering or simple images of few colors.

GIF GIF uses a losless compression. Only supports 256 colors GIF is better than JPG for images that have few colors. Simple images. Images like sunsets have tons of colors, even though they are close in shade and should use JPG rather than GIF.

PNG An improvement on GIF Can be compressed slightly more, and supports more transparency.