Chapter 6

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 48

Data

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

Example 1: of Binary Numbers:

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

0 be1so borrow from next position)


=02 – 12(cannot
2 (borrowed base)+02-12=12
=12 – 12(borrowed)=02
Four Basic Rules in Subtraction
of Binary Numbers:

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

=48+38+1(carry)=8(invalid) )-8(base)= 08 with carry 1


=Bring down 1 (carry-over)
Addition of Octal Numbers
Example #7: Base:

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

B16 A16 316


916 216 C16
±
=316+12(Value of C16)=F16(Equivalent of 15)
1
=10(Value of A16)+216=C16(Equivalent 4of 12) C F16
=11(Value of B16)+916=20(Invalid)
=20 – 16(base)=416 with carry 1
Subtraction of Hexadecimal Numbers
Base :16
Example #10: Valid Entries:

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

816 316 716


216 516 A16
-
=716 – A16(Cannot be so borrow from next position)
=7+16(barrowed base) – 10 (Value of A16) 5=D 16 D
(Equivalent of 13)D16
=316 – 116(borrowed) – 516 =(cannot be so borrow)
= 2+16(barrowed base) – 516
=D16(Equivalent of 13)
=816-116(borrowed) – 216=516
Board Work Exercises
1. ADA16+ADE16
2. BAD16+BED16+ADD16
3. A999D16 – C453F16
NUMBER
SYSTEM
CONVERSION
To Convert Decimal Whole Number
into any base
Divide the whole number by the base
required. Get the quotient and reminder.
Repeatedly divide the quotient by the
base required until the quotient becomes
zero (0). Take note of all reminders.
 Get all the remainders, the most recent
remainders is the most significant position
(msp) and the first reminder is the least
significant position (lsp).
Example #11
31
25=___________ 8

Divisor Quotient Reminder

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

Multiply the digit by its corresponding


weight representations

Add all the weight representations to


obtain the result
Example #13
55 10
1101112=___________

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

Two(2) ways to represent negative


numbers:

1. Absolute Value Representation

2. Complement Value Representation


To represent negative numbers through
Absolute Value Representation

The absolute value representation uses an


eight(8)-bit representation where the first
bit corresponds to the sign and the last
seven(7) bits to the value of the number. A
value of one(1) in the first bit means
negative while a zero(0) value represents a
positive number.
Example # 16
-15 is represented as

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

There are two types of complement value


representation:

1. Reduced Base Complement


2. Base Complement
Reduced Base Complement
Negative Binary
Decimal Compliment Binary Complement
Number
9’s complement results 1’s complement results 1’s complement
in subtracting the in subtracting the Get the 1’s complement
highest possible value highest possible value of the number and affix
from the given number. from the given number. 1 on the 8th bit.

Example: 25610 Example: 10112


Example: -9610
999 11112
- 256 - 10112 11111112
743 01002 - 11000002
00111112

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.

Example: 25610 Example: 10112 Example: -9610

743(9’s Com) 10112(1’s Com) 00111112


+ 1 + 12 + 12
744 01012 01000002

101000002

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy