[go: up one dir, main page]

0% found this document useful (0 votes)
19 views89 pages

Number System

The document outlines course contents on Data Representation, covering various number systems including Decimal, Binary, Octal, and Hexadecimal, along with their conversions. It explains the importance of binary arithmetic, signed and unsigned numbers, and binary coding schemes. Additionally, it provides detailed examples of conversions between different number systems and discusses logic gates.

Uploaded by

sharmilalamsal3
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)
19 views89 pages

Number System

The document outlines course contents on Data Representation, covering various number systems including Decimal, Binary, Octal, and Hexadecimal, along with their conversions. It explains the importance of binary arithmetic, signed and unsigned numbers, and binary coding schemes. Additionally, it provides detailed examples of conversions between different number systems and discusses logic gates.

Uploaded by

sharmilalamsal3
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/ 89

Course Contents

Unit-04:Data Representation (5 Hrs.)


 Introduction; Number System;
 Conversion from Decimal to Binary, Octal,
Hexadecimal;
 Conversion of Binary, Octal, Hexadecimal to Decimal;
Conversion of Binary to Octal, Hexadecimal;
Conversion of Octal, Hexadecimal to Binary;
 Binary Arithmetic;
Course Contents
Unit-05:Data Representation
 Introduction; Number System;
 Conversion from Decimal To Binary, Octal, Hexadecimal;
 Conversion of Binary, Octal, Hexadecimal To Decimal;
 Conversion of Binary To Octal, Hexadecimal;
 Conversion of Octal, Hexadecimal To Binary;
 Binary Arithmetic;
 Signed and Unsigned Numbers;
 Binary Data Representation;
 Binary Coding Schemes;
 Logic Gates
Course Contents
Introduction:
 We use computer to process data and get desire
output.
 The data input can be in the form of alphabets, digits,
symbols, audio, video etc but computer can only
understand 0 and 1 so data must be represented in
the computer in 0’s and 1’s.
We will study data representation in this chapter.
 Numeric data(0,1,2..9)
 Alphabetic data(A,B,C,…..Z)
 Alphanumeric data – Combination of any symbols
(A,BC,…Z), (0,1,2..9), or special characters (+,-, blank
etc)
Course Contents
Number System:
 There are infinite ways to represent a number.
 The four commonly associated with modern
computers and digital electronics are: Decimal,
Binary, Octal, and Hexadecimal.

 Decimal (base 10) is the way most human beings


represent numbers. Decimal is sometimes abbreviated as
dec.
 Decimal counting goes:
 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
and so on.
Course Contents
Number System:
 Binary (base 2) is the natural way most digital circuits
represent and manipulate numbers.

 Binary is sometimes abbreviated as bin.


 Binary counting goes:
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011,
1100, 1101, 1110, 1111, 10000, 10001, and so on.
Course Contents
Number System:
 Octal (base 8) was previously a popular choice for
representing digital circuit numbers in a form that is more
compact than binary.
 Octal is sometimes abbreviated as oct.
 Octal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21,
and so on.
Course Contents
Number System:
 Hexadecimal (base 16) is currently the most popular
choice for representing digital circuit numbers in a form
that is more compact than binary.
 Hexadecimal is sometimes abbreviated as hex.
 Hexadecimal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, and so
on.
Course Contents
Number System:
 Base number: The base of the number decides the valid
digits that are used to make a number. Decimal number
has a base 10, Octal is 8 and Hexadecimal is 16
 Face Value : The face value of a digit is the digit located at
that position. E.g. in decimal 52, face value at position 0 is
2 and face value at position 1 is 5
 Position Value: The position value of a digit is
(baseposition). E.g. in decimal number 52, the position value
of digit 2 is 100 and position value of digit 5 is 101.
Course Contents
Number System:
We are concerned with 4 kinds of number.
1. Decimal Number System – Base 10
2. Binary Number System – Base 2
3. Octal Number System – Base 8
4. Hexadecimal Number System – Base 16
 Number given as input to computer and output from
computer are generally in decimal number system and are
most understood by humans.
 But computer understand binary number system (0’s and
1’s). Binary data also represented internally as in Octal
and Hexa due to their ease of use.
Course Contents
Number System:
 All four number systems are equally capable of
representing any number.
 A number can be perfectly converted between the various
number systems without any loss of numeric value.
 Since the job of electrical and software engineers is to
work with digital circuits, engineers require number
systems that can best transfer information between the
human world and the digital circuit world.
Course Contents
Number System:
 An octal number (base 8) can be up to 1/3 the length of a
binary number (base 2). 8 is a whole power of 2 (23=8).
That means three binary digits convert neatly into one
octal digit.
 A hexadecimal number (base 16) can be up to 1/4 the
length of a binary number. 16 is a whole power of 2
(24=16). That means four binary digits convert neatly into
one hexadecimal digit.
 Unfortunately, decimal (base 10) is not a whole power of
2. So, it is not possible to simply chunk groups of binary
digits to convert the raw state of a digital circuit into the
human-centric format.
Course Contents
DECIMAL BINARY OCTAL HEXADECIMAL

0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 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
Course Contents
Conversion from Decimal to Binary: Example of 1792
Decimal
Operation Quotient Remainder Binary Result
Number
1792 ÷2= 896 0 0
896 ÷2= 448 0 00
448 ÷2= 224 0 000
224 ÷2= 112 0 0000
112 ÷2= 56 0 00000
56 ÷2= 28 0 000000
28 ÷2= 14 0 0000000
14 ÷2= 7 0 00000000
7 ÷2= 3 1 100000000
3 ÷2= 1 1 1100000000

1 ÷2= 0 1 11100000000

0 done.
Course Contents
Conversion from Decimal to Octal : Example to convert
1792 decimal to octal:

Decimal
Operation Quotient Remainder Octal Result
Number
1792 ÷8= 224 0 0
224 ÷8= 28 0 00
28 ÷8= 3 4 400
3 ÷8= 0 3 3400
0 done.
Course Contents
Conversion from Decimal to Hexadecimal:
Decimal Hexadecimal
Operation Quotient Remainder
Number Result

1792 ÷ 16 = 112 0 0
112 ÷ 16 = 7 0 00
7 ÷ 16 = 0 7 700
0 done.
Course Contents
Conversion from Decimal to Hexadecimal:

Decimal Hexadecimal
Operation Quotient Remainder
Number Result
48879 ÷ 16 = 3054 15 F
3054 ÷ 16 = 190 14 EF
190 ÷ 16 = 11 14 EEF
11 ÷ 16 = 0 11 BEEF
0 done.
Course Contents
Conversion of Binary to Decimal:
Convert binary number 1010(base 2) into decimal form

1010(base 2) = 1x23 + 0x22 + 1x21 + 0x20 = 8 + 0 + 2 + 0 = 10

So, the required decimal number is


110101(base 2) = 53(base 10)

Alternatively, (110101)2 = (53)10


Where, (base 10) means the number is in decimal number
system and (base 2) means the number is in binary number
system.
Course Contents
Conversion of Octal to Decimal:
Convert octal number 156(base 8) into decimal form

156 = 1x82 + 5x81 + 6x80 = 64 + 40 + 6 = 110


Course Contents
Conversion of Hexadecimal to Decimal:
Convert hexadecimal number A1(base 16) into decimal form
A1(base 16) = Ax161 + 1x160 = 10x161 + 1x160 = 160 + 1 = 161

So, the required decimal number is


A1(base 16) = 161(base 10)

Alternatively, (A1)16 = (161)10

Where, (base 10) means the number is in decimal number


system and (base 16) means the number is in hexadecimal
number system.
Course Contents
Conversion of Binary to Octal:
Steps:
1. Divide the binary digits into groups of 3 digits, starting
from the right.
2. Convert each group of 3 binary digits into 1 octal digit.
Convert Binary number 1001012 into Octal form

Step 1. Make groups of 3 digits from right 1001012


Groups: 1002 1012
Step 2. Convert each 3 digits group into 1 octal digit
1012 = = 58 1002 = 48 so, 1001012 = 458
Course Contents
Conversion of Binary to Hexadecimal:
Steps:
1. Divide the binary digits into groups of 4 digits, starting
from the right
2. Convert each group of 4 binary digits into 1 hexadecimal
digit
Convert Binary number 101001012 into Hexadecimal form
Step 1. Make groups of 4 digits from right 101001012
Groups: 10102 01012
01012 = 516
10102 = A16
Step 2. Combine the groups so, 101001012 = A516
Course Contents
Conversion of Octal to Binary:
Steps
1. Convert each octal digits into 3 digits binary group
2. Combine the groups
Convert Octal number 458 into Binary form

Step 1. Convert each octal digit into 3 digits binary group


458 Groups: 48 58
58 = 1012
48 = 1002
Step 2. Combine the groups
so, 458 = 1001012
Course Contents
Conversion of Hexadecimal to Binary:
Steps
1. Convert each hexadecimal digit into group of 4 digits
binary
2. Combine the groups
Convert Hexadecimal number A516 into Binary form
Step1. Convert each hexadecimal digit into group of 4 digits binary A516
Groups: A16 516
516 = 01012
A16 = 10102
Step2. Combine the groups
so, A516 = 101001012
Course Contents
Octal to Hexadecimal conversion:
Steps
1. Convert each octal digit into groups of 3 digits binary
2. Combine the groups from step 1
3. Divide the binary digits from step 2 into groups of 4 digits,
starting from the right
4. Convert each group of 4 binary digits into 1 hexadecimal
digit
Course Contents
Octal to Hexadecimal conversion:
Convert Octal number 258 into Hexadecimal form
Step 1. Convert each octal digit into groups of 3 digits binary 25 8
Groups: 28 58
58 = 1012
28 = 0102
Step 2. Combine the groups
so, 258 = 0101012
Step 3. Divide the binary digits from step 2 into groups of 4 digits, starting
from the right
Groups: 00012 01012
Step 4. Convert each group of 4 binary digits into 1 hexadecimal digit
01012 = 516
00012 = 116
so, 258 = 1516
Course Contents
Hexadecimal to Octal conversion:
Steps:
1. Convert each hexadecimal digit into groups of 4 digits
binary
2. Combine the groups from step 1
3. Divide the binary digits from step 2 into groups of 3 digits,
starting from the right
4. Convert each group of 3 binary digits into 1 octal digit
Course Contents
Hexadecimal to Octal conversion:
Convert Hexadecimal number 1516 into Octal form
Step 1. Convert each hexadecimal digit into groups of 4 digits binary 1516
Groups: 116 516
516 = 01012
116 = 00012
Step 2. Combine the groups
so, 1516 = 000101012
Step 3. Divide the binary digits from step 2 into groups of 3 digits, starting from the right
Groups: 0002 0102 1012
Step 4. Convert each group of 3 binary digits into 1 octal digit
1012 = 58
0102 = 28
0002 = 08
so, 1516 = 0258 = 258
Course Contents
Converting Decimal Fraction to Binary, Octal and Hexa:
Course Contents
Converting Decimal Fraction to Binary, Octal and Hexa:
Course Contents
Converting Decimal Integer, Fraction to Binary, Octal and
Hexa:
Course Contents
Converting Decimal Integer, Fraction to Binary, Octal and
Hexa:
Course Contents
Converting Decimal Integer, Fraction to Binary, Octal and
Hexa:
Course Contents
Converting Fraction Binary, Octal and Hexa to Decimal
Course Contents
Converting Fraction Binary, Octal and Hexa to Decimal
Course Contents
Unit-05:Data Representation (6 Hrs.)
 Binary Arithmetic;
 Signed and Unsigned Numbers;
 Binary Data Representation;
 Binary Coding Schemes;
 Logic Gates
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Arithmetic:
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:

The zone used by ASCII for alphabets is 0100. For e.g. A is


represented as 0100(zone)0001(digit). The hex equivalent is 41 for A.
Character A = 0100 0001; Character B = 0100 0010
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:

UTF: Unicode Transformation Format


Course Contents
Binary Coding Schemes:
Course Contents
Binary Coding Schemes:
UTF encodings include:
 UTF-1, a retired predecessor of UTF-8, maximizes compatibility with ISO
2022, no longer part of The Unicode Standard;
 UTF-7, a 7-bit encoding sometimes used in e-mail, often considered
obsolete (not part of The Unicode Standard, but only documented as an
informational RFC, i.e., not on the Internet Standards Track);
 UTF-8, an 8-bit variable-width encoding which maximizes compatibility
with ASCII;
 UTF-EBCDIC, an 8-bit variable-width encoding similar to UTF-8, but
designed for compatibility with EBCDIC (not part of The Unicode
Standard);
 UTF-16, a 16-bit, variable-width encoding;
 UTF-32, a 32-bit, fixed-width encoding.
Course Contents
 Logic Gates

You might also like