Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

Information Representation
Technology ICT Option: Data Representation. Data Representation In our everyday lives, we communicate with each other using analogue data. This data takes.
3.1 3 Data Storage Foundations of Computer Science  Cengage Learning.
Bits are Not just for Numbers Computers store characters as bits or binary digits. Characters from the English-language keyboard are represented in ASCII.
Connecting with Computer Science, 2e
1 The Information School of the University of Washington Nov 6fit more-digital © 2006 University of Washington Digital Information INFO/CSE 100,
©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.
Digital Information Technology
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Lecture 5.
1 CSC103: Introduction to Computer and Programming Lecture No 2.
Chapter 2 IT Foundation Data: facts about objects Store data in computer: – binary data – bits – bytes Five types of data.
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
Bits & Bytes: How Computers Represent Data
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.
CSCI-235 Micro-Computers in Science Hardware Part II.
Computers and Scientific Thinking David Reed, Creighton University Data Representation 1.
Representing Nonnumeric Data Everything is really a number.
Chapter 2 Data and Number Representations
Digital Terminology. Bitmap A representation consisting of rows and columns of dots of a graphic image stored in computer memory. To display a bitmap.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
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.
Representing Data. Representing data u The basic unit of memory is the bit  A transistor that can hold either high or low voltage  Conceptually, a tiny.
1 Foundations of Computer Science Chapter 2 Data Representation.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Quiz # 1 Chapters 1,2, & 3.
Chapter 2 Data Representation.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Data Representation, Number Systems and Base Conversions
Data Representation The storage of Text Numbers Graphics.
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Marwan Al-Namari 1 Digital Representations. Bits and Bytes Devices can only be in one of two states 0 or 1, yes or no, on or off, … Bit: a unit of data.
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.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 2 Lecture 2 – Digital Representations.
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,
Fundamentals of Data Representation Yusung Kim
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.
Text and Images Key Revision Points.
Binary Representation in Text
Binary Representation in Text
Binary and Decimal Numbers
Chapter 8 & 11: Representing Information Digitally
Images Data Representation.
Number Systems and Codes
Binary Numbers and ASCII and EDCDIC
3 Data Storage Foundations of Computer Science ã Cengage Learning.
Chapter 3 Data Storage.
Bits & Bytes How Computers Represent Data
Representing Nonnumeric Data
CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS
Ch2: Data Representation
INFO/CSE 100, Spring 2005 Fluency in Information Technology
Chapter 2 Data Representation.
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Data Representation Chapter 2 Computer HW (Von Neumann Model) Program
Chapter 3 - Binary Numbering System
Presentation transcript:

Chapter 2 Data Representation

Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images, video, and audio. After reading this chapter, the reader should be able to: O BJECTIVES Work with hexadecimal and octal notations.

DATA TYPES 2.1

Figure 2-1 Different types of data

The computer industry uses the term “multimedia” to define information that contains numbers, text, images, audio, and video. Note:

DATA INSIDE THE COMPUTER DATA INSIDE THE COMPUTER 2.2

Figure 2-2 Bit pattern - a string of bits Bit (Binary Digit)- is the smallest unit of data that can be stored in a computer; it is either 0 or 1.

Figure 2-3 Examples of bit patterns Computer memory does not know that type of data a stored bit pattern represents. It just stores the data as bit patterns. It is the responsibility of I/O devices or programs to interpret a bit pattern as a number, text, or some other type of data.

Data are coded when they enter a computer and decoded when they are presented to the user.

REPRESENTINGDATAREPRESENTINGDATA 2.3

TEXT A piece of text in any language is a sequence of symbols used to represent an idea in that language. Symbols in English language : – Uppercase letters (A~Z) – Lowercase letters (a~z) – Numeric characters (0~9) – Punctuations (., : ; …)

Figure 2-4 Representing symbols using bit patterns

Bit Pattern Length How many bits are needed in a bit pattern to represent a symbol in a language?  It depends on how many symbols are in the set.

Table 2.1 Number of symbols and bit pattern length Number of Symbols Number of Symbols … … 65,536 Bit Pattern Length Bit Pattern Length … 7 8 … 16

Codes Code – Set of bit patterns designed to represent text symbols. Coding – the process of representing symbols

Figure 2-5 Representation of the word “BYTE” in ASCII code ASCII code – developed by ANSI uses 7 bits for each symbol. This means 128 different symbols can be defined by this code.

Extended ASCII To make the size of each pattern 1 byte (8 bits), the ASCII bit patterns are augmented with an extra 0 at the left. Each pattern can easily fit into 1 byte of memory.

EBCDIC & Unicode EBCDIC- – Developed by IBM – Used in IBM mainframe computers. Unicode – – 16 bits (65536 symbols) – Different sections of the code are allocated to symbols from different languages in the world.

Figure 2-6 Image representation methods

Bitmap Graphic A image is divided into a matrix of pixels, where each pixel is a small dot. – More pixels  – Better representation of image  – Better resolution  – More memory Each pixel is assigned a bit pattern. The size and the value of the pattern depend on the image.

Figure 2-7 Bitmap graphic method of a black-and-white image

Figure 2-8 Representation of color pixels Color image Each pixel is decomposed into 3 primary colors: red, green and blue. (RGB) The intensity of each color is measured, and a bit pattern (8 bits) is assigned.

Resolution The term is most often used to describe monitors, printers, and bit-mapped graphic images. Dot-matrix and laser printers, the resolution indicates the number of dots per inch. For example, a 300-dpi (dots per inch) printer is one that is capable of printing 300 distinct dots in a line 1 inch long. This means it can print 90,000 dots per square inch. Graphics monitors, the screen resolution signifies the number of dots (pixels) on the entire screen. For example, a 640-by-480 pixel screen is capable of displaying 640 distinct dots on each of 480 lines, or about 300,000 pixels.

Vector Graphic A image is decomposed into a combination of curves and lines. Each curve or line is represented by a mathematical formula.

Audio Audio is a representation of sound or music. Audio is by nature analog data. It is continuous, not discrete. Audio is converted to digital data and stored in bit patterns. 1. Sampling 2. Quantization 3. Coding 4. Stored

Figure 2-9 Audio representation

Video Video is a representation of images (frames) in time. A movie is a series of frames shown one after another to create the illusion of motion. Today video is normally compressed.

HEXADECIMALNOTATIONHEXADECIMALNOTATION 2.4

A 4-bit pattern can be represented by a hexadecimal digit, and vice versa. Note:

Table 2.2 Hexadecimal digits Bit Pattern Bit Pattern Hex Digit Hex Digit Bit Pattern Bit Pattern Hex Digit Hex Digit A B C D E F

Figure 2-10 Binary to Hexadecimal and Hexadecimal to Binary transformation

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.

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.

Example 3 What is the bit pattern for x24C? Solution Write each hexadecimal digit as its equivalent bit pattern to get

OCTALNOTATIONOCTALNOTATION 2.5

A 3-bit pattern can be represented by an octal digit, and vice versa. Note:

Table 2.3 Octal digits Bit Pattern Bit Pattern Oct Digit Oct Digit Bit Pattern Bit Pattern Oct Digit Oct Digit

Figure 2-11 Binary to Octal and Octal to Binary transformation

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

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

Example 6 What is the bit pattern for 24 8 ? Solution Write each octal digit as its equivalent bit pattern to get