©Brooks/Cole, 2003 Chapter 2 Data Representation.

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

Technology ICT Option: Data Representation. Data Representation In our everyday lives, we communicate with each other using analogue data. This data takes.
1 Chapter 2 The Digital World. 2 Digital Data Representation.
Connecting with Computer Science, 2e
Introduction to Programming with Java, for Beginners
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Fourth Edition.
March 2006Taner Erig - EMU2-1 Metamorphosis of Information How is information represented and how do computers store information?
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 12 Data.
COMPUTER FUNDAMENTALS David Samuel Bhatti
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Chapter 5 Data representation.
Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Lecture 5.
Bits & Bytes: How Computers Represent Data
Computer System Basics 1 Number Systems & Text Representation Computer Forensics BACS 371.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Representing Information Digitally. Digitization Initially transforming data for computer use Assigning people social security numbers The creation of.
Chapter 1 Data Storage(2) Yonsei University 1 st Semester, 2014 Sanghyun Park.
Representing Nonnumeric Data Everything is really a number.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
Chapter 2 Data and Number Representations
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
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.
Binary Arithmetic & Data representation
Data Representation.
1 Foundations of Computer Science Chapter 2 Data Representation.
HOW COMPUTERS MANIPULATE DATA Chapter 1 Coming up: Analog vs. Digital.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
What is a computer? A computer is a device that:
Logical Circuit Design Week 2,3: Fundamental Concepts in Computer Science, Binary Logic, Number Systems Mentor Hamiti, MSc Office: ,
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
Quiz # 1 Chapters 1,2, & 3.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
Chapter 2 Data Representation.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Data Representation, Number Systems and Base Conversions
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Agenda Character representation Numerical Conversions ASCII EBCDIC
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.
Characters and Strings
Data Representation. In our everyday lives, we communicate with each other using analogue data. This data takes the form of: Sound Images Letters Numbers.
DATA Unit 2 Topic 2. Different Types of Data ASCII code: ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
1 Section 1.3 Binary Number Systems Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Binary Representation in Text
Binary Representation in Text
Binary and Decimal Numbers
Chapter 8 & 11: Representing Information Digitally
Number Systems and Codes
Binary Notation and Intro to Computer Graphics
CHAPTER 1 : INTRODUCTION
Chapter 3 Data Storage.
Bits & Bytes How Computers Represent Data
Representing Nonnumeric Data
CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS
Ch2: Data Representation
Chapter 2 Data Representation.
How Computers Store Data
Data Representation Chapter 2 Computer HW (Von Neumann Model) Program
Learning Intention I will learn how computers store text.
Option: Data Representation
Option: Data Representation
Chapter 3 - Binary Numbering System
Presentation transcript:

©Brooks/Cole, 2003 Chapter 2 Data Representation

©Brooks/Cole, 2003 Figure 2-1 Different types of data Computer programs can have different purposes: -Word processing program handles TEXT (move, delete, just) -Engineering program deals with NUMBERS (arithmetic equations,..) -Image processing program manipulate images (create, shrink, rotate,..) -Video player shows movie and handles audio data ( play music, voice.)

©Brooks/Cole, 2003 Figure 2-2 Bit pattern -All data types are represented using universal format called bit pattern which is a sequence or string of bits -A Bit (binary digit) is the smallest unit of data that can be stored in a computer; it is either 0 or 1 -An electronic switch can represent a bit. -Example of a 16 bit pattern -Computer memory stores the data as bit pattern and I/O devices or programs interpret bit patterns as needed into number, text, image, audio, video (multimedia). -Data are coded when they enter the computer and decoded when they are represented to user.

©Brooks/Cole, 2003 Figure 2-3 Examples of bit patterns

©Brooks/Cole, 2003 Figure 2-4 Representing symbols using bit patterns - A piece of TEXT in any language is a sequence of symbols used to represent an idea in that language. -ُ Each symbol can be represented by a bit pattern - TEXT such as BYTE can be represented as 4 bit pattern

©Brooks/Cole, Logarithmic relationship between bit pattern length and number of symbols. Example: 2 symbols needs 1 bit (log 2 2) FormsNumber of Symbols Bit Pattern Length 0, , 01,10, ,001,010,011,100,101,110, ,0001,0010,0011,0100,0101, 0110,0111,1000,1001,1010, ,1101,1110, Representing symbols using bit patterns

©Brooks/Cole, 2003 Figure 2-5 Representation of the word “BYTE” in ASCII code - ASCII is the American Standard Code for Information Interchange and it has the following features: -Uses 7-bit pattern: (null) to (delete). 128 symbols can be represented. -There are 31 nonprintable character -Numeric characters are coded before letters -A, B….Z (upper letters) come before a, b,…., z (lowercase) and the sixth bit from right distinguishes them.

©Brooks/Cole, 2003 Representation of Symbols with other Codes - Extended ASCII uses 8-bits pattern instead of 7-bits to represent 256 symbols. - EBCDIC (Extended Binary Coded Decimal Interchange Code) uses 8-bits but it is only used on IBM computers. - UniCode uses 16-bits to represents 65,535 symbols. - ISO uses 32-bit pattern to represent 4,294,967,294 symbols.

©Brooks/Cole, 2003 Figure 2-6 Image representation methods - Bitmap graphic method divides an image into pixels (picture element which is a small dot. The resolution is the size of the pixels. As the resolution increases, the image quality will increase but more memory will be needed to store the image. - Vector graphics does not store the bit pattern of an image because an image will be represented using a mathematical formula which will be stored. An image is decomposed into a combination of curves and lines. Scaling is very easy.

©Brooks/Cole, 2003 Figure 2-7 Bitmap graphic method of a black-and-white image - Each pixel is assigned a bit pattern (0 for white, 1 for black) To show 4 levels of gray scale, a pixel is represented by a 2-bit pattern(00 black, 01 dark gray, 10 light dark gray, 11white)

©Brooks/Cole, 2003 Figure 2-8 Representation of color pixels - Each colored pixel is decomposed into red, green, blue. - Intensity of each color is measured and a bit pattern ( usually 8-bit) is assigned to it. - More memory is needed to store a colored image!!

©Brooks/Cole, 2003 Figure 2-9 Audio representation 1. Measure value of signal at equal intervals 2. Assign a value from a set to a sample 3. Store converted binary pattern

©Brooks/Cole, 2003 Figure 2-10 Binary to hexadecimal and hexadecimal to binary transformation A 4-bit pattern can be represented by a hexadecimal digit, and vice versa. Bit Pattern Bit Pattern Hex Digit Hex Digit Bit Pattern Bit Pattern Hex Digit Hex Digit A B C D E F

©Brooks/Cole, 2003 Example 1 Show the hexadecimal equivalent of the bit pattern Solution Each group of 4 bits is translated to one hexadecimal digit. The equivalent is xCE2.

©Brooks/Cole, 2003 Example 2 Show the hexadecimal equivalent of the bit pattern Solution Divide the bit pattern into 4-bit groups (from the right). In this case, add two extra 0s at the left to make the number of bits divisible by 4. So you have , which is translated to x0E2.

©Brooks/Cole, 2003 Example 3 What is the bit pattern for x24C? Solution Write each hexadecimal digit as its equivalent bit pattern to get

©Brooks/Cole, 2003 Figure 2-11 Binary to octal and octal to binary transformation A 3-bit pattern can be represented by an octal digit, and vice versa. Bit Pattern Bit Pattern Oct Digit Oct Digit Bit Pattern Bit Pattern Oct Digit Oct Digit

©Brooks/Cole, 2003 Example 4 Show the octal equivalent of the bit pattern Solution Each group of 3 bits is translated to one octal digit. The equivalent is 0562, o562, or

©Brooks/Cole, 2003 Example 5 Show the octal equivalent of the bit pattern Solution Divide the bit pattern into 3-bit groups (from the right). In this case, add two extra 0s at the left to make the number of bits divisible by 3. So you have , which is translated to

©Brooks/Cole, 2003 Example 6 What is the bit pattern for 24 8 ? Solution Write each octal digit as its equivalent bit pattern to get