SlideShare a Scribd company logo
Chapter 2: Number System
2.1 Binary, Octal & Hexadecimal Number Systems and their conversions
2.1.1 Representation of Signed Numbers, Floating Point Number
2.1.2 Binary Arithmetic
2.2 Representation of BCD, ASCII, Excess 3, Gray Code, Error Detection
and Correcting Codes.
1
Number Systems
2
 A number system defines how a number can
be represented using distinct symbols.
 A number can be represented differently in
different systems.
For example, the two numbers (2A)16 and (52)8
both refer to the same quantity, (42)10, but their
representations are different.
3
Number system can be categorized as
1. Decimal number system
2. Binary number system
3. Octal number system
4. Hexadecimal Number System
4
o Each number system is associated with a base or radix
o The decimal number system is said to be of base or
radix10
o A number in base r contains r digits 0,1,2,...,r-1
o Decimal (Base 10): 0,1,2,3,4,5,6,7,8,9
5
 The word decimal is derived from the Latin root
decem(ten). In this system the base b = 10 and
we use ten symbols.
S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.
6
 The word binary is derived from the Latin root
bini (or two by two).
In this system the base b = 2 and we use
only two symbols,
S = {0, 1}
The symbols in this system are often referred
to as binary digits or bits.
7
 The word hexadecimal is derived from the Greek root
hex (six) and the Latin root decem (ten).
In this system the base b = 16 and we use sixteen
symbols to represent a number.
 The set of symbols is
S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E,F}
 The symbols A, B, C, D, E, F are equivalent to
10, 11, 12, 13, 14, and 15 respectively.
 The symbols in this system are often referred to as
hexadecimal digits.
8
The word octal is derived from the Latin root
octo (eight).
In this system the base b = 8 and we use
eight symbols to represent a number.
The set of symbols is:
S = {0, 1, 2, 3, 4, 5, 6, 7}
9
Common Number Systems
10
System Base Symbols Used by
Humans?
Used in
Computers?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa-
decimal
16 0, 1, … 9,
A, B, … F
No No
Quantities / Counting
11
Decimal Binary Octal
Hexa-
decimal
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
Decimal Binary Octal
Hexa-
decimal
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
Conversion among Bases
• Possibilities
• Example
12
Hexadecimal
Decimal Octal
Binary
2510 = 110012 = 318 = 1916 Base
Decimal to Binary
• Technique
– Divide by two, keep track of the remainder
– First remainder is bit 0 (LSB, least-significant bit)
– Second remainder is bit 1 and so on
13
Decimal Binary
Example (Decimal to Binary)
14
12510 = ?2 2 125 1
2 62 0
2 31 1
2 15 1
2 7 1
2 3 1
2 1 1
0
12510 = 11111012
Example (Decimal to Binary)
15
0.687510 = ?2
0.6875 x 2 = 1.3750 1 0.3750
+
0.3750 x 2 = 0.7500 0 0.7500
+
0.7500 x 2 = 1.5000 1 0.5000
+
0.5000 x 2 = 1.0000 1 0.0000
+
0.687510 = 0.10112
integer fraction
Binary to Decimal
• Technique
– Multiply each bit by 2n, where n is the “weight” of the
bit
– The weight is the position of the bit, starting from 0
on the right
– Add the results
16
Binary Decimal
Example (Binary to Decimal)
17
1 0 1 0 1 1
1 x 20
1 x 21
0 x 22
1 x 23
0 x 24
1 x 25 +
+
+
+
+
1
2
0
1010112 =
0
32 +
+
+
+
+
4310
4310
8
Example (Binary to Decimal)
18
1 1 . 1 1
1 x 20
1 x 21 +
1
2
11.112 =
+
3.7510
3.7510
1 x 2-2
1 x 2-1 +
0.25
0.5 +
+
+
Decimal to Octal
• Technique
– Divide by eight
– Keep track of the remainder
19
Decimal Octal
Example (Decimal to Octal)
20
12510 = ?8 8 125 5
8 15 7
8 1 1
0
12510 = 1758
Example (Decimal to Octal)
21
0.687510 = ?8
0.6875 x 8 = 5.5000 5 0.5000
+
0.5000 x 8 = 4.0000 4 0.0000
+
0.687510 = 0.548
integer fraction
Octal to Decimal
• Technique
– Multiply each bit by 8n, where n is the “weight” of the
bit
– The weight is the position of the bit, starting from 0
on the right
– Add the results
22
Octal Decimal
Example (Octal to Decimal)
23
7 2 4
4 x 80
2 x 81
7 x 82 +
+
7248 =
46810
46810
4
16
448 +
+
Example (Octal to Decimal)
24
4 3 . 2 5
3 x 80
4 x 81 +
3
32
43.258 =
+
35.328110
35.328110
5 x 8-2
2 x 8-1 +
0.0781
0.25 +
+
+
Decimal to Hexa-Decimal
• Technique
– Divide by 16
– Keep track of the remainder
25
Decimal Hexa-Decimal
Example (Decimal to HexaDecimal)
26
123410 = ?16 16 1234 2
123410 = 4D216
16 77 13=D
16 4 4
0
Hexa-Decimal to Decimal
• Technique
– Multiply each bit by 16n, where n is the “weight” of
the bit
– The weight is the position of the bit, starting from 0
on the right
– Add the results
27
Hexa-Decimal Decimal
Example (HexaDecimal to Decimal)
28
A B C
C x 160
B x 161
A x 162 +
+
ABC16 =
274810
274810
12 x 160
11 x 161
10 x 162
+
+
12
176
2560 +
+
Octal to Binary
• Technique
– Convert each octal digit to a 3-bit equivalent binary
representation
29
Octal Binary
Octal - Binary Table
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
30
Example (Octal to Binary)
31
7058 = ?2
7 0 5
101
000
111
7058 = 1110001012
Binary to Octal
• Technique
– Group bits in threes, starting on right
– Convert to octal digits
32
Binary Octal
Example (Binary to Octal)
33
10110101112 = ?8
1
011
001
10110101112 = 13278
111
010
3 2 7
Hexa-Decimal to Binary
• Technique
– Convert each hexadecimal digit to a 4-bit equivalent
binary representation
34
Hexa-Decimal Binary
Hexa-Decimal to Binary
Hexa-
Decimal
Binary Hexa-
Decimal
Binary
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111
35
Example (Hexa-Decimal to Binary)
36
10AF16 = ?2
1 0 A F
1111
1010
0000
10AF16 = 10000101011112
0001
Binary to Hexa-Decimal
• Technique
– Group bits in fours, starting on right
– Convert to hexadecimal digits
37
Binary Hexa-Decimal
Example (Binary to Hexa-Decimal)
38
10110101112 = ?16
0010
10110101112 = 2D716
0111
1101
2 D 7
Octal to Hexa-Decimal
• Technique
– Convert Octal to Binary
– Regroup bits in fours from right
– Convert Binary to Hexa-Decimal
39
Octal Hexa-Decimal
Example (Octal to Hexa-Decimal)
40
10768 = ?16
1 0 7 6
110
111
000
10768 =23E16
001
1110
0011
0010
E
3
2
Hexa-Decimal to Octal
• Technique
– Convert Hexa-Decimal to Binary
– Regroup bits in three from right
– Convert Binary to Octal
41
Hexa-Decimal Octal
Example (Hexa-Decimal to Octal)
42
1F0C16 = ?8
1 F 0 C
1100
0000
1111
1F0C16 = 174148
0001
100
001
100
4
1
4
111
7
001
1
000
0
Positional Number System
• A positional number system is also known as
weighted number system.
• As the name implies there will be a weight
associated with each digit.
• Few examples of positional number system
are decimal number system, Binary number
system, octal number system ,etc.
43
Non-Positional Number System
• Non-positional number system is also known
as non-weighted number system.
• Digit value is independent of its position. Non-
positional number system is used for shift
position encodes and error detecting purpose.
• Few examples of non-weighted number
system are gray code, roman code, excess-3
code, etc.
44
Signed numbers
• Digital systems such as computer must be able to
handle both positive and negative numbers. A signed
binary number consists of both signed and magnitude
information.
• Eg: Signed number : +7
7 = Binary Number 111
+7 = 0 111
• Sign indicates whether a number is positive or negative
and magnitude is the value of the number. Left most
bit is the sign bit.
• ‘0’ sign bit indicates a positive number and ‘1’ sign bit
indicates a negative number.
45
Signed numbers
There are 3 forms in which sign integer numbers
can be represented in binary.
1. Signed magnitude
2. 1’s Complement
3. 2’s Complement
46
Signed Magnitude form
• When a signed binary number is represented in a sign
magnitude form, left most bit is the signed bit and
remaining bits are magnitude bit.
• The magnitude bits are in a true binary for both positive
and negative numbers.
• Eg : Represent decimal number +25 on 8-bit signed
binary number.
25  (11001)2
+25  0 0011001
+ Sign Magnitude
Example
Q. Similarly -75 is represented (8-bit) as ???
Ans: 1 1001011
75 = 1001011
-75 = 1 1001011
48
1’s Complement
49
1 1 1 1
1 1 0 1
0 0 1 0
-
(1’s complement of 1101)
1 1 1 .
1 0 1 .
0 1 0 .
-
(1’s complement of 101.01)
1 1
0 1
1 0
 1’s complement of a binary number is obtained by subtracting
each digit of that binary number from 1.
 Example
1’s Complement Form
• Positive Numbers are simply represented as it is.
• If the number is negative, First represent the number
with positive sign and then take 1’s complement of that
number.
• Ex: Using 8-bit, find 1’s complement of decimal number
-25.
Step-1 : +25 = 00011001
Step-2 : 1’s complement : 11100110
Q. Find 1’s complement of -75 using 8-bit
Step-1 : +75 = 0 1001011
Step-2 : 1’s complement : 10110100
2’s Complement
• 2’s complement of a binary number is obtained by
adding 1 to its 1’s complement.
51
1 1 1 1
1 1 0 0
0 0 1 1
-
(2’s complement of 1100)
0 1 0 .
-
(2’s complement of 101.01)
1 1 1 . 1 1
1 0 1 . 0 1
1 0
1
0 1 0 0
1
+ +
0 1 0 1 1
.
 Example
2’s Complement form
• Positive Numbers are simply represented as it is.
• If the number is negative, First represent the number
with positive sign and then take 2’s complement of that
number.
E.g. : Find 2’s complement of -25 using 8-bit
+25 = 00011001
1’s complement = 11100110
+ 1
11100111
Q. Find 2’s complement of -75
Ans: (10110101)
Representation of negative number in 2’s
complement form
• Express -65.5 in 12 bit 2’s complement form.
53
2 65 1
2 32 0
2 16 0
2 8 0
2 4 0
2 2 0
2 1 1
0
0.5 x 2 = 1.0
65.510 = 01000001.10002
So, result in 12-bit binary is as follows:
For negative number, we have to
convert this into 2’s complement form
-65.510 =10111110.10002
Assignment
Questions:
1. Convert (1101010)2 to octal, decimal and hexadecimal.
2. Convert (1011.01)2 to octal, decimal and hexadecimal.
3. Convert (35.43)10 to binary, octal and hexadecimal.
4. Convert (635.74)8 to binary, decimal and hexadecimal.
5. Convert (D6A)16 to binary, octal & decimal.
6. Express the decimal number -39 as an 8-bit number in
sign magnitude, 1’s complement and 2’s complement
form.
9’s Complement
• 9’s complement of a decimal number is obtained by
subtracting each digit of that decimal number from 9.
55
9 9 9 9
3 4 6 5
6 5 3 4
-
(9’s complement of 3465)
9 9 9 .
7 8 2 .
2 1 7 .
-
(9’s complement of 782.54)
9 9
5 4
4 5
 Example
10’s Complement
• 10’s complement of a decimal number is obtained by
adding 1 to its 9’s complement.
56
9 9 9 9
3 4 6 5
6 5 3 4
-
(10’s complement of 3465)
2 1 7 .
-
(10’s complement of 782.54)
9 9 9 . 9 9
7 8 2 . 5 4
4 5
1
6 5 3 5
1
+ +
2 1 7 4 6
.
 Example
Subtraction using 9’s complement
• Obtain 9’s complement of subtrahend
• Add the result to minuend and call it
intermediate result
• If carry is generated then answer is positive
and add the carry to Least Significant Digit
(LSD)
• If there is no carry then answer is negative and
take 9’s complement of intermediate result
and place negative sign to the result.
57
Example
58
7 4 5 .
4 3 6 .
-
8 1
6 2
1) 745.81 – 436.62
7 4 5 . 8 1
5 6 3 .
+ 3 7
3 0 9 .
1 1 8
+ 1
3 0 9 . 1 9
3 0 9 . 1 9
9’s complement
Example
59
7 4 5 .
4 3 6 .
- 8 1
6 2
2) 436.62 - 745.81
2 5 4 .
+ 1 8
6 9 0 . 8 0
3 0 9 . 1 9
3 0 9 . 1 9
-
4 3 6 . 6 2
-
9’s complement
9’s complement
As carry is not generated, so take 9’s
complement of the intermediate
result and add ‘ – ‘ sign to the result
Subtraction using 10’s complement
• Obtain 10’s complement of subtrahend
• Add the result to minuend
• If carry is generated then ignore it and result
itself is answer
• If there is no carry then answer is negative and
take 10’s complement of result and place
negative sign to the result.
60
Example
61
7 4 5 .
4 3 6 .
-
8 1
6 2
1) 745.81 – 436.62
5 6 3 .
+
7 4 5 . 8 1
3 8
3 0 9 .
1 1 9
3 0 9 . 1 9
Ignore the carry
10’s complement
Example
62
7 4 5 .
4 3 6 .
- 8 1
6 2
2) 436.62 - 745.81
2 5 4 .
+ 1 9
6 9 0 . 8 1
3 0 9 . 1 9
3 0 9 . 1 9
-
4 3 6 . 6 2
-
10’s complement
10’s complement
As carry is not generated, so take
10’s complement of the intermediate
result and add ‘ – ‘ sign to the result
Binary Addition
• Rules for binary addition
63
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 i.e.
0 with a carry
of 1
1 1 0 1
0 1 1 1
0 1 0 1
1 1 1 1
1
+
. 1 0 1
. 0 1 1
. 0 0 0
1 1
Binary Subtraction
• Rules for binary subtraction
64
0 – 0 = 0
1 – 1 = 0
1 – 0 = 1
0 – 1 = 1, with
a borrow 1
1 0 1 0
0 1 1 1
0 0 1 0
-
. 0 1 0
. 1 1 1
. 0 1 1
1
0
1
1
1
0
1
1
0
Binary Multiplication
• Four basic Rules:
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
Eg: 1 1 1
x 1 0 1
1 1 1
0 0 0 X
+ 1 1 1 X X
1 0 0 0 1 1
Eg: 1 1 .0 1
x 1 0 .1 1
1 1 0 1
1 1 0 1 X
0 0 0 0 X X
+ 1 1 0 1 X X X
1 0 0 0. 1 1 1 1
Binary Multiplication
68
1 0 1 1 1
1 0 0 1 1
x
1
1
1
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
1
1
0
1
1
0
1
0
1
1
0
1
1
• Solve the following binary multiplication
2. (101.01)2 and (100.1)2
Ans: 101111.01
Binary Division
A B Output
0 0 0
0 1 0
1 1 1
1 0 Infinity
Binary Division
74
1 0 1 1 0 1
110 0
0 0 0
1 0 11
1 1 0
1 0 1 0
1 1 0
1 0 0 1
1 1 0
1 1
111.1
0
1 1 0
0 0 0
• Solve the following division
1.(11001) by (101)
Ans:101
2. (111)2 by (11)2
Ans: 10 remainder 1
3. (110000) by (100)
Ans:
Subtraction using 1’s Complement
• Obtain 1’s complement of subtrahend
• Add the result to minuend and call it
intermediate result
• If carry is generated then answer is positive
and add the carry to Least Significant Digit
(LSD)
• If there is no carry then answer is negative and
take 1’s complement of intermediate result
and place negative sign to the result.
76
Example
77
68.
27.
-
75
50
1) 68.75 – 27.50
+ 41.25
1’s complement
000 . 1 1
100
01 0 0
+ 100 .
100
11 0 11 1
+1
00 1.
1 00
01 0
0
1 11
01 0 . 0 1
00 1 01 0 0
Example
78
2) 43.25 - 89.75
As carry is not generated, so take 1’s
complement of the intermediate
result and add ‘ – ‘ sign to the result
43.
89.
-
25
75
- 46.50
1’s complement
101 . 0 1
011
00 0 0
+ 100 .
110
10 0 01 1
00 1.
0 01
10 1
1 11
11 0.
1 10
01 0
0 00
1’s complement
Subtraction using 2’s Complement
• Obtain 2’s complement of subtrahend
• Add the result to minuend
• If carry is generated then ignore it and result
itself is answer
• If there is no carry then answer is negative and
take 2’s complement of result and place
negative sign to the result.
79
Example
80
68.
27.
-
75
50
1) 68.75 – 27.50
+ 41.25
2’s complement
000 . 1 1
100
01 0 0
+ 100 .
100
11 1 00 0
00 1.
1 01
01 0
0
1 00
00 1.
1 01
01 0
0 00
Ignore Carry bit
Example
81
2) 43.25 - 89.75
As carry is not generated, so take 2’s
complement of the intermediate
result and add ‘ – ‘ sign to the result
43.
89.
-
25
75
- 46.50
2’s complement
101 . 0 1
011
00 0 0
+ 100 .
110
10 0 10 0
00 1.
0 10
10 1
1 00
11 0.
1 10
01 0
0 00
2’s complement
Signed Binary Numbers
• To represent negative integers, we need a notation for negative values.
• It is customary to represent the sign with a bit placed in the leftmost position
of the number since binary digits.
• The convention is to make the sign bit 0 for positive and 1 for negative.
• Different methods of representations (example):
• Table 1.3 lists all possible four-bit signed binary numbers in the three
representations.
Signed Binary Numbers
Signed Binary Numbers
• Arithmetic addition
– The addition of two numbers in the signed-magnitude system follows the rules of
ordinary arithmetic. If the signs are the same, we add the two magnitudes and give the
sum the common sign. If the signs are different, we subtract the smaller magnitude
from the larger and give the difference the sign if the larger magnitude.
– The addition of two signed binary numbers with negative numbers represented in
signed-2's-complement form is obtained from the addition of the two numbers,
including their sign bits.
– A carry out of the sign-bit position is discarded.
• Example:
Signed Binary Numbers
• Arithmetic Subtraction
– In 2’s-complement form:
• Example:
1. Take the 2’s complement of the subtrahend (including the sign bit)
and add it to the minuend (including sign bit).
2. A carry out of sign-bit position is discarded.
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
A B A B
A B A B
      
      
( 6)  ( 13) (11111010  11110011)
(11111010 + 00001101)
00000111 (+ 7)
Representation of Floating Point
Number
©spickmlk 86
BINARY REPRESENTATION OF FLOATING POINT
NUMBERS
Converting decimal fractions into binary
representation.
Consider a decimal fraction of the form: 0.d1d2...dn
We want to convert this to a binary fraction of the
form:
0.b1b2...bn (using binary digits instead of decimal
digits)
Algorithm for conversion
Let X be a decimal fraction: 0.d1d2..dn
i = 1
Repeat until X = 0 or i = required no. of binary fractional
digits {
Y = X * 2
X = fractional part of Y
Bi = integer part of Y
i = i + 1
}
EXAMPLE 1
Convert 0.75 to binary
X = 0.75 (initial value)
X* 2 = 1.50. Set b1 = 1, X = 0.5
X* 2 = 1.0. Set b2 = 1, X = 0.0
The binary representation for 0.75 is thus
0.b1b2 = 0.11b
Let's consider what that means...
In the binary representation
0.b1b2...bm
b1 represents 2-1 (i.e., 1/2)
b2 represents 2-2 (i.e., 1/4)
...
bm represents 2-m (1/(2m))
So, 0.11 binary represents
2-1 + 2-2 = 1/2 + 1/4 = 3/4 = 0.75
EXAMPLE 2
Convert the decimal value 4.9 into binary
Part 1: convert the integer part into binary: 4 = 100 b
Part 2.
Convert the fractional part into binary using multiplication
by 2:
X = .9*2 = 1.8. Set b1 = 1, X = 0.8
X*2 = 1.6. Set b2 = 1, X = 0.6
X*2 = 1.2. Set b3 = 1, X = 0.2
X*2 = 0.4. Set b4 = 0, X = 0.4
X*2 = 0.8. Set b5 = 0, X = 0.8,
which repeats from the second line above.
Since X is now repeating the value 0.8,
we know the representation will repeat.
The binary representation of 4.9 is thus:
100.1110011001100...
COMPUTER REPRESENTATION OF FLOATING
POINT NUMBERS
In the CPU, a 32-bit floating point number is
represented using IEEE standard format as follows:
SIGN | EXPONENT | MANTISSA
where SIGN is one bit, the EXPONENT is 8 bits, and
the MANTISSA is 23 bits.
• The mantissa represents the leading significant bits in
the number.
• The exponent is used to adjust the position of the
binary point (as opposed to a "decimal" point)
• The mantissa is said to be normalized when it is
expressed as a value between 1 and 2. I.e., the mantissa
would be in the form 1.xxxx.
• The leading integer of the binary representation is
not stored. Since it is always a 1, it can be easily
restored.
• The "SIGN" bit is used as a sign bit and indicates
whether the value represented is positive or negative
(0 for positive, 1 for negative)
• If a number is smaller than 1, normalizing the
mantissa will produce a negative exponent.
• But 127 is added to all exponents in the floating
point representation, allowing all exponents to be
represented by a positive number.
Example 1. Represent the decimal value 2.5 in 32-
bit floating point format.
2.5 = 10.1
In normalized form, this is: 1.01 * 21
The mantissa: M = 01000000000000000000000
(23 bits without the leading 1)
The exponent: E = 1 + 127 = 128 = 10000000
The sign: S = 0 (the value stored is positive)
So, 2.5 = 0 1000000001 000000000000000000000
Example 2: Represent the number -0.00010011 in
floating point form.
0.00010011 = 1.0011 * 2-4
Mantissa: M = 00110000000000000000000 (23 bits
with the integral 1 not represented)
Exponent: E = -4 + 127 = 01111011
S = 1 (as the number is negative)
Result: 1 01111011 00110000000000000000000
Exercise 1: represent -0.75 in floating point format.
Exercise 2: represent 4.9 in floating point format.

More Related Content

What's hot

Binary codes
Binary codesBinary codes
Binary codes
Neha Jamini
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
Number system
Number systemNumber system
Number system
Suraj Bora
 
binary number system
 binary number system binary number system
binary number system
vishal gupta
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
pyingkodi maran
 
Basic of number system
Basic of number systemBasic of number system
Basic of number system
Akhilesh Maithani
 
EC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementEC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's Complement
AmberSinghal1
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
Meenakshi Paul
 
Binary octal
Binary octalBinary octal
Binary octaldrdipo4
 
Lecture ascii and ebcdic codes
Lecture ascii and ebcdic codesLecture ascii and ebcdic codes
Lecture ascii and ebcdic codes
Yazdan Yousafzai
 
Introduction to the Binary Number System
Introduction to the Binary Number SystemIntroduction to the Binary Number System
Introduction to the Binary Number SystemJames Hamilton
 
Floating point representation
Floating point representationFloating point representation
Floating point representation
missstevenson01
 
BInary Number Representation
 BInary Number Representation BInary Number Representation
BInary Number Representation
Srikrishna Thota
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 
Lecture-2(2): Number System & Conversion
Lecture-2(2): Number System & ConversionLecture-2(2): Number System & Conversion
Lecture-2(2): Number System & Conversion
Mubashir Ali
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal Conversion
Neelanjan Bhattacharyya
 
11 octal number system
11   octal number system11   octal number system
11 octal number system
Lee Chadwick
 

What's hot (20)

Binary codes
Binary codesBinary codes
Binary codes
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
Binary true ppt
Binary true pptBinary true ppt
Binary true ppt
 
Number System
Number SystemNumber System
Number System
 
Number system
Number systemNumber system
Number system
 
binary number system
 binary number system binary number system
binary number system
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Basic of number system
Basic of number systemBasic of number system
Basic of number system
 
EC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementEC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's Complement
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Number system conversion
Number system conversionNumber system conversion
Number system conversion
 
Binary octal
Binary octalBinary octal
Binary octal
 
Lecture ascii and ebcdic codes
Lecture ascii and ebcdic codesLecture ascii and ebcdic codes
Lecture ascii and ebcdic codes
 
Introduction to the Binary Number System
Introduction to the Binary Number SystemIntroduction to the Binary Number System
Introduction to the Binary Number System
 
Floating point representation
Floating point representationFloating point representation
Floating point representation
 
BInary Number Representation
 BInary Number Representation BInary Number Representation
BInary Number Representation
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Lecture-2(2): Number System & Conversion
Lecture-2(2): Number System & ConversionLecture-2(2): Number System & Conversion
Lecture-2(2): Number System & Conversion
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal Conversion
 
11 octal number system
11   octal number system11   octal number system
11 octal number system
 

Similar to Chapter 2.1 introduction to number system

Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
4NM21IS132SAISHARATH
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
PeriyanayagiS
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
nivedita murugan
 
Alu1
Alu1Alu1
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
HamnaKhalid25
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
MamataAnilgod
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
ColleenVender2
 
data representation
 data representation data representation
data representation
Haroon_007
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
GobinathAECEJRF1101
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
Ram Pratap Singh
 
number system
number systemnumber system
number system
Pawan Mishra
 
Digital design chap 1
Digital design  chap 1Digital design  chap 1
Digital design chap 1
Mohammad Bappy
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
Wollo UNiversity
 
Boolean Algebra Arithmetic SIG UNSIGN.ppt
Boolean Algebra  Arithmetic SIG UNSIGN.pptBoolean Algebra  Arithmetic SIG UNSIGN.ppt
Boolean Algebra Arithmetic SIG UNSIGN.ppt
AshishChandrakar12
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptx
ODAATUBE1
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
Ammar_n
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
NabeelaNousheen
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
AminaZahid16
 

Similar to Chapter 2.1 introduction to number system (20)

Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
Alu1
Alu1Alu1
Alu1
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
data representation
 data representation data representation
data representation
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
number system
number systemnumber system
number system
 
Digital design chap 1
Digital design  chap 1Digital design  chap 1
Digital design chap 1
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
Boolean Algebra Arithmetic SIG UNSIGN.ppt
Boolean Algebra  Arithmetic SIG UNSIGN.pptBoolean Algebra  Arithmetic SIG UNSIGN.ppt
Boolean Algebra Arithmetic SIG UNSIGN.ppt
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptx
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
 

More from ISMT College

Attack.pptx
Attack.pptxAttack.pptx
Attack.pptx
ISMT College
 
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.ppt
ISMT College
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptx
ISMT College
 
4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx
ISMT College
 
Instruction.pdf
Instruction.pdfInstruction.pdf
Instruction.pdf
ISMT College
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx
ISMT College
 
2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptx2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptx
ISMT College
 
1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptx1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptx
ISMT College
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
ISMT College
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital Logic
ISMT College
 
VLAN
VLANVLAN
Access Control List (ACL)
Access Control List (ACL)Access Control List (ACL)
Access Control List (ACL)
ISMT College
 
Introduction to Counters
Introduction to CountersIntroduction to Counters
Introduction to Counters
ISMT College
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital Logic
ISMT College
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devices
ISMT College
 
Basic Gates in Digital Logic
Basic Gates in Digital LogicBasic Gates in Digital Logic
Basic Gates in Digital Logic
ISMT College
 
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
ISMT College
 
Register in Digital Logic
Register in Digital LogicRegister in Digital Logic
Register in Digital Logic
ISMT College
 

More from ISMT College (18)

Attack.pptx
Attack.pptxAttack.pptx
Attack.pptx
 
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.ppt
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptx
 
4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx
 
Instruction.pdf
Instruction.pdfInstruction.pdf
Instruction.pdf
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx
 
2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptx2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptx
 
1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptx1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptx
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital Logic
 
VLAN
VLANVLAN
VLAN
 
Access Control List (ACL)
Access Control List (ACL)Access Control List (ACL)
Access Control List (ACL)
 
Introduction to Counters
Introduction to CountersIntroduction to Counters
Introduction to Counters
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital Logic
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devices
 
Basic Gates in Digital Logic
Basic Gates in Digital LogicBasic Gates in Digital Logic
Basic Gates in Digital Logic
 
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
 
Register in Digital Logic
Register in Digital LogicRegister in Digital Logic
Register in Digital Logic
 

Recently uploaded

Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 

Recently uploaded (20)

Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 

Chapter 2.1 introduction to number system

  • 1. Chapter 2: Number System 2.1 Binary, Octal & Hexadecimal Number Systems and their conversions 2.1.1 Representation of Signed Numbers, Floating Point Number 2.1.2 Binary Arithmetic 2.2 Representation of BCD, ASCII, Excess 3, Gray Code, Error Detection and Correcting Codes. 1
  • 3.  A number system defines how a number can be represented using distinct symbols.  A number can be represented differently in different systems. For example, the two numbers (2A)16 and (52)8 both refer to the same quantity, (42)10, but their representations are different. 3
  • 4. Number system can be categorized as 1. Decimal number system 2. Binary number system 3. Octal number system 4. Hexadecimal Number System 4
  • 5. o Each number system is associated with a base or radix o The decimal number system is said to be of base or radix10 o A number in base r contains r digits 0,1,2,...,r-1 o Decimal (Base 10): 0,1,2,3,4,5,6,7,8,9 5
  • 6.  The word decimal is derived from the Latin root decem(ten). In this system the base b = 10 and we use ten symbols. S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. 6
  • 7.  The word binary is derived from the Latin root bini (or two by two). In this system the base b = 2 and we use only two symbols, S = {0, 1} The symbols in this system are often referred to as binary digits or bits. 7
  • 8.  The word hexadecimal is derived from the Greek root hex (six) and the Latin root decem (ten). In this system the base b = 16 and we use sixteen symbols to represent a number.  The set of symbols is S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E,F}  The symbols A, B, C, D, E, F are equivalent to 10, 11, 12, 13, 14, and 15 respectively.  The symbols in this system are often referred to as hexadecimal digits. 8
  • 9. The word octal is derived from the Latin root octo (eight). In this system the base b = 8 and we use eight symbols to represent a number. The set of symbols is: S = {0, 1, 2, 3, 4, 5, 6, 7} 9
  • 10. Common Number Systems 10 System Base Symbols Used by Humans? Used in Computers? Decimal 10 0, 1, … 9 Yes No Binary 2 0, 1 No Yes Octal 8 0, 1, … 7 No No Hexa- decimal 16 0, 1, … 9, A, B, … F No No
  • 11. Quantities / Counting 11 Decimal Binary Octal Hexa- decimal 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 Decimal Binary Octal Hexa- decimal 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
  • 12. Conversion among Bases • Possibilities • Example 12 Hexadecimal Decimal Octal Binary 2510 = 110012 = 318 = 1916 Base
  • 13. Decimal to Binary • Technique – Divide by two, keep track of the remainder – First remainder is bit 0 (LSB, least-significant bit) – Second remainder is bit 1 and so on 13 Decimal Binary
  • 14. Example (Decimal to Binary) 14 12510 = ?2 2 125 1 2 62 0 2 31 1 2 15 1 2 7 1 2 3 1 2 1 1 0 12510 = 11111012
  • 15. Example (Decimal to Binary) 15 0.687510 = ?2 0.6875 x 2 = 1.3750 1 0.3750 + 0.3750 x 2 = 0.7500 0 0.7500 + 0.7500 x 2 = 1.5000 1 0.5000 + 0.5000 x 2 = 1.0000 1 0.0000 + 0.687510 = 0.10112 integer fraction
  • 16. Binary to Decimal • Technique – Multiply each bit by 2n, where n is the “weight” of the bit – The weight is the position of the bit, starting from 0 on the right – Add the results 16 Binary Decimal
  • 17. Example (Binary to Decimal) 17 1 0 1 0 1 1 1 x 20 1 x 21 0 x 22 1 x 23 0 x 24 1 x 25 + + + + + 1 2 0 1010112 = 0 32 + + + + + 4310 4310 8
  • 18. Example (Binary to Decimal) 18 1 1 . 1 1 1 x 20 1 x 21 + 1 2 11.112 = + 3.7510 3.7510 1 x 2-2 1 x 2-1 + 0.25 0.5 + + +
  • 19. Decimal to Octal • Technique – Divide by eight – Keep track of the remainder 19 Decimal Octal
  • 20. Example (Decimal to Octal) 20 12510 = ?8 8 125 5 8 15 7 8 1 1 0 12510 = 1758
  • 21. Example (Decimal to Octal) 21 0.687510 = ?8 0.6875 x 8 = 5.5000 5 0.5000 + 0.5000 x 8 = 4.0000 4 0.0000 + 0.687510 = 0.548 integer fraction
  • 22. Octal to Decimal • Technique – Multiply each bit by 8n, where n is the “weight” of the bit – The weight is the position of the bit, starting from 0 on the right – Add the results 22 Octal Decimal
  • 23. Example (Octal to Decimal) 23 7 2 4 4 x 80 2 x 81 7 x 82 + + 7248 = 46810 46810 4 16 448 + +
  • 24. Example (Octal to Decimal) 24 4 3 . 2 5 3 x 80 4 x 81 + 3 32 43.258 = + 35.328110 35.328110 5 x 8-2 2 x 8-1 + 0.0781 0.25 + + +
  • 25. Decimal to Hexa-Decimal • Technique – Divide by 16 – Keep track of the remainder 25 Decimal Hexa-Decimal
  • 26. Example (Decimal to HexaDecimal) 26 123410 = ?16 16 1234 2 123410 = 4D216 16 77 13=D 16 4 4 0
  • 27. Hexa-Decimal to Decimal • Technique – Multiply each bit by 16n, where n is the “weight” of the bit – The weight is the position of the bit, starting from 0 on the right – Add the results 27 Hexa-Decimal Decimal
  • 28. Example (HexaDecimal to Decimal) 28 A B C C x 160 B x 161 A x 162 + + ABC16 = 274810 274810 12 x 160 11 x 161 10 x 162 + + 12 176 2560 + +
  • 29. Octal to Binary • Technique – Convert each octal digit to a 3-bit equivalent binary representation 29 Octal Binary
  • 30. Octal - Binary Table Octal Binary 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 30
  • 31. Example (Octal to Binary) 31 7058 = ?2 7 0 5 101 000 111 7058 = 1110001012
  • 32. Binary to Octal • Technique – Group bits in threes, starting on right – Convert to octal digits 32 Binary Octal
  • 33. Example (Binary to Octal) 33 10110101112 = ?8 1 011 001 10110101112 = 13278 111 010 3 2 7
  • 34. Hexa-Decimal to Binary • Technique – Convert each hexadecimal digit to a 4-bit equivalent binary representation 34 Hexa-Decimal Binary
  • 35. Hexa-Decimal to Binary Hexa- Decimal Binary Hexa- Decimal Binary 0 0000 8 1000 1 0001 9 1001 2 0010 A 1010 3 0011 B 1011 4 0100 C 1100 5 0101 D 1101 6 0110 E 1110 7 0111 F 1111 35
  • 36. Example (Hexa-Decimal to Binary) 36 10AF16 = ?2 1 0 A F 1111 1010 0000 10AF16 = 10000101011112 0001
  • 37. Binary to Hexa-Decimal • Technique – Group bits in fours, starting on right – Convert to hexadecimal digits 37 Binary Hexa-Decimal
  • 38. Example (Binary to Hexa-Decimal) 38 10110101112 = ?16 0010 10110101112 = 2D716 0111 1101 2 D 7
  • 39. Octal to Hexa-Decimal • Technique – Convert Octal to Binary – Regroup bits in fours from right – Convert Binary to Hexa-Decimal 39 Octal Hexa-Decimal
  • 40. Example (Octal to Hexa-Decimal) 40 10768 = ?16 1 0 7 6 110 111 000 10768 =23E16 001 1110 0011 0010 E 3 2
  • 41. Hexa-Decimal to Octal • Technique – Convert Hexa-Decimal to Binary – Regroup bits in three from right – Convert Binary to Octal 41 Hexa-Decimal Octal
  • 42. Example (Hexa-Decimal to Octal) 42 1F0C16 = ?8 1 F 0 C 1100 0000 1111 1F0C16 = 174148 0001 100 001 100 4 1 4 111 7 001 1 000 0
  • 43. Positional Number System • A positional number system is also known as weighted number system. • As the name implies there will be a weight associated with each digit. • Few examples of positional number system are decimal number system, Binary number system, octal number system ,etc. 43
  • 44. Non-Positional Number System • Non-positional number system is also known as non-weighted number system. • Digit value is independent of its position. Non- positional number system is used for shift position encodes and error detecting purpose. • Few examples of non-weighted number system are gray code, roman code, excess-3 code, etc. 44
  • 45. Signed numbers • Digital systems such as computer must be able to handle both positive and negative numbers. A signed binary number consists of both signed and magnitude information. • Eg: Signed number : +7 7 = Binary Number 111 +7 = 0 111 • Sign indicates whether a number is positive or negative and magnitude is the value of the number. Left most bit is the sign bit. • ‘0’ sign bit indicates a positive number and ‘1’ sign bit indicates a negative number. 45
  • 46. Signed numbers There are 3 forms in which sign integer numbers can be represented in binary. 1. Signed magnitude 2. 1’s Complement 3. 2’s Complement 46
  • 47. Signed Magnitude form • When a signed binary number is represented in a sign magnitude form, left most bit is the signed bit and remaining bits are magnitude bit. • The magnitude bits are in a true binary for both positive and negative numbers. • Eg : Represent decimal number +25 on 8-bit signed binary number. 25  (11001)2 +25  0 0011001 + Sign Magnitude
  • 48. Example Q. Similarly -75 is represented (8-bit) as ??? Ans: 1 1001011 75 = 1001011 -75 = 1 1001011 48
  • 49. 1’s Complement 49 1 1 1 1 1 1 0 1 0 0 1 0 - (1’s complement of 1101) 1 1 1 . 1 0 1 . 0 1 0 . - (1’s complement of 101.01) 1 1 0 1 1 0  1’s complement of a binary number is obtained by subtracting each digit of that binary number from 1.  Example
  • 50. 1’s Complement Form • Positive Numbers are simply represented as it is. • If the number is negative, First represent the number with positive sign and then take 1’s complement of that number. • Ex: Using 8-bit, find 1’s complement of decimal number -25. Step-1 : +25 = 00011001 Step-2 : 1’s complement : 11100110 Q. Find 1’s complement of -75 using 8-bit Step-1 : +75 = 0 1001011 Step-2 : 1’s complement : 10110100
  • 51. 2’s Complement • 2’s complement of a binary number is obtained by adding 1 to its 1’s complement. 51 1 1 1 1 1 1 0 0 0 0 1 1 - (2’s complement of 1100) 0 1 0 . - (2’s complement of 101.01) 1 1 1 . 1 1 1 0 1 . 0 1 1 0 1 0 1 0 0 1 + + 0 1 0 1 1 .  Example
  • 52. 2’s Complement form • Positive Numbers are simply represented as it is. • If the number is negative, First represent the number with positive sign and then take 2’s complement of that number. E.g. : Find 2’s complement of -25 using 8-bit +25 = 00011001 1’s complement = 11100110 + 1 11100111 Q. Find 2’s complement of -75 Ans: (10110101)
  • 53. Representation of negative number in 2’s complement form • Express -65.5 in 12 bit 2’s complement form. 53 2 65 1 2 32 0 2 16 0 2 8 0 2 4 0 2 2 0 2 1 1 0 0.5 x 2 = 1.0 65.510 = 01000001.10002 So, result in 12-bit binary is as follows: For negative number, we have to convert this into 2’s complement form -65.510 =10111110.10002
  • 54. Assignment Questions: 1. Convert (1101010)2 to octal, decimal and hexadecimal. 2. Convert (1011.01)2 to octal, decimal and hexadecimal. 3. Convert (35.43)10 to binary, octal and hexadecimal. 4. Convert (635.74)8 to binary, decimal and hexadecimal. 5. Convert (D6A)16 to binary, octal & decimal. 6. Express the decimal number -39 as an 8-bit number in sign magnitude, 1’s complement and 2’s complement form.
  • 55. 9’s Complement • 9’s complement of a decimal number is obtained by subtracting each digit of that decimal number from 9. 55 9 9 9 9 3 4 6 5 6 5 3 4 - (9’s complement of 3465) 9 9 9 . 7 8 2 . 2 1 7 . - (9’s complement of 782.54) 9 9 5 4 4 5  Example
  • 56. 10’s Complement • 10’s complement of a decimal number is obtained by adding 1 to its 9’s complement. 56 9 9 9 9 3 4 6 5 6 5 3 4 - (10’s complement of 3465) 2 1 7 . - (10’s complement of 782.54) 9 9 9 . 9 9 7 8 2 . 5 4 4 5 1 6 5 3 5 1 + + 2 1 7 4 6 .  Example
  • 57. Subtraction using 9’s complement • Obtain 9’s complement of subtrahend • Add the result to minuend and call it intermediate result • If carry is generated then answer is positive and add the carry to Least Significant Digit (LSD) • If there is no carry then answer is negative and take 9’s complement of intermediate result and place negative sign to the result. 57
  • 58. Example 58 7 4 5 . 4 3 6 . - 8 1 6 2 1) 745.81 – 436.62 7 4 5 . 8 1 5 6 3 . + 3 7 3 0 9 . 1 1 8 + 1 3 0 9 . 1 9 3 0 9 . 1 9 9’s complement
  • 59. Example 59 7 4 5 . 4 3 6 . - 8 1 6 2 2) 436.62 - 745.81 2 5 4 . + 1 8 6 9 0 . 8 0 3 0 9 . 1 9 3 0 9 . 1 9 - 4 3 6 . 6 2 - 9’s complement 9’s complement As carry is not generated, so take 9’s complement of the intermediate result and add ‘ – ‘ sign to the result
  • 60. Subtraction using 10’s complement • Obtain 10’s complement of subtrahend • Add the result to minuend • If carry is generated then ignore it and result itself is answer • If there is no carry then answer is negative and take 10’s complement of result and place negative sign to the result. 60
  • 61. Example 61 7 4 5 . 4 3 6 . - 8 1 6 2 1) 745.81 – 436.62 5 6 3 . + 7 4 5 . 8 1 3 8 3 0 9 . 1 1 9 3 0 9 . 1 9 Ignore the carry 10’s complement
  • 62. Example 62 7 4 5 . 4 3 6 . - 8 1 6 2 2) 436.62 - 745.81 2 5 4 . + 1 9 6 9 0 . 8 1 3 0 9 . 1 9 3 0 9 . 1 9 - 4 3 6 . 6 2 - 10’s complement 10’s complement As carry is not generated, so take 10’s complement of the intermediate result and add ‘ – ‘ sign to the result
  • 63. Binary Addition • Rules for binary addition 63 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10 i.e. 0 with a carry of 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 1 + . 1 0 1 . 0 1 1 . 0 0 0 1 1
  • 64. Binary Subtraction • Rules for binary subtraction 64 0 – 0 = 0 1 – 1 = 0 1 – 0 = 1 0 – 1 = 1, with a borrow 1 1 0 1 0 0 1 1 1 0 0 1 0 - . 0 1 0 . 1 1 1 . 0 1 1 1 0 1 1 1 0 1 1 0
  • 65. Binary Multiplication • Four basic Rules: A B Output 0 0 0 0 1 0 1 0 0 1 1 1
  • 66. Eg: 1 1 1 x 1 0 1 1 1 1 0 0 0 X + 1 1 1 X X 1 0 0 0 1 1
  • 67. Eg: 1 1 .0 1 x 1 0 .1 1 1 1 0 1 1 1 0 1 X 0 0 0 0 X X + 1 1 0 1 X X X 1 0 0 0. 1 1 1 1
  • 68. Binary Multiplication 68 1 0 1 1 1 1 0 0 1 1 x 1 1 1 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1
  • 69. • Solve the following binary multiplication 2. (101.01)2 and (100.1)2 Ans: 101111.01
  • 70. Binary Division A B Output 0 0 0 0 1 0 1 1 1 1 0 Infinity
  • 71.
  • 72.
  • 73.
  • 74. Binary Division 74 1 0 1 1 0 1 110 0 0 0 0 1 0 11 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 1 1 111.1 0 1 1 0 0 0 0
  • 75. • Solve the following division 1.(11001) by (101) Ans:101 2. (111)2 by (11)2 Ans: 10 remainder 1 3. (110000) by (100) Ans:
  • 76. Subtraction using 1’s Complement • Obtain 1’s complement of subtrahend • Add the result to minuend and call it intermediate result • If carry is generated then answer is positive and add the carry to Least Significant Digit (LSD) • If there is no carry then answer is negative and take 1’s complement of intermediate result and place negative sign to the result. 76
  • 77. Example 77 68. 27. - 75 50 1) 68.75 – 27.50 + 41.25 1’s complement 000 . 1 1 100 01 0 0 + 100 . 100 11 0 11 1 +1 00 1. 1 00 01 0 0 1 11 01 0 . 0 1 00 1 01 0 0
  • 78. Example 78 2) 43.25 - 89.75 As carry is not generated, so take 1’s complement of the intermediate result and add ‘ – ‘ sign to the result 43. 89. - 25 75 - 46.50 1’s complement 101 . 0 1 011 00 0 0 + 100 . 110 10 0 01 1 00 1. 0 01 10 1 1 11 11 0. 1 10 01 0 0 00 1’s complement
  • 79. Subtraction using 2’s Complement • Obtain 2’s complement of subtrahend • Add the result to minuend • If carry is generated then ignore it and result itself is answer • If there is no carry then answer is negative and take 2’s complement of result and place negative sign to the result. 79
  • 80. Example 80 68. 27. - 75 50 1) 68.75 – 27.50 + 41.25 2’s complement 000 . 1 1 100 01 0 0 + 100 . 100 11 1 00 0 00 1. 1 01 01 0 0 1 00 00 1. 1 01 01 0 0 00 Ignore Carry bit
  • 81. Example 81 2) 43.25 - 89.75 As carry is not generated, so take 2’s complement of the intermediate result and add ‘ – ‘ sign to the result 43. 89. - 25 75 - 46.50 2’s complement 101 . 0 1 011 00 0 0 + 100 . 110 10 0 10 0 00 1. 0 10 10 1 1 00 11 0. 1 10 01 0 0 00 2’s complement
  • 82. Signed Binary Numbers • To represent negative integers, we need a notation for negative values. • It is customary to represent the sign with a bit placed in the leftmost position of the number since binary digits. • The convention is to make the sign bit 0 for positive and 1 for negative. • Different methods of representations (example): • Table 1.3 lists all possible four-bit signed binary numbers in the three representations.
  • 84. Signed Binary Numbers • Arithmetic addition – The addition of two numbers in the signed-magnitude system follows the rules of ordinary arithmetic. If the signs are the same, we add the two magnitudes and give the sum the common sign. If the signs are different, we subtract the smaller magnitude from the larger and give the difference the sign if the larger magnitude. – The addition of two signed binary numbers with negative numbers represented in signed-2's-complement form is obtained from the addition of the two numbers, including their sign bits. – A carry out of the sign-bit position is discarded. • Example:
  • 85. Signed Binary Numbers • Arithmetic Subtraction – In 2’s-complement form: • Example: 1. Take the 2’s complement of the subtrahend (including the sign bit) and add it to the minuend (including sign bit). 2. A carry out of sign-bit position is discarded. ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) A B A B A B A B               ( 6)  ( 13) (11111010  11110011) (11111010 + 00001101) 00000111 (+ 7)
  • 86. Representation of Floating Point Number ©spickmlk 86
  • 87. BINARY REPRESENTATION OF FLOATING POINT NUMBERS Converting decimal fractions into binary representation. Consider a decimal fraction of the form: 0.d1d2...dn We want to convert this to a binary fraction of the form: 0.b1b2...bn (using binary digits instead of decimal digits)
  • 88. Algorithm for conversion Let X be a decimal fraction: 0.d1d2..dn i = 1 Repeat until X = 0 or i = required no. of binary fractional digits { Y = X * 2 X = fractional part of Y Bi = integer part of Y i = i + 1 }
  • 89. EXAMPLE 1 Convert 0.75 to binary X = 0.75 (initial value) X* 2 = 1.50. Set b1 = 1, X = 0.5 X* 2 = 1.0. Set b2 = 1, X = 0.0 The binary representation for 0.75 is thus 0.b1b2 = 0.11b
  • 90. Let's consider what that means... In the binary representation 0.b1b2...bm b1 represents 2-1 (i.e., 1/2) b2 represents 2-2 (i.e., 1/4) ... bm represents 2-m (1/(2m)) So, 0.11 binary represents 2-1 + 2-2 = 1/2 + 1/4 = 3/4 = 0.75
  • 91. EXAMPLE 2 Convert the decimal value 4.9 into binary Part 1: convert the integer part into binary: 4 = 100 b
  • 92. Part 2. Convert the fractional part into binary using multiplication by 2: X = .9*2 = 1.8. Set b1 = 1, X = 0.8 X*2 = 1.6. Set b2 = 1, X = 0.6 X*2 = 1.2. Set b3 = 1, X = 0.2 X*2 = 0.4. Set b4 = 0, X = 0.4 X*2 = 0.8. Set b5 = 0, X = 0.8, which repeats from the second line above.
  • 93. Since X is now repeating the value 0.8, we know the representation will repeat. The binary representation of 4.9 is thus: 100.1110011001100...
  • 94. COMPUTER REPRESENTATION OF FLOATING POINT NUMBERS In the CPU, a 32-bit floating point number is represented using IEEE standard format as follows: SIGN | EXPONENT | MANTISSA where SIGN is one bit, the EXPONENT is 8 bits, and the MANTISSA is 23 bits.
  • 95. • The mantissa represents the leading significant bits in the number. • The exponent is used to adjust the position of the binary point (as opposed to a "decimal" point) • The mantissa is said to be normalized when it is expressed as a value between 1 and 2. I.e., the mantissa would be in the form 1.xxxx.
  • 96. • The leading integer of the binary representation is not stored. Since it is always a 1, it can be easily restored. • The "SIGN" bit is used as a sign bit and indicates whether the value represented is positive or negative (0 for positive, 1 for negative) • If a number is smaller than 1, normalizing the mantissa will produce a negative exponent. • But 127 is added to all exponents in the floating point representation, allowing all exponents to be represented by a positive number.
  • 97. Example 1. Represent the decimal value 2.5 in 32- bit floating point format. 2.5 = 10.1 In normalized form, this is: 1.01 * 21 The mantissa: M = 01000000000000000000000 (23 bits without the leading 1) The exponent: E = 1 + 127 = 128 = 10000000 The sign: S = 0 (the value stored is positive) So, 2.5 = 0 1000000001 000000000000000000000
  • 98. Example 2: Represent the number -0.00010011 in floating point form. 0.00010011 = 1.0011 * 2-4 Mantissa: M = 00110000000000000000000 (23 bits with the integral 1 not represented) Exponent: E = -4 + 127 = 01111011 S = 1 (as the number is negative) Result: 1 01111011 00110000000000000000000
  • 99. Exercise 1: represent -0.75 in floating point format. Exercise 2: represent 4.9 in floating point format.