0% found this document useful (0 votes)
18 views7 pages

MODULE 4 Data Representation

Module 4 covers data representation in computers, explaining the use of character types (alphabetic, numeric, special) and the binary system for data storage. It details various number systems (decimal, binary, octal, hexadecimal) and conversion methods between them, as well as character representation codes like ASCII, ANSI, EBCDIC, and Unicode. Additionally, it discusses file formats such as JPEG, MP3, and PDF, emphasizing their characteristics, applications, and the importance of compression techniques.

Uploaded by

sharonadisa569
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views7 pages

MODULE 4 Data Representation

Module 4 covers data representation in computers, explaining the use of character types (alphabetic, numeric, special) and the binary system for data storage. It details various number systems (decimal, binary, octal, hexadecimal) and conversion methods between them, as well as character representation codes like ASCII, ANSI, EBCDIC, and Unicode. Additionally, it discusses file formats such as JPEG, MP3, and PDF, emphasizing their characteristics, applications, and the importance of compression techniques.

Uploaded by

sharonadisa569
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

MODULE 4: DATA REPRESENTATION

Program instruction and data are made up of a combination of three types of characters.
Alphabetic (A - Z), Numeric (0 - 9) and special (all other characters E.G @, #, $). The data and
program instructions are being stored character by character. Each character in storage has got
its electrical representation which uniquely identifies it.

All digital computers use some variation of binary numbering system for representation of
characters. The binary numbering system has only two digits 0 and 1. 1 denotes the presence of
electrical pulse and 0 denotes the absence of such a signal.

The computer is unable to understand the supplied data represented by these symbols. To make
communication possible between a computer and man, data must be coded in a form
understandable to the computer and the information supplied by a computer, as a result of data
processing, must be decoded in the form understandable to the user. The responsibility of coding
and decoding in a computer system lies with the input-output devices.

Number Systems
A number system is a set of symbols or numbers combined with rules for how these numbers are
used. The various number systems are:
 Decimal number system
 Binary number system
 Octal number system
 Hexadecimal number system.

Decimal System
This consists of ten digits 0 –9. Each digit has a digit value 0 to 9. Because the decimal system
is used almost universally, basic arithmetic performed by a person in one country is easily
understood by a person in another country.
In a decimal system each digit has a positional value determined by how many places to the left
or the right of the decimal point the digit is written.

Binary System:
This is a base two number system since it uses only two digits 0 and 1 called the binary digits.
Its lowest digit is 0 and the highest digit is 1 – one less than the base of 2. Internally, the
computer uses binary number system since the two digits 1 and 0 represent the two electrical
states, on and off.
Machine language uses binary number system to provide instructions for the CPU. It is the most
basic language for the computer. It requires no translation to be understood. Binary numbers
tend to be much longer than their decimal equivalents.
Programmers, who work in assembly language and in high-level languages that enable
programmes to reach down to the machine level, find it cumbersome to work with binary
numbers.
For this reason, two other systems, the octal system (base 8) and the hexadecimal system (base
16) – are used primarily because they make it convenient to abbreviate binary numbers.
Converting a decimal number to binary involves representing the decimal number using only the
digits 0 and 1, which are the base-two digits. Here's how you can convert a decimal number to
binary

Step 1 : Start with the decimal number you want to convert. Let's say we have the decimal
number 22
Step 2: Divide the decimal number by 2 and write down the quotient (result of division) and the
remainder (0 or 1). For example, when you divide 23 by 2:
23÷2 = 11 Remainder 0
Step 3: Take the quotient from Step 2 (in this case, 11), and repeat the division process until the
quotient becomes 0.
11÷2 = 5 Remainder 1
5÷2 = 2 Remainder 1
2 ÷ 2 = 1 Remainder 0
1 ÷ 2 = 0 Remainder 1

Step 4: Take the remainder and write it down. This will be the least significant bit (LSB) of your
binary representation. In our example, the LSB is 1.
Result : 10110

So, in binary, the decimal number 22 is represented as 10110

Converting a binary number to decimal


Converting a binary number to decimal involves calculating the decimal equivalent of a binary
representation.
Step 1: Start with the binary number you want to convert. Let's say we have the binary number
11011 as an example.

Step 2: Assign a place value to each digit in the binary number, starting from the right (the least
significant bit or LSB) and doubling the place value as you move to the left. For example:
1 (LSB) has a place value of 2^0 = 1.
1 to the left of it has a place value of 2^1 = 2.
0 to the left of that has a place value of 2^2 = 4.
1 to the left of that has a place value of 2^3 = 8.
1 to the left of that has a place value of 2^4 = 16.

Step 3: Multiply each binary digit by its corresponding place value and sum up the results. In our
example:
1*1=1
1*2=2
0*4=0
1*8=8
1 * 16 = 16

Step 4: Add up the results from Step 3 to get the decimal equivalent:
1 + 2 + 0 + 8 + 16 = 27
So, in decimal, the binary number 11011 is equivalent to 27.

Octal System:
It uses 8 digits from 0 – 7. Because 8 is an integral power of 2 i.e. 810 = 2310, one octal digit has a
value equivalent to that of a group of three binary digits and vice versa. This relationship
simplifies the programming of digital computers, since the octal system may be used in place of
the more cumbersome binary system.
Converting a decimal number to octal involves representing the decimal number using only the
digits 0 to 7, which are the base-eight digits.
Step 1: Start with the decimal number you want to convert.
For example decimal number 123.
Step 2: Divide the decimal number by 8 and write down the quotient (result of division) and the
remainder (a digit between 0 and 7). For example, when you divide 123 by 8:
123 ÷ 8 = 15 (remainder of 3)
Step 3: Take the remainder and write it down. This will be the least significant digit (LSB) of
your octal representation. In our example, the LSB is 3.
Step 4: Take the quotient from Step 2 (in this case, 15), and repeat the division process until the
quotient becomes 0.
15 ÷ 8 = 1 Remainder 7
1 ÷ 8 = 0 Remainder 1

Step 5: Write down the remainders in reverse order to get the octal representation. In our
example, the remainders are 1, 7, and 3. So, the octal representation of 123 is 173.

Converting an octal number to decimal


It involves calculating the decimal equivalent of an octal representation.
Step 1: Start with the octal number you want to convert. Example of the octal number 173.
Step 2: Assign a place value to each digit in the octal number, starting from the right (the least
significant digit or LSD) and multiplying the digit by the appropriate power of 8 as you move to
the left. For example:
3 (LSD) has a place value of 8^0 = 1.
7 to the left of it has a place value of 8^1 = 8.
1 to the left of that has a place value of 8^2 = 64.
Step 3: Multiply each octal digit by its corresponding place value and sum up the results. In our
example:
3*1=3
7 * 8 = 56
1 * 64 = 64
Step 4: Add up the results from Step 3 to get the decimal equivalent:
3 + 56 + 64 = 123
So, in decimal, the octal number 173 is equivalent to 123.

Hexadecimal Systems
This is a base 16 number system that uses 16 symbols; the digits 0 to 9, then the letters A to F to
represent the numbers 10 to 15. The number 16 is also an integral power of 2 that is, 1610 , 2410.
Thus, one hexadecimal digit has a value equivalent to that of a group of four binary digits and
vice versa.
Converting a decimal number to hexadecimal involves representing the decimal number using
the base-sixteen digits, which include the numbers 0-9 and the letters A-F. Here's how you can
convert a decimal number to hexadecimal:
Step 1: Start with the decimal number you want to convert. Let's say we have the decimal
number 255 as an example.
Step 2: Divide the decimal number by 16 and write down the quotient (result of division) and the
remainder (a digit between 0 and 15, which can be represented as 0-9 or 10 = A, 11= B, 12=C,
13=D, 14=E , 15=F). For example, when you divide 255 by 16:
Quotient: 15 (with a remainder of 15)
Step 3: Take the remainder and write it down in hexadecimal format. In our example, the
remainder is 15, which is represented as "F" in hexadecimal.
Step 4: Take the quotient from Step 2 (in this case, 15), and repeat the division process until the
quotient becomes 0.
Divide 15 by 16:
Quotient: 0 (with a remainder of 15)
Step 5: Write down the remainders in reverse order to get the hexadecimal representation. In our
example, the remainders are 15 and 15. So, the hexadecimal representation of 255 is "FF."
So, in hexadecimal, the decimal number 255 is represented as "FF."

Converting a hexadecimal number to decimal involves calculating the decimal equivalent of a


hexadecimal representation.

Step 1: Start with the hexadecimal number you want to convert. Let's say we have the
hexadecimal number "1A" as an example.
Step 2: Assign a place value to each digit in the hexadecimal number, starting from the right (the
least significant digit or LSD) and multiplying the digit by the appropriate power of 16 as you
move to the left. For example:
"A" (LSD) has a place value of 16^0 = 1.
"1" to the left of it has a place value of 16^1 = 16.
Step 3: Convert any hexadecimal letters (A-F) to their decimal equivalents:
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15
In our example, "A" is equivalent to 10 in decimal.
Step 4: Multiply each hexadecimal digit (including the converted letters) by its corresponding
place value and sum up the results. In our example:
"A" (converted to 10) * 1 = 10
"1" * 16 = 16
Step 5: Add up the results from Step 4 to get the decimal equivalent:
10 + 16 = 26
So, in decimal, the hexadecimal number "1A" is equivalent to 26.
Exercises
(i) Convert the following numbers to the indicated numbering system.

i) 1507.068 to binary [1101000111.0001102]


ii) 1101000111.0001102 to decimal [839 .0937510]
iii) 777. 778 to binary to decimal [111111111 .1111112 and 511. 984410 (rounded off)]
iv) 10111 .1011012 to decimal [23 .70312510]
v) 6366. 368 to decimal [3318. 4687510]
vi) 983. 983 to octal [1727. 76728]
v) 7106. 532 to binary [1101111000010. 1000100000112]
Bits
These are the on and off pulses or each 1 or 0 that represent the data.
A byte is a collection of 8 bits or a one character of data. Each storage position in memory is
called a byte. The size of memory of a computer is measured in thousands of bytes.

1,024 bytes = 1 kilobyte (1K) - usually rounded off to 1000 bytes.


1 000 Kilo bytes = I Megabytes (MB)
1 000 Megabytes = 1 Gigabytes (GB)

Representing Characters
Character representation refers to the way non-numeric data, such as a letter of the alphabet or a
punctuation mark is represented by a series of bits. Character representation code, simply
referred to as code is a series of bits that represents a letter, symbol or numerical.
The three character representation codes most widely used are ASCII, ANSI and EBCDIC. A
fourth code Unicode has been proposed for future world wide use.

ASCII - American standard code for information interchange code.


This coding system is used in many mini computers to represent 27 (=128) symbols including
uppercase and lowercase letters, special control codes, numerals and punctuation symbols.
There is one additional parity bit.

ANSI - American National Standards Institute Code


This code uses 8 bits to represent each character. They can convey up to 28 (= 256) units of
information so it can be used to code 256 letters and symbols. It is used in Microsoft windows to
store documents.

EBCDIC - Extended Binary Coded Decimal Interchange Code


This is an 8 -bit character representation code developed by IBM for its mainframe computers. It
does not use the same code as ASCII or ANSI for the initial 128 character.

Unicode: is a 16 -bit code that can represent 65000 different characters. It can represent any
character in every language used today.

File Formats and their applications


File formats play a critical role in storing and representing digital data efficiently. Different file
formats are optimized for specific types of data and applications. In this lecture, we will explore
the characteristics, applications, and significance of file formats like JPEG, MP3, PDF, and
compression techniques.

JPEG (Joint Photographic Experts Group)


Characteristics:
 Lossy Compression: JPEG uses lossy compression to reduce file size. It achieves
compression by discarding some image data, which can result in a slight loss of quality.
 Image Format: Primarily used for images and photographs.
 Color Space: Supports both grayscale and color images, making it versatile.
 Variable Quality: JPEG allows users to choose the level of compression and, consequently,
the trade-off between image quality and file size.
Applications:
 Digital Photography: JPEG is the most common format for storing digital photographs due to
its efficient compression.
 Web Graphics: JPEG is widely used for web images, as it balances quality and file size for
faster web page loading.
 Print Media: It is used in magazines, brochures, and other printed materials.

MP3 (MPEG-1 Audio Layer III)


Characteristics:
 Lossy Compression: MP3 uses lossy compression to reduce the file size of audio data.
 Audio Format: Designed for audio files, such as music and podcasts.
 Variable Bit Rate: MP3 allows for different bit rates, offering a trade-off between sound
quality and file size.
 Human Auditory Perception: It takes advantage of the limitations of human hearing to
discard less important audio data.
Applications:
 Music Streaming and Storage: MP3 is the standard format for digital music files, making it
ideal for online streaming services and portable music players.
 Podcasting: Most podcasts are distributed in MP3 format due to its compatibility and small
file size.
 Audiobooks: MP3 is commonly used for distributing audiobooks.

PDF (Portable Document Format)


Characteristics:
 Universal Format: PDF is a universal file format that preserves fonts, images, graphics, and
layout regardless of the software or hardware used to view it.
 Fixed Layout: PDF documents have a fixed layout, ensuring consistency in appearance.
 Interactive Elements: PDFs can contain interactive elements like hyperlinks, forms, and
multimedia.
 Encryption and Security: PDFs support encryption and password protection for document
security.
Applications:
 Document Sharing: PDFs are used for sharing documents while ensuring they look the same
on different devices and platforms.
 E-books: Many e-books are distributed in PDF format because of its consistency and
compatibility.
 Forms and Contracts: PDFs are used for creating and signing digital forms and contracts.
 Archiving: PDF/A, a subset of PDF, is used for long-term archiving of electronic documents.

Compression Techniques
Characteristics:
 Data Reduction: Compression reduces the size of files, which is crucial for efficient storage
and transmission.
 Lossless vs. Lossy: There are two main types of compression: lossless (no data loss) and
lossy (some data loss).
 Algorithms: Various compression algorithms are used, including Huffman coding, Run-
Length Encoding (RLE), and Deflate (used in ZIP files).
 Compression Utilities: Software tools like WinZip, 7-Zip, and gzip are used for compressing
and decompressing files.
Applications:
 File Transfer: Compression reduces the time and bandwidth required to transfer files over the
internet.
 Backup and Archiving: Compressing files before backup reduces storage space requirements.
 Multimedia Streaming: Lossy compression is used for streaming audio and video to optimize
bandwidth usage.
 Efficient Storage: Compression is essential in reducing the storage space needed for large
datasets, databases, and archives.

File formats and compression techniques are fundamental to digital data management.
Understanding the characteristics and applications of formats like JPEG, MP3, PDF, and various
compression methods is essential for effective data handling, storage, and transmission in diverse
domains. These technologies continue to evolve, shaping how we interact with digital
information in an increasingly interconnected world.

You might also like