1 Foundations of Computer Science 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.
3.1 3 Data Storage Foundations of Computer Science  Cengage Learning.
Fall 與 1 的數位世界 1. Fall 與 1 的數位世界 2 資訊化服務  提供快捷的服務:強大的計算能力、快速的網 路傳遞。  提供便利與便宜的商業服務:跨越地域限制, 輕易的貨比十家;降低空間與人力成本。  提供多元化的服務:新聞、血拼、聊天、數位 圖書館、網路電話.
Processing Data.
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
Chapter 8_2 Bits and the "Why" of Bytes: Representing Information Digitally.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
Number Systems & Logic Gates Day 1
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,
1 CSC103: Introduction to Computer and Programming Lecture No 2.
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
Computer System Basics 1 Number Systems & Text Representation Computer Forensics BACS 371.
CSC 101 Introduction to Computing Lecture 9 Dr. Iftikhar Azim Niaz 1.
Chapter 1 Data Storage(2) Yonsei University 1 st Semester, 2014 Sanghyun Park.
Representing Nonnumeric Data Everything is really a number.
Chapter 2 Data and Number Representations
Chapter 2 Computer Hardware
1 INFORMATION IN DIGITAL DEVICES. 2 Digital Devices Most computers today are composed of digital devices. –Process electrical signals. –Can only have.
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:
Chapter 1: Data Storage.
Computer System Basics 1 Number Systems & Text Representation Computer Forensics BACS 371.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 2 Data Representation.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
©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.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
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 Storage © 2007 Pearson Addison-Wesley. All rights reserved.
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.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 2 Lecture 2 – Digital Representations.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
1 Problem Solving using Computers “Data....Representation, and Storage.
ASCII AND EBCDIC CODES By : madam aisha.
Characters and Strings
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.
Computers: Information Technology in Perspective By Long and Long Copyright 2002 Prentice Hall, Inc. Encoding J. Holvikivi 2012.
1.4 Representation of data in computer systems Character.
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.
Chapter 1: Data Storage.
Binary Representation in Text
Binary Representation in Text
Computer Science: An Overview Eleventh Edition
Chapter 8 & 11: Representing Information Digitally
Binary Numbers and ASCII and EDCDIC
Chapter 3 Data Storage.
Bits & Bytes How Computers Represent Data
TOPICS Information Representation Characters and Images
Representing Nonnumeric Data
Lecture 3 ISE101: Computing Fundamentals
Computers & Programming Languages
Ch2: Data Representation
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
Presentation transcript:

1 Foundations of Computer Science Chapter 2 Data Representation

2 Outline 2.1 Data type 2.2 Data inside the computer 2.3 Representing data 2.4 Hexadecimal Notation 2.5 Octal Notation

3 2.1 Data Types 2.1 Data Types

4 Different Types of Data Data TextNumberImageAudioVideo Numbers, text, images, audio, and video are all forms of data. Computers need to process all types of data.

5 Multimedia The computer industry uses the term “multimedia” ( 多媒體 ) to define Information that contains numbers, text, images, audio, and video.

6 2.2 Data Inside The Computer 2.2 Data Inside The Computer

7 Bit Pattern All data types from outside a computer are transformed into a uniform representation called a bit pattern for processing by computers. A bit is the smallest unit of data that can be stored in a computer

8 Bit Pattern A bit pattern of length 8 is called a byte Byte also been used to measure the size of memory or other storage devices 1 byte = 8 bits 1 KB = 1024 bytes 1 MB = 1024 KB 2 bytes = 16 bits 1 GB = 1024 MB K : kilo ( 千 ) M: mega ( 百萬 ) G: giga ( 十億 ) 2 10 = 1024

9 Bit Pattern A switch, with its two states of on and off, can represent a bit(0 or 1) A bit pattern is a sequence of bits that can represent a symbol

10 Examples of Bit Patterns Data are coded ( 邊碼 ) when they enter a computer and decoded ( 解碼 ) when they are presented to the user

Representing Data 2.3 Representing Data

12 Representing Symbols Using Bit Patterns How many bits are needed in a bit pattern to represent a symbol in a language?  Depend on how many symbols are in the set

13 Number of Symbols and Bit Pattern Length Number of Symbols Number of Symbols … … 65,536 Bit Pattern Length Bit Pattern Length … 7 8 … 16

14 Codes Code: different sets of bit patterns have been designed to represent text symbols – ASCII: popular code for symbols – EBCDIC: used in IBM mainframes – Unicode ( 萬國碼 ): 16-bit code, allow a greater number of symbols – ISO: 32-bit code, allow a greater number of symbols

15 Coding Coding is the process of transforming data into a bit pattern

16 ASCII American Standard Code for Information Interchange ( 美國資訊交換標準碼 ) The code be developed from the American National Standards Institute (ANSI, 美國國 家標準局 ) ASCII uses 7 bits for each symbol 2 7 = 128

17 Some Features of ASCII ASCII uses a 7-bit pattern: ~  null character;  delete character There are 31 control (nonprintable) characters The numeric characters (0~9) are coded before letters

18 Some Features of ASCII There are several special printable characters The uppercase letters (A~Z) come before the lowercase letters (a~z) The upper and lowercase characters are distinguished by only 1 bit. (A  ; a  ) There are six special characters between the upper and lowercase letters

19 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. Extended ASCII uses a 8-bit pattern: ~

20 EBCDIC Extended Binary Coded Decimal Interchange Code ( 延伸的二進位十進制交 換碼 ) EBCDIC uses 8 bits for each symbols Only uses in IBM mainframes 2 8 = 256

21 Unicode Unicode ( 萬國碼 ) be designed from a coalition of hardware and software manufacturers Unicode uses 16 bits and can represent up to 65,536 (2 16 ) symbols

22 ISO International Organization for Standardization ( 國際標準化組織 ) ISO uses 32 bits and can represent up to 4,294,967,296 (2 32 ) symbols

23 Number Numbers are represented using the binary system Chapter 3

24 Images Images today are represented in a computer by one of two methods – Bitmap graphic ( 位元圖、點陣圖 ) – Vector graphic ( 向量圖 ) Image BitmapVector

25 Bitmap Graphic Image is divided into a matrix of pixels ( 像 數:圖畫元素 ), each pixel is assigned a bit pattern The size of the pixel depends on what is called the resolution ( 解析度 )

26 Representation of Color Pixels

27 Color and Gray-layer Images Color image RGB : 3 bytes Resolution: 512 * 512 = 26,624 pixels Image size: 512 * 512 * 3 = 79,872 bytes Gray-layer Image Gray-layer : 1 byte Resolution : 512 * 512 = 26,624 pixels Image size: 512 * 512 * 1 = 26,624 bytes

28 Vector Graphic If you want to rescale the bitmap graphic image, which creates a ragged or grainy look An image is decomposed into a combination of curves ( 曲線 ) and lines ( 直 線 ) Each curve or line is represented by a mathematical formula ( 數學方程式 ) Each time an image is drawn, the formula is reevaluated

29 Audio Audio data are transformed to bit patterns through sampling ( 取樣 ), quantization ( 量化 ), and coding ( 編碼 )

30 Video Video is a representation of images (called frames) in time, the combination of the images represents the video A movie is a series of frames shown one after another to create the illusion of motion Today video is normally compressed: MPEG

Hexadecimal Notation 2.4 Hexadecimal Notation

32 Hexadecimal Notation People find it difficult to manipulate bit patterns. Writing a long stream of 0s and 1s is tedious and prone to error A 4-bit pattern can be represented by a hexadecimal ( 十六進位 ) digit

33 Hexadecimal Digit Bit Pattern Bit Pattern Hex Digit Hex Digit Bit Pattern Bit Pattern Hex Digit Hex Digit A B C D E F

34 Binary to Hexadecimal and Hexadecimal to Binary Transformation F C E ABCDEF89ABCDEF → xFCE4 → XFCE4 → FCE4 16

35 Example BinaryHexadecimal ? ? ?x24C ABCDEF89ABCDEF

36 Example BinaryHexadecimal xCE x0E x24C ABCDEF89ABCDEF

37 Octal Notation A 3-bit pattern can be represented by a octal ( 八進位 ) digit

38 Octal Digit Bit Pattern Bit Pattern Octal Digit Octal Digit Bit Pattern Bit Pattern Octal Digit Octal Digit

39 Binary to Octal and Octal to Binary Transformation → → o →

40 Example BinaryOctal ? ? ?o

41 Example BinaryOctal o o o

42 The End