This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

Editors' Picks Books

Hand-picked favorites from

our editors

our editors

Editors' Picks Audiobooks

Hand-picked favorites from

our editors

our editors

Editors' Picks Comics

Hand-picked favorites from

our editors

our editors

Editors' Picks Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

Unit 2 By: Dipti Purohit Izee business school bangalore

UNIT COVERS......

Data Representation, Binary Data Representation, Binary Coding Schemes: EBCDIC, ASCII & UNICODE

3

Data Forms

Human communication

Includes language, images and sounds

Computers

Process and store all forms of data in binary format

** Conversion to computer-usable representation using data formats
**

Define the different ways human data may be represented, stored and processed by a computer

4

Data conversion and representation

Data Storage

6

Data formats

Proprietary formats

Unique to a product or company E.g., Microsoft Word, Word Perfect

** Standards (evolve in two ways):
**

Proprietary formats become de facto standards (e.g., Adobe PostScript) Invented by an international standard organization (e.g., Motion Pictures Experts Group, MPEG)

**Common Data Representations
**

Type of Data

Alphanumeric Image (bitmapped)

Standard(s)

Unicode, ASCII, EDCDIC

GIF

(graphical image format) TIF (tagged image file format) PNG (portable network graphics) PostScript, JPEG, SWF (Macromedia Flash), SVG PostScript, TrueType WAV, AVI, MP3, MIDI, WMA PDF (Adobe Portable Document Format), HTML, XML Quicktime, MPEG-2, RealVideo, WMV 7

Image (object) Outline graphics and fonts Sound Page description Video

8

Alphanumeric Data

Characters (r, T), number digits (0..9), punctuation (!, ;), special purpose characters ($, &) Four codes/standards to represent letters and numbers:

BCD (Binary-Coded Decimal) Unicode ASCII (American Standard Code for Information Interchange) EBCDIC (Extended Binary Coded Decimal Interchange Code)

Data Representation: How do computers represent data digitally? Digital data is made up of discrete numbers, with each bit being either a 1 or a 0 ± it¶s either on or off, nowhere in between Analog data is made up of a continuous wave of information, with varying degrees in between For example: A digital clock changes it¶s digital display once every minute to show the time An analog clock is continually moving it¶s second, minute and hour hands to show the time

4

Data Representation: How do computers represent data digitally?

** Another example is a light fixture
**

A standard light switch is similar to digital x It is either on or off ± 1 or 0 A dimmer light switch is similar to analog x It¶s rotating dial can be turned to many different positions to make the light varying degrees of bright or dim

4

Data Representation: How do computers represent data digitally?

Data representation makes it possible to convert letters, sounds, and images into electrical signals Digital electronics makes it possible for computer to manipulate simple ³on´ and ³off´ signals to perform complex tasks

A computer¶s circuits have only two states: on and off A binary 1 represents ³on´ A binary 0 represents ³off´

4

**How can a computer represent numbers?
**

Unlike the decimal system (base 10), the binary number system (base 2) uses only two digits: 0 and 1 The following table lists some decimal numbers and their binary equivalent:

6

**How can a computer represent words and letters using bits?
**

Character data is composed of letters, symbols, and numbers that will not be used in arithmetic operations

Numeric data is used in arithmetic calculations, and is encoded differently

ASCII (American Standard Code for Information Interchange) requires only 7 bits for each character Extended ASCII uses 8 bits for each character. Used in most personal computers

See the code on the next slide

7

How can a computer represent words and letters using bits?

7

How can a computer represent words and letters using bits? EBCDIC (Extended Binary-Coded Decimal Interchange Code) is an alternative 8-bit used by older IBM systems Unicode uses 16 bits and provides codes for 65,000 characters ± a bonus for representing alphabets of multiple languages

Used for foreign language support

8

How does a computer convert sounds and pictures into codes?

Sounds and pictures must be transformed into a format the computer can understand A computer must digitize colors, notes, and instrument sounds into 1s and 0s For example, a red dot on your screen might be represented by 1100, a green dot by 1101

9

**How does a computer store all these codes?
**

Data is stored on a computer in a file

Data files might contain the text of a document, the numbers for a calculation, the contents of a web page, or the notes of a music clip as binary code Executable files contain the programs or instructions that tell the computer how to perform a specific task. For example, how to display and print text

Data files have a file header which tells the computer how the binary code is used to represent the data.

The header tells the computer if the binary code represents a music file, a graphic, a text document, etc.

9

Quantifying Bits and bytes: How can I tell the difference between bits and bytes?

** A bit is one binary digit (b)
**

Eg. 0

A byte is 8 bits (B)

Eg. 0010 0100

A nibble is 4 bits

Eg. 0011

10

**Quantifying Bits and bytes: How can I tell the difference between bits and bytes?
**

Prefixes

Kilo- means a 1000 Mega- means million Giga- means billion

Kilobit (Kb) is approx. 1,000 bits (1,024) Kilobyte (KB) is approx. 1,000 bytes (1,024) Megabyte (MB) is approx. 1,000,000 bytes (1,048,576) Gigabyte (GB) is approx. 1,000,000,000 bytes (1,07 ,741,824)

11

**Self Quiz Questions
**

1. A(n) _______ device works with discrete numbers, whereas a(n) _______ device works with continuous data. The _______ number system represents numeric data as a series of 0s and 1s. Most personal computers use the _______ code to represent character data. 100 Mb is larger than 100 MB. True or false? A prefix that means a million bytes is _______.

2. 3. 4. 5.

11

**Self Quiz Answers
**

1. A(n) digital device works with discrete numbers, whereas a(n) analog device works with continuous data. The binary number system represents numeric data as a series of 0s and 1s. Most personal computers use the extended ASCII code to represent character data. 100 Mb is larger than 100 MB. False A prefix that means a million bytes is Mega .

11

2. 3. 4. 5.

Binary Concepts

-- OFF -- ON

DATA (in binary Digits)

Data Representation

000111 000111010101 011101000110100101010 010 01010 1010101 01001 10010001 001001 0011110 0110100 101010 10010101 101010 1010000 Main() { printf(³ Hello´); printf(³We are enjoying a world of alphabetical coding´); }

Data Representation

Digital computers use binary code to represent characters. Binary code is made up of binary digits or bits. A string of "0s" and "1s" is used to represent characters. Byte is a sequence of 8 bits. Most computers have words that consist of 8 or 16 bits. In large computers the number of bits per word could be 16 or 32 bits.

**Data representation (Contd.)
**

When

data is keyed in, each keystroke is converted to a binary character code and transmitted to the computer

Each character to the printer, screen, disk is communicated in binary code. While displaying or printing, the character is converted back to human readable form

Data Storage

Data is stored and processed in computers in the binary form. These symbols 0 and 1, are called bits 2 bits give four unique combinations i.e. 00, 01, 10 , 11. A string of 8 bits is called a byte Words are stored one character/byte.

**Data Storage (Contd.)
**

During calculation the decimal number is converted to its binary equivalent. After calculation the result is converted back to its decimal equivalent.

Number systems

The additive approach - Number earlier consisted of symbols e.g. Roman number system - I for 1, II for 2, III for 3 etc. Positional numbering - Symbols represent different values depending on the position they occupy e.g. the Decimal system

**Decimal Number System
**

In the decimal number system the successive position to the left of the decimal point represent units, tens, hundreds, thousands etc. (3 * 100) + (6*10) + (5*1) = 365 The position of the number affects its value. These kind of number systems (6*10) therefore are called positional number system.

Base

Position number

Decimal Number System (Contd.)

The value of each digit in the number system is determined by: a) The digit itself b) The position of the digit in the number c) The base/radix of the system

**Binary Number System
**

The binary number system has a base of two and symbols used are 0 and 1. In this number system, as we move to the left, the value of the digit will be two times greater than its predecessor because the base is two. Thus the value of the places are : 64 32 16 8 4 2 1

0001111001010111 Binary Number

Least Significant bit

Most Significant bit

**Octal number systems
**

Uses a base of 8 Values increase from right to left 1, 8, 64, 512 ...

Binary 000 001 010 011 100 101 110 111

Octal 0 1 2 3 4 5 6 7

**Octal Number System
**

The octal system has the base of 8. The value increase from right to left as 1, 8, 64, 512, 4096. The decimal value of an octal number 1204 can be computed as : 1204 = (1 * 512) + (2 * 64) + (0 * 8) + (4 * 1) = 512 + 128 + 0 + 4 = 644

**Octal Number System
**

To convert a number from binary to octal and vice versa, the following table must be kept in mind:

Binary 000 001 010 011 100 101 110 111 Octal 0 1 2 3 4 5 6 7

Hexadecimal Decimal 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 A 10 B 11 C 12 D 13 E 14 F 15

Hexadecimal Number Systems

**Hex. Number Systems(Contd.)
**

Uses a base of 16 The 16 symbols required for the hexadecimal number system obtained by using the alphabets A, B, C, D, E and F Converting hexadecimal to decimal decimal equivalent of a hexadecimal number A0119

(10 * 65,536)+(0 * 4,096)+(1 * 256)+ ( 1 * 16) + ( 9 * 1) = 6,55,360 + 0 + 256 + 16 + 9 = 6, 55, 641

**Binary to Decimal Conversion
**

Converting binary numbers to decimal value <64 <32 <16 <8 <4 <2 <1 The decimal equivalent of 110100 is = (1 * 32 ) + (1 * 16) + (0 * 8) + ( 1 * 4) + ( 0 * 2) + (0 * 1) = 32 + 16 + 0 + 4 + 0 + 0 = 52

Decimal to Binary Conversion

Divide the decimal number by the base of the required number system Note the remainder in one column and divide the quotient again with the base Keep repeating this process until quotient is reduced to a zero Reading remainders in the reverse order gives the binary equivalent

**Decimal to Binary Conversion
**

E.g. Converting the decimal number 52 to its binary equivalent.

**Remainder 2 |__52 2 |__26 | 0 2 |__13 | 0 2 |__06 | 1 2 |__03 | 0 2 |__01 | 1 2 |__00 | 1
**

Thus the binary equivalent of the decimal number 52 is 110100

Each hexadecimal digit is represented by 4 binary digits. Binary Hexadecimal 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F

Binary to Hexad ecima l

**Binary to Hexadecimal (Contd.)
**

Split

the quantity into groups of four outwards from right to left Each group of four is directly converted into its hexadecimal equivalent Add zeros to the left of the number if necessary E.g. Binary 10101011000010 Hexadecimal Equivalent 0010 1010 1100 0010 2 A C 2

Hexadecimal to Binary

Write binary equivalent of each hexadecimal digit in groups of four E.g. hexadecimal 191A412C 0001 1001 0001 1010 0100 0001 0010 1100 Thus the required binary number can be written as :

11001000110100100000100101100

The

leading zeroes are omitted

**Converting from Binary to Octal
**

For example :

The binary number must be divided into groups of three from the octal point- to the right in case of the fractional portion and to the left in case of the integer portion. Each group can then be replaced with their octal equivalent. We may add zero to the left of the number if required.

**Binary 101010101010100 101 010 101 010 100 5 2 5 2 4
**

52524 is the octal equivalent of the given binary number.

**Converting from Octal to Binary
**

Each octal digit is replaced with the appropriate µtriple¶ of binary digits. For example :

6 110

5 101

Similarly the binary equivalent of the octal number 65 is 110101.

ENCODING SCHEMES

In the previous slides, you learned how numbers are stored in computers as binary code. Here is encoding schemes

Representing Characters

To allow consistent data transfer among computer systems (such as using the ftp command), rules on how characters are assigned binary code combinations needed to be created. These rules or ³encoding standards´ have evolved over a period of time and are still evolving. We will discuss 5 popular ³encoding standards´ ± ASCII, ISO 8859, EBCDIC, UNICODE and UTF-8.

Encoding Scheme #1

ASCII (American Standard Code for Information

Interchange)

A consistent set of rules in which series of 0¶s and 1¶s are used to represent characters. This allows uniformity between data transfer among computer systems. Evolved from computers that could only work on 7-bit codes at a time. Computers then evolved into 8-bit machines, thus a leading ³0´ (zero) was placed at beginning to keep original ASCII code, but allowed for additional characters which are often referred to as the ³extended ASCII´ character set. Programmers when writing programs may need to access these ASCII characters (or control codes) by decimal, octal or hexadecimal number, so an ASCII table is available to provide assistance. You can issue command ³man ascii´ to find out more information regarding this encoding scheme.

Encoding Scheme #2

Extended ASCII: ISO 8859 (International Organization for Standards #8859)

An encoding scheme to provide additional characters from the extra bit added to the already existing 7-bit ASCII code. There are sets 1 (ISO 8859-1) and more recently set 15 (ISO 885915) which are used to represent most western European symbols). Other sets in between include set 2 (ISO 8859-1) use to represent most eastern European symbols and set 10 (ISO 8859-10) used to represent Lap/Nordic/Eskimo symbols and so forth« ISO 8859 tables are accessible from the internet by performing a net search on ³ISO 8859 Tables´. There are also links on the UNX122 webpage.

You can issue command ³man iso_8859_1´, etc. to find out more information regarding these encoding schemes.

Encoding Scheme #3

EBCDIC (Extended Binary Coded Decimal

Interchange Code)

An 8-bit binary code used on IBM mainframe computers. The rules for 0¶s and 1¶s in a binary code to represent characters, differerent from ASCII, but there are programs (including the FTP command) that can transfer ASCII files to EBCDIC files to allow transfer of data between different types of computers. An EBCDIC Table also exists (see link on UNX122 webpage).

**Encoding Schemes for the Future
**

As economies move to a more ³global environment´ there is a move towards an encoding scheme that will simultaneously incorporate all the world language symbols into one large encoding scheme. This would avoid ³fragmented´ encoding schemes previously discussed and allow programs to easily translate and transfer data among different countries.

Encoding Scheme #4

UNICODE (Universal Character Set / ISO 10646) 16-bit encoding scheme used to represent over 65,000 characters. This encoding scheme will allow most world language symbols due to the additional 8 bits in the code. Unicode is currently in use for many PC¶s running Windows 98 and up, and is considered to be the latest trend in data representation to foster global communication.

THANK YOU

conversation of number system

conversation of number system

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd