Chapter 2 Data Representation.

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
DATA REPRESENTATION CONVERSION.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Data Representation in Computers
Number Representation Rizwan Rehman, CCS, DU. Convert a number from decimal to binary notation and vice versa. Understand the different representations.
Chapter 1 Number Systems and Codes William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper Saddle.
2.1 2 Number Systems Foundations of Computer Science  Cengage Learning.
Number Systems and Codes In PLC
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Hexadecimal Dk Izzati Pg Haji Ahmad.
©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,
Chapter 3 Number Representation. Convert a number from decimal 、 hexadecimal,octal to binary notation and vice versa. Understand the different representations.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
1 Foundations of Computer Science Chapter 2 Data Representation.
Supplemental Chapter Number Bases
Chapter 1 Introduction to Computers Maran Illustrated Computers CIS
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Chapter 3 Number Representation. Convert a number from decimal to binary notation and vice versa. Understand the different representations of an integer.
Chapter 7—Objects and Memory The Art and Science of An Introduction to Computer Science ERIC S. ROBERTS Java Objects and Memory C H A P T E R 7 Yea, from.
Number systems, Operations, and Codes
Positional Notation 642 in base 10 positional notation is:
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
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.
CPIT 201 Introduction to Computing
Chapter 2 Number Systems: Decimal, Binary, and Hex.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Octal to Decimal Hexadecimal DecimalOctal Binary.
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
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.
MODULE –I NUMBER SYSTEM Digital Design Amit Kumar Assistant Professor SCSE, Galgotias University, Greater Noida.
Computer Studies Today Chapter 19 1 Chapter 19. Computer Studies Today Chapter 19 2 »Information stored in a computer is in two states: –ON –OFF.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
Chapter 5 NUMBER REPRESENTATION AND ARITHMETIC CIRCUITS.
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH 2 Number Systems CPIT 201 Introduction.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
1 Section 1.3 Binary Number Systems Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Number Systems and Codes
Octal to Decimal Decimal Octal Binary Hexadecimal.
What is a byte? What is it? How would you use it?
Lecture 3: Binary values and number systems
CHAPTER 1 : INTRODUCTION
Number Systems Lab session 1 Xuan Guo.
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Number Systems.
Introduction to IT By: Muhammed s. anwar.
Ch2: Data Representation
There are 10 types of people of people in this world…
Chapter 2 Data Representation.
Chapter 2: Number Systems
Number Representation
Data Representation Chapter 2 Computer HW (Von Neumann Model) Program
Chapter 2 Number Systems.
Storing Integers and Fractions
Learning Intention I will learn how computers store text.
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Remember the 10 types of people of people in this world…
Information Representation
Chapter 3 - Binary Numbering System
Chapter 2 Number Systems.
Presentation transcript:

Chapter 2 Data Representation

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

2.1 DATA TYPES

Different types of data Figure 2-1 Different types of data

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

2.2 DATA INSIDE THE COMPUTER

Figure 2-2 Bit pattern

Examples of bit patterns Figure 2-3 Examples of bit patterns

2.3 REPRESENTING DATA

Representing symbols using bit patterns Figure 2-4 Representing symbols using bit patterns

Table 2.1 Number of symbols and bit pattern length 4 8 16 … 128 256 65,536 Bit Pattern Length --------------------- 1 2 3 4 … 7 8 16

Representation of the word Figure 2-5 Representation of the word “BYTE” in ASCII code

Image representation methods Figure 2-6 Image representation methods

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

Representation of color pixels Figure 2-8 Representation of color pixels

Figure 2-9 Audio representation

2.4 NUMBERING SYSTEMS

2.5 HEXADECIMAL NOTATION

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

Table 2.2 Hexadecimal digits Bit Pattern ------------ 0000 0001 0010 0011 0100 0101 0110 0111 Hex Digit ------------ 1 2 3 4 5 6 7 Bit Pattern ------------ 1000 1001 1010 1011 1100 1101 1110 1111 Hex Digit ------------ 8 9 A B C D E F

Binary to hexadecimal and hexadecimal to binary transformation Figure 2-10 Binary to hexadecimal and hexadecimal to binary transformation

Example 1 Show the hexadecimal equivalent of the bit pattern 1100 1110 0010. Solution Each group of 4 bits is translated to one hexadecimal digit. The equivalent is xCE2 or (CE2)16.

Show the hexadecimal equivalent of the bit pattern 0011100010. Example 2 Show the hexadecimal equivalent of the bit pattern 0011100010. 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 000011100010, which is translated to x0E2.

Example 3 What is the bit pattern for (24C)16 ? Solution Write each hexadecimal digit as its equivalent bit pattern to get 001001001100.

2.6 OCTAL NOTATION

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

Table 2.3 Octal digits Bit Pattern ------------ 000 001 010 011 Oct Digit ------------ 1 2 3 Bit Pattern ------------ 100 101 110 111 Oct Digit ------------ 4 5 6 7

Binary to octal and octal to binary transformation Figure 2-11 Binary to octal and octal to binary transformation

Example 4 Show the octal equivalent of the bit pattern 101110010. Solution Each group of 3 bits is translated to one octal digit. The equivalent is 0562, o562, or 5628.

Show the octal equivalent of the bit pattern 1100010. Example 5 Show the octal equivalent of the bit pattern 1100010. 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 001100010, which is translated to 1428.

Write each octal digit as its equivalent bit pattern to get 010100. Example 6 What is the bit pattern for 248? Solution Write each octal digit as its equivalent bit pattern to get 010100.

2.7 BINARY NOTATION

Note:

Decimal fractions to binary 2.8 Decimal fractions to binary

Use repetition multiplication

Exercise Convert each of the following to decimal (100011)2 (F546AB)16 (7563)8 Convert each of the following to binary, octal and hexadecimal (46)10 (987)10 Convert each of the following to binary (56.125)10