CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS

Similar documents
Objectives. Connecting with Computer Science 2

NUMBERS AND DATA REPRESENTATION. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

Introduction to Computer Science (I1100) Data Storage

BINARY SYSTEM. Binary system is used in digital systems because it is:

Data Representation 1

a- As a special case, if there is only one symbol, no bits are required to specify it.

Chapter 3 DATA REPRESENTATION

Chap 1. Digital Computers and Information

Introduction to Numbering Systems

Review of Number Systems

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

Numeral Systems (Part II)

The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Purpose of Chapter. External Representation of Information.

3.01C Multimedia Elements and Guidelines Explore multimedia systems, elements and presentations.

MACHINE LEVEL REPRESENTATION OF DATA

Elementary Computing CSC 100. M. Cheng, Computer Science

2nd Paragraph should make a point (could be an advantage or disadvantage) and explain the point fully giving an example where necessary.

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

Digital Fundamentals

Data Representation and Networking

Analogue vs. Discrete data

DIGITAL SYSTEM DESIGN

Digital Fundamentals

Bits, bytes, binary numbers, and the representation of information

Binary Codes. Dr. Mudathir A. Fagiri

Digital Audio. Amplitude Analogue signal

Beyond Base 10: Non-decimal Based Number Systems

CMPS 10 Introduction to Computer Science Lecture Notes

Lecture 1: What is a computer?

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

DATA TYPES. Numeric Data

Beyond Base 10: Non-decimal Based Number Systems

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning

Data encoding. Lauri Võsandi

SE311: Design of Digital Systems

OBJECTIVES After reading this chapter, the student should be able to:

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

CS/EE 260. Digital Computers Organization and Logical Design

Microcomputers. Outline. Number Systems and Digital Logic Review

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

Computing in the Modern World

Bits. Binary Digits. 0 or 1

Binary representation and data

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Number Systems CHAPTER Positional Number Systems

Binary Systems and Codes

Chapter 4: Computer Codes. In this chapter you will learn about:

Computer Organization

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

CHW 261: Logic Design

EEM 232 Digital System I

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

计算原理导论. Introduction to Computing Principles 智能与计算学部刘志磊

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction

Number System. Introduction. Decimal Numbers

Digital Data. 10/11/2011 Prepared by: Khuzaima Jallad

Final Study Guide Arts & Communications

Source coding and compression

Software and Hardware

Chapter 2 Bits, Data Types, and Operations

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Chapter 9: A Closer Look at System Hardware

Chapter 9: A Closer Look at System Hardware 4

Lecture (03) Binary Codes Registers and Logic Gates

Electronic Data and Instructions

Prentice Hall. Learning Microsoft PowerPoint , (Weixel et al.) Arkansas Multimedia Applications I - Curriculum Content Frameworks

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Example 1: Denary = 1. Answer: Binary = (1 * 1) = 1. Example 2: Denary = 3. Answer: Binary = (1 * 1) + (2 * 1) = 3

Topic 2 Data and Information. Data Data can be defined as a set of recorded facts, numbers or events that have no meaning.

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

Standard File Formats

CHAPTER 2 (b) : AND CODES

Chapter 2. Data Representation in Computer Systems

Numbering systems. Dr Abu Arqoub

Jianhui Zhang, Ph.D., Associate Prof. College of Computer Science and Technology, Hangzhou Dianzi Univ.

INTRODUCTION TO COMPUTERS

Chapter 7. Representing Information Digitally

CC411: Introduction To Microprocessors

UNIT 7A Data Representation: Numbers and Text. Digital Data

Chapter3 Recording Images with the Camera

Discussion. Why do we use Base 10?

Module -10. Encoder. Table of Contents

Bits and Bit Patterns

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Digital Media. Daniel Fuller ITEC 2110

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

Digital Fundamentals

CS & IT Conversions. Magnitude 10,000 1,

Information and Creative Technology

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Number Systems Base r

Computer Logical Organization Tutorial

Transcription:

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS INTRODUCTION Digital computers use sequences of binary digits (bits) to represent numbers, letters, special symbols, music, pictures, and videos. For this reason, we study the Digital Data Representation and Numbering System in order to understand how computers store information in Binary digits 1

TYPES OF SIGNAL - ANALOGUE SIGNAL An analog or analogue signal is any variable signal continuous in both time and amplitude. Analog signals are represented as sine wave. The sine wave's amplitude value can be seen as the higher and lower points of the wave, while the frequency (time) value is measured in the sine wave's physical length from left to right. TYPES OF SIGNAL - ANALOGUE SIGNAL Examples of analog signals: A good example of an analogue signal is the loudspeaker of a stereo system. When the volume is turned up, the sound increases slowly and constantly. The sound from a human voice is analog, because sound waves are continuous. Even a typical kitchen clock having its hands moving continuously can be represented as an analog signal 2

TYPES OF SIGNAL - DIGITAL SIGNAL Digital Signal is discrete signal in both time and amplitude. A digital signal refers to an electrical signal that is converted into a pattern of bits. These patterns can be generated in many ways, each producing a specific code. Digital signals can take only a limited number of values (discrete steps); usually just two values are used: positive supply voltage (+Vs) and zero volts (0V). Logic States +Vs 0v True False 1 0 High Low On Off 3

ANALOGUE TO DIGITAL CONVERTOR (ADC) If you want to attach an analogue input device to a digital device such as a computer, you will need an analogue to digital convertor(adc). A good example of a computer peripheral that requires an ADC is a microphone. When you plug a microphone into a computer, you are actually plugging it into an ADC which converts the analogue signals from the microphone into digital data that the computer can then process. Digital to Analogue Convertor (DAC) If you want to attach an analogue output device to a digi tal device such as a computer, you will need a digital to analogue convertor(dac). A good example of a computer peripheral that requires a DAC is a loud speaker or headphones. When you plug a loudspeaker into a computer, you are actually plugging it into a DAC, which takes digital data from the computer and converts it into analogu e signals which the loudspeaker then converts into sound. 4

Data Representation-Text/Character Data Representation Any piece of data that is stored in a computer s memory must be stored as a binary number. Data is not just alphabetic characters, but also numeric characters, punctuation, spaces, etc. When a character is stored in memory, it is first converted to a numeric code. The numeric code is then stored in memory as a binary number Historically, the most important of these coding schemes is ASCII, which stands for the American Standard Code for Information Interchange. It is the most commonly used coding technique for alphanumeric data. Data Representation-Text/Character Data Representation Old version of ASCII characters are represented in 7 bits. So 2 7 =128 numeric codes, those represent the English letters, various punctuation marks, and other characters. Extended version of ASCII characters are represented in 8 bits. So 2 8 =256 numeric codes are used for alphanumeric characters. ASCII value for A is 65; B is 66 and so on. ASCII value for a is 97 and b is 98 and so on. ASCII value for 0 is 48, 1 is 49 and so on ASCII is limited however, because it defines codes for only 128 or 256 characters. To remedy this, the Unicode character set was developed in the early 1990s. 5

Data Representation-Text/Character Data Representation Unicode (Universal Code) is an extensive encoding scheme that is compatible with ASCII, but can also represent characters for many of the natural languages in the world. The Unicode character set uses 16 bits per character. Therefore, the Unicode character set can represent 2 16 =65,536 characters. Unicode was designed to be a superset of ASCII. That is, the first 256 characters in the Unicode character set correspond exactly to the extended ASCII character set. Today, Unicode is quickly becoming the standard character set used in the computer industry Data Representation-Images and Graphics Digitizing a picture is the act of representing it as a collection of individual dots called pixels (Picture elements). Each pixel is assigned a tonal value (black, white, shades of gray or color), which is represented in binary code (zeros and ones). The number of pixels used to represent a picture is called the resolution. Resolution is usually expressed by numbers for horizontal and vertical: 640 by 480 means 640 pixels wide, by 480 pixels tall. The storage of image information on a pixel-by-pixel basis is called a raster-graphics format. Most popular raster file formats are: JPEG, GIF, BMP, TIFF, PCX and PNG. 6

Data Representation-Sound/Audio Sound is perceived when a series of air compressions vibrate a membrane in our ear, which sends signals to our brain. Several popular formats are: WAV, AU, AIFF, VQF, and MP3. Currently, the dominant format for compressing audio data is MP3 Data Representation - Video/Animation What is video? is the technology of electronically capturing, recording, processing, storing, transmitting and reconstruction a sequence of still images representing scenes in motion It is a collection of still images Common video formats are: AVI, MOV, MPEG (Moving Pictures Expert Group) and MP4 7

NUMBERING SYSTEM A number system is the set of symbols used to express quantities as the basis for counting, determining order, comparing amounts, performing calculations, and representing value. Examples of numbering systems are decimal, binary, hexadecimal and octal numbering system. In order to represent numbers of different bases, we surround a number in parenthesis and then place a subscript with the base of the number. A decimal number is written (9233) 10 A binary number is written (11011) 2 An octal number is written (7133) 8 A hexadecimal number is written (2BC1) 16 g system DECIMAL NUMBER SYSTEM The decimal number system is used in our everyday life. It has values from 0 9. Decimal number system has a base of 10. This means that each digit in the number is multiplied by 10 raised to a power corresponding to that digit s position. (4928) 10 8 x 10 0 = 8x1 2 x 10 1 = 1x10 9 x 10 2 = 9x100 4 x 10 3 = 4x100 8

Binary Number System Binary is a number system used by digital devices like computers. In the binary system, there are only two digits, 0 and 1. The binary system is said to have a base of 2. (1001) 2 1 x 2 0 = 1x1 0 x 2 1 = 0x2 0 x 2 2 = 0x4 1 x 2 3 = 1x8 Octal Number System Octal number system is a numeral system with a base of 8. The values are represented by 0-7. Each octal digit represents three (3) binary bits. 9

Hexadecimal Number System Hexadecimal number system is a numeral system with a base of 16. The values are represented by 0-9, A,B,C,D,E,F. Each hexadecimal digit represents four (4) binary bits Numbers with Different Base Decimal Numbers (Base 10) Binary Numbers ( Base 2) Octal Numbers (Base 8) 0 0000 00 0 1 0001 01 1 2 0010 02 2 3 0011 03 3 4 0100 04 4 5 0101 05 5 6 0110 06 6 7 0111 07 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F Hexadecimal Numbers (Base 16) 10

Why we study binary number system? Most computers use the simple type of digital technology. Their electronic circuits have only two possible states on and off. When discussing these states, we usually indicate the on state with 1 and the off state with 0. These 1 s and 0 s are referred to as bits which is an abbreviation to binary digits. The above picture represents 01001101. When data is input into a computer, the numbers or words we understand are translated into a binary numbers system. Binary is the language of computers. Converting Decimal Numbers to Binary Numbers Example 1: Convert the decimal number (35) 10 to binary (? ) 2 2 35 2 17 ------1 2 8 ------1 2 4 ------0 2 2 ------0 1 ------0 ANS: (35) 10 = (100011) 2 11

Converting Decimal Numbers to Binary Numbers Example 2: Convert the decimal number (35.320) 10 to its equivalent binary (? ) 2 We know the integer part is (35) 10 = (100011) 2 Fraction part is (0.320) 10 0.320 * 2 = 0.640 --> 0 0.640 * 2 = 1.280 --> 1 0.280 * 2 = 0.560 --> 0 0.560 * 2 = 1.120 --> 1 0.120 * 2 = 0.240 --> 0 0.240 * 2 = 0.480 --> 0 0.480 * 2 = 0.960 --> 0 0.960 * 2 = 1.920 --> 1 (0.320) 10 = (0.010100001) 2 So combining integer and fraction part, Answer is (35.320) 10 =(100011.010100001) 2 Converting Binary numbers to Decimal numbers Conversion of a binary number to its equivalent decimal number is done by accumulating the multiplication of each digit of the binary number by Base 2 of power equal to the location of the digit in the binary number. Least significant digit (LSD) Most significant digit (MSD) Location 0 Location 4 Example 1: convert the binary number (11011 ) 2 to decimal number (? ) 10 We give the each digit a location number. We start from the least significant digit to be assigned location 0, next to it location 1 until digit 1 at the most significant digit location which it has to be assigned location 4. (11011) 2 = 1 2 4 + 1 2 3 + 0 2 2 + 1 2 1 + 1 2 0 = 16 + 8 + 0 + 2 + 1 = (27) 10 Answer is (11011) 2 = (27) 10 12

Converting Binary numbers to Decimal numbers Example 2: What is the decimal number of (100101) 2 Converting Binary numbers to Decimal numbers Example 3: Convert (101.101) 2 = (? ) 10 = 101.101 = 1 2 2 + 0 2 1 + 1 2 0 + 1 2-1 + 0 2-2 + 1 2-3 = 4 + 0 + 1 + 1/2 + 0 + 1/8 = 5 + 0.5 + 0.125 = 5.625 Answer is (101.101) 2 = (5.625) 10 13

Arithmetic operations-binary Addition The ALU can perform five kinds of arithmetic operations, or mathematical calculations: addition, subtraction, multiplication, division and modulus (remainder of division). Let us see the example of how binary addition done by the ALU. Binary addition INPUT OUTPUT A B A+B 0 0 0 0 1 1 1 0 1 1 1 10 (0 with Carry 1) Arithmetic operations-binary Addition What is the Binary addition of (101) 2 + (1001) 2 What is the Binary addition of (111010) 2 + (11011) 2 14