Chapter 6
Chapter 6
Chapter 6
Representation
Number Systems
Number Systems are systems or styles of
notations that represent quantities or
numbers.
In mathematics, Number System is a set of
numbers together with one or more
operations such as addition, subtraction and
alike.
Bit and Byte
Any physical system that can exist in two
distinct states that has the potential of being
used to represent numbers or characters.
Examples:
0-1, on-off, high-low, yes-no, up-down, north- south, etc.
Binary System
Binary digit is called a bit.
A series of eight bits strung together
makes a byte
There are two possible states in a bit
usually expressed as 0 and 1.
0 1
Octal System
There can be eight possibilities;
0 1 2 3 4 5 6 7
Decimal System
There are ten different numbers.
0 1 2 3 4 5 6 7 8 9
Hexadecimal System
There are sixteen allowable numbers.
0 1 2 3 4 5 6 7 8 9 ABCDEF
Note: A=10, B=11, C=12, D=13, E=14, F=15
BINARY Decimal Octal Hexadecimal
(Base 2) (Base 10) (Base 8) (Base 16)
0 0 0 0
1 1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8
9 9
A
B
C
D
E
Note: A=10, B=11, C=12, D=13, E=14, F=15 F
CONVERSION OF NUMBER
SYSTEM
BINARY
DECIMAL Number System
Operations
OCTAL
HEXA
Addition and Subtraction Rules Applied
to the Decimal Number System
Base : 10
Valid Entries: 0,1,2,3,4,5,6,7,8,9
Weighted Representation:
1234=1x103+2x102+3x101+4x100
=1x1000+2x100+3x10+4x1
Addition
256
+353
609
Subtraction
765
-328
437
Addition and Subtraction Rules Applied
to the Binary Number System
Base : 2
Valid Entries: 0,1
Weighted Representation:
10012=1x23+0x22+0x21+1x20
=1x8 + 0x4 +0x2 + 1x1
=9
Addition of Binary Numbers
Four Basic Rules in Addition of Binary
Numbers:
1. 02+02=02
2. 12+02=12
3. 02+12=12
4. 12+12=102
Four Basic Rules in Addition
02+02=02
101102+010112 12+02=12
02+12=12
12 02 12 12 02 12+12=102
02 12 02 12 12 Base: 2
Valid Entries: 0,1
±
=02+12=12
1 0 0 0 0 12
=12+12=2(invalid )-2(base)=02 with carry 1
=12+02+12(carry)=2(invalid 2(base)=02 with carry 1
=02+12+12(carry)=2(invalid 2(base)=02 with carry 1
=12+02+12(carry)=2(invalid 2(base)=02 with carry 1
Example 2:
1102+1112+1112+1112
12 12 02
12 12 12
12 12 12
12 12 12
±
Board Work Exercises
1. 111012+110112+101012
2. 101001102+011101112
3. 10101012+010101012+11111112
Subtraction of Binary Numbers
Four Basic Rules in Subtraction of Binary
Numbers:
1. 02-02=02
2. 12-02=12
3. 02-12=(Borrow from next higher value)
4. 12-12=02
Example 3:
Four Basic Rules in Subtraction
of Binary Numbers:
02-02=02
102-12 12-02=12
02-12=(Borrow
12 0 2 from next higher value)
12-12=02
12 Base: 2
- Valid Entries: 0,1
Example 4: 02-02=02
12-02=12
10012-1012 02-12=(Borrow
from next higher value)
12-12=02
12 02 02 02 Base: 2
Valid Entries: 0,1
12 02 12
-
0 1 0 02
Example 5:
100012-10012-1012
Four Basic Rules in Subtraction
12 02 02 02 12 of Binary Numbers:
02-02=02
12-02=12
12 02 02 12 02-12=(Borrow
12 02 12
from next higher value)
12-12=02
- Base: 2
Valid Entries: 0,1
Board Work Exercises
1. 0000002-1111112
2. 111012-110012-111012
3. 101001102-011101112
Addition and Subtraction Rules Applied
to the Octal Number System
Base : 8
Valid Entries: 0,1,2,3,4,5,6,7
Weighted Representation:
14468=1x83+4x82+4x81+6x80 =1
=1x512+4x64+4x8+6x1
= 806
Addition of Octal Numbers
Example #6: Base:
4468+3418
8
Valid Entries:
0,1,2,3,4,5,6,7
48 48 68
38 4 8 18
±
=68+18=7
1 0 0 7 8
=4 +4 =8(invalid )-8(base)=0 with carry 1
8 8 8
6658+3218+5468
8
Valid Entries:
0,1,2,3,4,5,6,7
68 68 58
38 28 18
± 58 48 68
1 7 5 48
Board Work Exercises
1. 55458+55538
2. 1213378+1213378+1213378
3. 7778+7778+3248+4538
Subtraction of Octal Numbers
Example 8: Base:
6538-2568
8
Valid Entries:
0,1,2,3,4,5,6,7
68 58 38
-
28 58 68
3 7 58
38 – 68=(cannot be so borrow from the next position)=38+8(base) – 68=58
58 – 18(borrowed) – 58 =(cannot be so borrow) =48+8(base) – 58=78
68 –18(borrowed) – 28=38
Board Work Exercises
1. 765448 – 674728
2. 1213378 – 13378 –13378
3. 7778 – 3338 – 2228 – 1118
Addition and Subtraction Rules Applied
to the Hexadecimal Number System
Base :
16
Valid Entries:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Where A=10, B=11, C=12, D=13, E=14, F=15
Weighted Representation:
C1216=12x162+1x161+2x160
=12x256+1x16+2x1
= 3090
Addition of Hexadecimal Numbers
Base :16
Example #9: Valid Entries:
BA316+92C16
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Where A=10, B=11, C=12,
D=13, E=14, F=15
83716-25A16
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Where A=10, B=11, C=12,
D=13, E=14, F=15
8 25 1 lsp
8 3 3 msp
0
Example #12
100100 2
36=___________
Divisor Quotient Reminder
2 36 0 lsp
2 18 0
2 9 1
2 4 0
2 2 0
2 1 1 msp
0
Board Work Exercises
1. 506=__________16
2. 316=__________8
3. 895=__________2
To Convert any Number System into
Decimal
1X20 = 1X1 = 1
1x21 = 1x2 = 2
1x22 = 1x4 = 4
0x23 = 1x8 = 0
1x24 = 1x16 = 16
1x25 = 1x32 = 32
5510
Example #14
256 10
3788=___________
8X80 = 8X1 = 8
7x81 = 7x8 = 56
3x82 = 3x64 = 192
25610
Example #15
2232 10
8B816=___________
8X160 = 8X1 = 8
11x161 = 11x16 = 176
8x162 = 8x256 = 2048
223210
Board Work Exercises
1. A3C16=__________10
2. 7768=__________10
3. 1111102=___________10
REPRESENTATION OF NEGATIVE
INTEGERS
1 0 0 0 1 1 1 1
+15 is represented as
0 0 0 0 1 1 1 1
Note:
*Only numbers from -127 to +127 will be represented, hence limited;
*Zero may be represented as 10000000 2 or 000000002 which make it complicated.
To represent negative numbers through
Complement Value Representation
100111112
Base Complement
Negative Binary
Decimal Compliment Binary Complement
Number
10’s complement 2’s complement 2’s complement
is the addition of the is the addition of the Get the 2’s complement
constant 1 to the 9’s constant 1 to the 1’s of the positive number
complement. complement. and affix a 1 on the 8th
bit.
101000002