Text and Graphics September 26, Unit 3.

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

Number Systems and Codes
Information Representation
1 Chapter 2 The Digital World. 2 Digital Data Representation.
Processing Data.
Binary and Hexadecimal Numbers
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
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
 Method of representing or encoding numbers  Two main notation types  Sign-value  Roman numerals  Positional (place-value)  Modern decimal notation.
Representing Information in Binary (Continued)
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
Higher Computing Data Representation.
Bits & Bytes: How Computers Represent Data
Data and Program Representation
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
MAC OS – Unit A Page: 10-11, Investigating Data Processing Understanding Memory.
IT253: Computer Organization
Data Representation Int 2 Computing Unit 1 – Computer Systems St Kentigern’s Academy.
Chapter 2 Computer Hardware
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.
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.
Fill in the blanks: (1) _________ has only two possible values 0 and 1. (2) There are __________bits in a byte. (3) 1 kilobyte of memory space can store.
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
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.
What is a computer? A computer is a device that:
The Hexadecimal Number System and Memory Addressing ISAT 121.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Bits and Bytes IGCSE. A binary number is either a 0 or a 1 and is known as a 'bit' or b inary dig it. However, the CPU cannot deal with just one bit at.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Data Files on Computers Text Files (ASCII) Files that can be created by typing on the keyboard while using a text editor such as notepad or TextEdit.
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 Conversion 24/04/2017.
Chapter Three The UNIX Editors.
Data Representation The storage of Text Numbers Graphics.
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.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
ASCII AND EBCDIC CODES By : madam aisha.
TOPICS:  Introduction  Place Value  Binary  Decimal conversion  Decimal  Binary conversion  Related terms  Quiz.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
What do you think this lesson is all about? Write your answer on a sticky note.
Number Systems Part 2. Counting in Binary DecimalBinary
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Binary, Decimal and Hexadecimal Numbers 1. Numbering Systems Radix - In mathematical numeral systems, the radix or base is the number of unique digits,
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.
© 2016 AQA. Created by Teachit for AQA Number bases and Units of information Lesson.
1.4 Representation of data in computer systems Character.
Binary & Hex Review.
Binary Representation in Text
Binary Representation in Text
Binary, Decimal and Hexadecimal Numbers
Data Representation.
Numerical Representation
Bits & Bytes How Computers Represent Data
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.
Lecture 3 ISE101: Computing Fundamentals
Ch2: Data Representation
(return of the…) Data blast
COMS 161 Introduction to Computing
Numerical Representation
Abstraction – Number Systems and Data Representation
Real-World File Structures
Binary & Hex Review.
UNIT – 3 & 4. Data Representation and Internal
Chapter 3 - Binary Numbering System
Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2
Presentation transcript:

Text and Graphics September 26, Unit 3

How Computers Store Data Computers store everything in bits In memory (RAM) Hard drive Data is a string of 1’s and 0’s 00101010111…. A bit is a 0 or 1 All data is stored as a string of bits Numbers Text Images Everything!

Numbers Numbers are the simplest things to store in bits Once we can store numbers, we can convert other types of data to numbers to store them Storing numbers requires us to convert them from base 10 to base 2 (binary) Just like the very brief example for converting RGB to hex values for color

Converting to Binary Binary has two digits: 0 and 1 Lets look at the number 72 in decimal (the normal way we count) 72 = ( 7 * 101) + (2 * 100) Just like elementary math: 1’s, 10’s, 100’s,1000’s, etc. for each column Or, 100, 101, 102, 103,

Bases All bases work exactly the same way The available digits are going to be 1 less than the base Base 10 : 0-9 Base 2 (binary): 0,1 Base 5: 0-4 Base 16 (hexadecimal, or just hex): 0-F (0-15)

Bases Continued Take the number 1293110 That is: 1 2 9 3 104 103 102 Subscript indicates base That is: 1 2 9 3 104 103 102 101 100 Digit Value for that column

An Arbitrary Base Each value of each column is that base, say k, raised to the appropriate power This value gets multiplied by the digit in that column k4 104 k3 103 k2 102 k1 101 k0 100

Binary (base 2) Easiest (besides base 10) Easy because its determining the value for the column is simple (multiply the last column by 2) 128 64 32 16 8 4 2 1 27 26 25 24 23 22 21 20

Converting to Binary (or any base), and Back In class example For binary and any base

Bytes A bit is a single digit 0 or 1 Bits usually get arranged into bytes 8 bits = 1 byte 1 byte can represent 256 numbers How? Number 111111112 = (128+64+32+16+4+2+1) = 255 1 byte can represent from 0-255, or 256 numbers 1 128 64 32 16 8 4 2 27 26 25 24 23 22 21 20

Max Value of a Group of Bits For any group of n bits, you can have 2n values These values will always range from 0 to 2n – 1 Some standard groups are: 8: a byte, 0 to 255 16: 0 to 65535 32: 0 to 4294967295

Storage Pretty awkward if we had to say how many bits of storage our computers had We use prefixes to simplify this See figure 3.1 in your course pack We commonly refer to bytes, not bits. Bytes are too small Most common: Kilo-: 210 ≈ 103 Mega-: 220 ≈ 106 Giga-: 230 ≈ 109 Tera-: 240 ≈ 1012

We still don’t Measure Exactly 1 kB (1 kilobyte) is 1024 bytes Kilo in metric though is 1000 1kB is not 1000 bytes But, its roughly 1000 bytes Same goes for measuring hard drive storage We use GB or gigabytes mostly But a 60GB hard drive is really 55.88 GB

Text We store text by converting it to a string of bits Takes two steps: 1. Convert the text to numbers 2. Convert numbers to bits Many different ways to translate between text and numbers A translation is called a character set

ASCII ASCII is the most common translation from text to numbers American Standard Code for Information Interchange Each character has a numeric value A: 65 a: 97 ; (semi-colon) : 59

ASCII, cont. ASCII defines 127 different characters Every PC uses ASCII There are even variants for different regions Also there are extensions for up to 255 characters Allows for things like accents 255 is the maximum number of characters which can be defined if we are limited to 1 byte per character 2n – 1

Unicode Unicode is like ASCII but supports a LOT more characters 232 characters to be precise Goal is to have a character set which can be used for any language Support for Chinese, Japanese, Greek Lots of special symbols Current Unicode standard defines 95221 characters

Unicode in XHTML You can add Unicode characters to your html For instance the x or times symbol is the Unicode character 215 You add the symbol as an entity &#”Unicode character”; Or × Any Unicode symbol can be added this way

Text Files Word processors and text editors are different You’ve been using a text editor to write your html (I hope) Text editors store the files as pure characters There is no formatting

Text Editors When a text editor saves a file, it saves it one byte, or one character, at a time. When it reads a text file, it does the reverse Reads one byte at a time and converts that to a character Text editors can open a lot of different types of files because its dealing with just the bytes for that file If you open a non-text file, you will get very odd characters or those empty boxes when it can’t translate If you open a file from say MS Word, it won’t be readable in notepad

Word Processors Word processors, like MS Word, are different than text editors in that they contain formatting information They have to store the formatting information along with the text Each word processor does this differently Which is why its often difficult to open files created with another program May sort of work, but be just a bit off

Benefit of Text Editors Because they only store characters, you can open, view, and edit them with any text editor Text files refers to files created with a text editor Html CSS Python .txt , plain text file

Fonts Each character is stored numerically Computer still needs to know how to display it on the screen What the character “looks” like Each character can be drawn in many different ways “Font (or Typeface) is a collection of drawings, one for each character”

Glyphs The drawing for a character is called a glyph It is a picture of that character A font is then a collection of glyphs Think of all the fonts you have on your computer Would you want to store the glyphs for all 95000 characters for every font? If the font you’re using does not have a glyph for the Unicode character you want, your computer will try to substitute for it

Questions?