Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
9 views28 pages

Data Representation 1

The document discusses data representation in computer systems, focusing on number systems such as binary, denary, and hexadecimal. It explains the significance of binary as the fundamental format for data representation, detailing how binary numbers are converted to denary and vice versa. Additionally, it provides examples and exercises for converting between binary and denary systems.

Uploaded by

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

Data Representation 1

The document discusses data representation in computer systems, focusing on number systems such as binary, denary, and hexadecimal. It explains the significance of binary as the fundamental format for data representation, detailing how binary numbers are converted to denary and vice versa. Additionally, it provides examples and exercises for converting between binary and denary systems.

Uploaded by

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

Computer

Systems
DATA REPRESENTATION
DATA REPRESENTATION

• Number Systems

• Text , Sound and Images

• Data Storage and Compression


Number Systems

• Data is represented in Computer Systems in one format.

• That is Binary !!

• Binary indicates only ‘0’ and ‘1’.


Why Binary ?

• Computers contain millions of tiny “switches”.

• They can be in either “ON” or “OFF” position.

• Hence they are represented by a Binary system.

• ON indicates 1 and OFF indicates 0.

• Switches make use of Logic Gates (covered later


in the course).
Types of Number Systems

Binary Denary Hexadecimal


Denary

• The number system which you have been using since the time you have learned counting !!

• Also called as Base 10 number system or Decimal.

• Multiples of 10 and gives the headings of 1s, 10s, 100s, 1000s, 10000s, and so on. They can also
be represented as 101, 102, 103, 104 respectively.

• However, to avoid confusion with the Decimal datatype, it is better to address this system as
DENARY.
• It uses ten separate digits from 0 to 9, to represent all values.

Denary
Representat
ion
• Calculation of the example from

Denary the previous slide.

Representatio • (8 * 10000) + (7 *1000) + (2 *100) +


(3 * 10) + (9 *1) = 87239
n
• Also called as Base 2 Number system as
it is based on the number 2.

Binary • Only 2 values  0 and 1 are used in this


number system to represent all values.

• Following the same method as in


denary it gives the headings as 20, 21, 22,
23, etc.
Binary
Representation
23 22 21 20
• A simple example of a 4-bit binary
8 4 2 1 number representation with the
headings.
0 1 0 1
Binary Representation

• The binary number shown in the previous slide is  0101.


Binary
Representation
27 26 25 24 23 22 21 20
• Similarly for an 8 digit Binary
128 64 32 16 8 4 2 1 number
0 1 1 0 0 0 0 1
Binary Representation

• The binary number shown in the previous slide is  0110 0001.


Binary to • Of course Binary is understood by Computers
and is easy to represent, but we humans
Denary cannot decipher a binary number immediately.

• Hence, we need to convert the same into


Denary, the number system with which we are
comfortable.

• Before seeing the conversion, few important


tips and pointers which will help in a quick
conversion.
• Better to know the 2s table at least till 2 to the power of 10. It
will come handy.

• No calculators will be allowed.

• Important point to remember is that in the Binary number

Tips to
representation, if the Least Significant Bit (LSB which is the
last digit (from left to right)) is ‘1’ means it is an Odd Number
else it is an Even Number.

remember !! • If the Binary number says 4 bit or 8 bit and the number of
digits in the number is less than either 4 or 8, then add 0s
before the first number.

• For instance, if a number is 1000011, then it can be


represented in 8-bit as 0100 0011
2s Table

211 210 29 28 27 26 25 24 23 22 21 20

2048 1024 512 256 128 64 32 16 8 4 2 1


Binary to • Each time a 1 appears in the Binary Number column, the column value or
the heading is added to the total.

Denary • For instance, take the 4 bit binary number which we saw earlier  0101

• So, we have 1s in the places of 22 and 20.

• Thus, it will be 0 + 4 + 0 + 1 = 5, the corresponding Denary Number !!

• Before moving on to examples of higher bits, let us look at a couple of 4


bit conversions.
Example • Convert the 4 bit binary number 0111 to the corresponding Denary.

1 • Solution

• 0+4+2+1=7

• Explanation: Upon examining the number which is of 4 bits, 4th bit is 0 and
remaining all are 1.

• Now, we are familiar with the headings, which in this case will be from 20 to 23.

• According to the number given, the heading for the 4th bit which is 23 is 0. Hence
its value will be 0 and for the remaining 3 headings it will be their corresponding
values, i.e. 4, 2 and 1.

• Summing up, we get 7 which is as shown above.


Example 2

• Convert the 4 bit binary number 1101 to the corresponding Denary.

• Solution

• 8 + 4 + 0 + 1 = 13
Exercise – 1
Convert the following 4 bit Binary Numbers to Denary.
0011
1111
0001
011
100
Example 1 –
• Convert the 8 Bit binary number 01011101

8 Bit Binary • Method remains the same. Only calculations increase.

Number • So, in the above given Binary Number we have 1s in


the following headings – 26, 24, 23, 22, 20.

• Calculations:
• 0 + 64 + 0 + 16 + 8 + 4 + 0 + 1 = 93

• 93 is the corresponding Denary Number.


Example 2 – • 11101110 to Denary
• Following the same steps as in Example 1
8 Bit Binary for 8 Bits, we have the headings from 20 till
2 7.
Number
• Calculations

• 128 + 64 + 32 + 0 + 8 + 4 + 2 + 0 = 238

• 238 is the corresponding Denary Number.


Example 3 – • Convert 011110001011 to Denary

12 Bit Binary • Following the same steps as in Example 1 for 8


Bits, we have the headings from 20 till 211 .
Number
• Calculations

• 0 + 1024 + 512 + 256 + 128 + 0 + 0 + 0 + 8 + 0 + 2


+ 1 = 1931

• 1931 is the corresponding Denary Number.


Example 4 – • Convert 0011000111100110 to Denary

16 Bit Binary • Following the same steps as in Example 1 for 8


Bits, we have the headings from 20 till 215 .
Number
• Calculations

• 0 + 0 + 8192 + 4096 + 0 + 0 + 0 + 256 + 128 + 64 +


32 + 0 + 0 + 4 + 2 + 0 = 12,774

• 12,774 is the corresponding Denary Number.


Exercise – 2
Convert the following Binary Numbers to Denary.
10011001
10001111
0111 1111 1111 1111
0001 1110 0111
0111 1100 1111 0000
Denary to • Conversion from Denary to Binary can be done
in 2 ways.
Binary
• First method uses Successive Subtraction of
powers of 2

• Second method uses Successive Division by 2


until 0 is reached.
Example 1
• Convert the denary number 142 to binary.
• Method 1

• 142 = 128 + 8 + 4 + 2

• This is obtained by 142 – 128 = 14, 14 – 8 = 6, 6 – 4 = 2, 2 – 2 = 0.

• In each stage, largest possible power of 2 is subtracted until 0 is


reached.
Example contd…
• Following this, below Binary number is obtained.

You might also like