0% found this document useful (0 votes)
3 views

IT UNIT 2 PT 1 Notes

Data representation involves converting information into a format suitable for storage and processing by computers, utilizing various data structures and encoding schemes. It encompasses both non-positional and positional number systems, with common formats including binary, ASCII, and Unicode. Additionally, error detection techniques such as parity checks and checksums are essential for ensuring data integrity during transmission.

Uploaded by

sgzahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

IT UNIT 2 PT 1 Notes

Data representation involves converting information into a format suitable for storage and processing by computers, utilizing various data structures and encoding schemes. It encompasses both non-positional and positional number systems, with common formats including binary, ASCII, and Unicode. Additionally, error detection techniques such as parity checks and checksums are essential for ensuring data integrity during transmission.

Uploaded by

sgzahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Data Representation

Data Representation
Introduction
• Data representation is the process of converting information into a form that
can be stored, processed, and transmitted by a computer.
• It involves the use of various data structures and encoding schemes to
represent different types of data, such as numbers, text, images, and sound.
• Data representation is a fundamental topic in computer science.
• It is used in a variety of applications, such as programming, database
management, and networking.
• Understanding how data is represented is essential for designing and
implementing efficient and reliable software systems.
Data Representation
Introduction
• In Digital Computer, data and instructions are stored in computer memory using
binary code (or machine code) represented by Binary digits 1 and 0 called BIT’s.
The data may contain digits, alphabets or special character, which are converted
to bits, understandable by the computer.
• The number system uses well defined symbols called digits.
• Number systems are basically classified into two types.
• They are:
• Non-positional number system

• Positional number system


Data Representation
Non-positional number system (Data format)
• In olden days people use of this type of number system for simple calculations
like additions and subtractions.
• The non-positional number system consists of different symbols that are used
to represent numbers.
• Roman number system is an example of the non-positional number system.
• i.e. I=1, V=5, X=10, L=50.
• This number system cannot be used effectively to perform arithmetic
operations.
Data Representation
Positional number system (Data format)
(Polar Number system)
• This type of number system are:
• Decimal number system
• Binary number system
• Octal number system
• Hexadecimal number system
• The total number of digits present in any number system is called its Base or Radix.
• Every number is represented by a base (or radix) x, which represents x digits.
• The base is written after the number as subscript such as 512(10).It is a Decimal number as
its base is 10.
• To determine the quantity that the number represents, the number is multiplied by an
integer power of x depending on the position it is located and then finds the sum of the
weighted digits
Data Representation
Positional number system (Data format)
Data Representation
Common Formats of Data Representation
• There are some common data representation format which we commonly use

• Decimal Code : It is mostly used in number system. It consist of 10 digit from 0


to 9.

• Binary code: A binary code is a system that represents numbers and other data
using only two symbols, 0 and 1. It is the most common data representation
format used in computers.

• ASCII: The American Standard Code for Information Interchange (ASCII) is a


character encoding scheme that represents each letter, number, and symbol
with a unique 7-bit binary code.
Data Representation
Formats of Data Representation
• ISCII : ISCII stands for Indian Standard Code for Information Interchange. It uses
a 8-bit code and it can represent 256 characters.

• Unicode: Unicode is a universal character encoding standard that supports a


wider range of characters than ASCII, including those from different languages
and scripts.

• Decimal: The decimal system is a number system that uses ten digits, 0 to 9, to
represent numbers. It is the most common number system used by humans.

• Hexadecimal: The hexadecimal system is a number system that uses sixteen


digits, 0 to 9 and A to F, to represent numbers. It is often used in computer
programming and networking.
Data Representation
Formats of Data Representation
• Unicode: Unicode is a universal character encoding standard that supports a
wider range of characters than ASCII, including those from different languages
and scripts.

• Decimal: The decimal system is a number system that uses ten digits, 0 to 9, to
represent numbers. It is the most common number system used by humans.

• Hexadecimal: The hexadecimal system is a number system that uses sixteen


digits, 0 to 9 and A to F, to represent numbers. It is often used in computer
programming and networking.
Number system table:
Number System Conversions
Conversion from Decimal to Binary:
Steps to convert decimal number to binary number:
• Step 1: Divide the given decimal number by 2.
• Step 2: Take the remainder and record it on the right
side.
• Step 3: Repeat the Step 1 and Step 2 until the decimal
number cannot be divided further.
• Step 4: The first remainder will be the LSB and the last
remainder is the MSB. The equivalent binary number is
then written from left to right i.e. from MSB to LSB.
Example: To convert the decimal number 87(10) to binary.
• So 87 decimal is written as 1010111 in binary.
• It can be written as 87(10)= 1010111(2)
Number System Conversions
Conversion from Decimal to Binary:
Steps to convert decimal fraction number to binary number:

• Step 1: Multiply the given decimal fraction number by 2.


• Step 2: Note the carry and the product.
• Step 3: Repeat the Step 1 and Step 2 until the decimal number cannot
be divided further.
• Step 4: The first carry will be the MSB and the last carry is the LSB. The
equivalent binary
• fraction number is written from MSB to LSB.
Number System Conversions
Conversion from Decimal to Binary:
Number System Conversions
Conversion from Decimal to Binary:
Number System Conversions
Conversion from Decimal to Binary:
Number System Conversions
Conversion from Binary to Decimal:
• Step 1: Start at the rightmost bit.
• Step 2: Take that bit and multiply by 2n, when n is the current
position beginning at 0 and
• increasing by 1 each time. This represents a power of two.
• Step 3: Then, add all the products.
• Step 4: After addition, the resultant is equal to the decimal value of
the binary number.
Number System Conversions
Conversion from Binary to Decimal:
Number System Conversions
Conversion from Binary to Decimal:
Number System Conversions
Conversion from Decimal to Octal :

Steps to convert decimal number to octal number

• Step 1: Divide the given decimal number by 8.


• Step 2: Take the remainder and record it on the side.
• Step 3: Repeat the Step 1 and Step 2 until the decimal number cannot be
divided further.
• Step 4: The first remainder will be the LSB and the last remainder is the
MSB. The equivalent
• octal number is then written from left to right i.e. from MSB to LSB.
Number System Conversions
Conversion from Decimal to Octal :
Example : To convert the decimal number 3034(10) to octal number.

So 3034 decimal is written as 5732 in octal.


It can be written as 3034(10) = 5732(8)
Number System Conversions
Conversion from Decimal to Octal :
Example : To convert the decimal number 3034(10) to octal number.

Note:
If the number is less than 8 the
octal number is same as decimal
number.

So 3034 decimal is written as 5732 in octal.


It can be written as 3034(10) = 5732(8)
Number System Conversions
Conversion from Decimal to Octal :
Example 2: To convert the decimal number 0.3125(10) to octal number.

Note:
If the number is less than 8 the
octal number is same as decimal
number.
Therefore, 0.3125(10) = 0.24(8)
Number System Conversions
Conversion from Octal to Decimal :
Steps to convert octal number to decimal number

• Step 1: Start at the rightmost bit.


• Step 2: Take that bit and multiply by 8n, when n is the current
position beginning at 0 and
• increasing by 1 each time. This represents the power of 8.
• Step 3: Then, add all the products.
• Step 4: After addition, the resultant is equal to the decimal value of
the octal number.
Number System Conversions
Conversion from Octal to Decimal :
Example : To convert the octal or base-8 number 5732(8) to decimal

Therefore, 5732(8) = 3034(10)


Number System Conversions
Conversion from Octal to Decimal :
Example : To convert the octal number 234.56(8) to decimal number.

Therefore, 234.56(8) = 156.71875(10)


Number System Conversions
Conversion from Decimal to Hexadecimal :

Steps to convert decimal number to hexadecimal number

• Step 1: Divide the decimal number by 16.


• Step 2: Take the remainder and record it on the side.
• Step 3: Repeat the Step 1 and Step 2 until the decimal number cannot be
divided further.
• Step 4: The first remainder will be the LSB and the last remainder is the
MSB. The equivalent hexadecimal number is then written from left to
right i.e. from MSB to LSB.
Number System Conversions
Conversion from Decimal to Hexadecimal :
Example To convert the decimal number 16242(10) to hexadecimal

Note:
If the number is less than 16 the
hexadecimal number is
same as decimal number.

• So 16242 decimal is written as 3F72 in


hexadecimal.
• It can be written as 16242(10) = 3F72 (16)
Number System Conversions
Conversion from Hexadecimal to Decimal :
Steps to convert hexadecimal number to decimal number

• Step 1: Start at the rightmost bit.


• Step 2: Take that bit and multiply by 16n, where n is the current
position beginning at 0 and
• increasing by 1 each time. This represents a power of 16.
• Step 3: Then, add all the products.
• Step 4: After addition, the resultant is equal to the decimal value of
the hexadecimal number.
Number System Conversions
Conversion from Hexadecimal to Decimal :
Example : To convert the Hexadecimal or base-16 number 3F72 to a decimal
number

Therefore, 3F72(16)= 16242(10)


Number System Conversions
Conversion from Hexadecimal to Decimal :
Example 2: To convert the hexadecimal number 5AF.D(16) to decimal number.

Therefore, 5AF.D(16) = 1455.8125(10)


Number System Conversions
Conversion from Binary to Octal :
Steps to convert Binary to octal
• Take a binary number in groups of 3 and use the appropriate octal digit in its
place.
• Begin at the rightmost 3 bits. If we are not able to form a group of three, insert
0s to the left
• until we get all groups of 3 bits each.
• Write the octal equivalent of each group. Repeat the steps until all groups have
been converted.
Number System Conversions
Conversion from Binary to Octal :

Note:
To make group of 3 bits, for
whole numbers, it may be
necessary to add a 0’s to the
left of MSB and when
representing fractions, it may
be necessary to add a 0’s to
right of LSB.
Number System Conversions
Conversion from Octal to Binary :
Steps to convert octal to binary
• Step 1: Take the each digit from octal number
• Step 2: Convert each digit to 3-bit binary number. (Each octal digit is
represented by a three bit binary number as shown in Numbering System
Table)
Number System Conversions
Conversion from Octal to Binary :
Number System Conversions
Conversion from Binary to Hexadecimal :
Steps to convert Binary to Hexadecimal

• Take a binary number in groups of 4 and use the appropriate hexadecimal


digit in its place.
• Begin at the rightmost 4 bits. If we are not able to form a group of four,
insert 0s to the left until we get all groups of 4 bits each.
• Write the hexadecimal equivalent of each group. Repeat the steps until all
groups have been converted.
Number System Conversions
Conversion from Binary to Hexadecimal :
Number System Conversions
Conversion from Hexadecimal to Binary :
Steps to convert hexadecimal to binary
• Step 1: Take the each digit from hexadecimal number
• Step 2: Convert each digit to 4-bit binary number. (Each hexadecimal digit
is represented by a four-bit binary number as shown in Numbering System
Table)
Example: Consider the hexadecimal number CEBA(16)

Therefore, CEBA(16) = 1100 1110 1011 1010 (2)


Data Representations

Errors and Error Detection


Data Representations
Errors and Error Detection
• When bits are transmitted over the computer network, they are subject to get
corrupted due to interference and network problems. The corrupted bits leads to
spurious data being received by the receiver and are called errors.

• Error detection techniques are responsible for checking whether an error has
occurred or not in the frame that has been transmitted via the network. It does
not take into account the number of error bits and the type of error.

• For error detection, the sender needs to send some additional bits along with the
data bits. The receiver performs necessary checks based upon the additional
redundant bits. If it finds that the data is free from errors, it removes the
redundant bits before passing the message to the upper layers.
Data Representations
Error-detecting codes
• Error-detecting codes are a sequence of numbers generated by specific
procedures for detecting errors in data that has been transmitted over computer
networks.

• When bits are transmitted over the computer network, they are subject to get
corrupted due to interference and network problems. The corrupted bits leads to
spurious data being received by the receiver and are called errors.

• Error – detecting codes ensures messages to be encoded before they are sent
over noisy channels. The encoding is done in a manner so that the decoder at the
receiving end can detect whether there are errors in the incoming signal with
high probability of success.
Data Representations
Features of Error Detecting Codes
• Error detecting codes are adopted when backward error correction techniques
are used for reliable data transmission. In this method, the receiver sends a
feedback message to the sender to inform whether an error-free message has
been received or not. If there are errors, then the sender retransmits the
message.

• Error-detecting codes are usually block codes, where the message is divided into
fixed-sized blocks of bits, to which redundant bits are added for error detection.

• Error detection involves checking whether any error has occurred or not. The
number of error bits and the type of error does not matter.
Data Representations
Error Detection Techniques
• There are three main techniques for detecting errors
• Parity Check
• Checksum
• Cyclic Redundancy Check (CRC)
Data Representations
Parity Check
• Parity check is done by adding an extra bit, called parity bit to the data to make
number of 1s either even in case of even parity, or odd in case of odd parity.

• While creating a frame, the sender counts the number of 1s in it and adds the
parity bit in following way

• In case of even parity: If number of 1s is even then parity bit value is 0. If


number of 1s is odd then parity bit value is 1.

• In case of odd parity: If number of 1s is odd then parity bit value is 0. If


number of 1s is even then parity bit value is 1.
Data Representations
Parity Check
• On receiving a frame, the receiver counts the number of 1s in it. In case of even
parity check, if the count of 1s is even, the frame is accepted, otherwise it is
rejected. Similar rule is adopted for odd parity check.

• Parity check is suitable for single bit error detection only.


Data Representations
Parity Bits
• The parity check is done by adding an extra bit, called parity bit, to the data to
make the number of 1s either even or odd depending upon the type of parity.
The parity check is suitable for single bit error detection only.

• The two types of parity checking are


• Even Parity − Here the total number of bits in the message is made even.

• Odd Parity − Here the total number of bits in the message is made odd.
Data Representations
Error Detection by Parity Check
• Sender’s End − While creaDng a frame,
the sender counts the number of 1s in it
and adds the parity bit the value of
which is determined as follows -

• In the case of even parity: If a


number of 1s is even, the parity bit
value is 0. If a number of 1s is odd,
the parity bit value is 1.

• In case of odd parity: If a number


of 1s is odd, the parity bit value is 0.
If a number of 1s is even, the parity
bit value is 1.
Data Representations
Error Detection by Parity Check
• Receiver’s End − On receiving a frame, the receiver counts the number of 1s in it. In case
of even parity check, if the count of 1s is even, the frame is accepted, otherwise, it is
rejected. In case of odd parity check, if the count of 1s is odd, the frame is accepted,
otherwise, it is rejected.
Data Representations
Error Detection by checksum
• In checksum error detection scheme, the data is divided into k segments each
of m bits.
• In the sender’s end the segments are added using 1’s complement arithmetic
to get the sum. The sum is complemented to get the checksum.
• The checksum segment is sent along with the data segments.
• At the receiver’s end, all received segments are added using 1’s complement
arithmetic to get the sum. The sum is complemented.
• If the result is zero, the received data is accepted; otherwise discarded.
Data Representations
Error Detection by checksum

You might also like