0% found this document useful (0 votes)
127 views57 pages

Module 1 Review On Number Systems

1. A number system consists of a set of numbers that follow a particular pattern. Common number systems include binary, decimal, octal, and hexadecimal. 2. Decimal uses base 10 with digits 0-9. Binary uses base 2 with digits 0-1. Octal uses base 8 with digits 0-7. Hexadecimal uses base 16 with digits 0-9 and A-F. 3. Converting between number systems involves grouping digits into the appropriate base and substituting them. For example, converting binary to octal involves grouping into sets of 3 digits and substituting them.

Uploaded by

FerrolinoLouie
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)
127 views57 pages

Module 1 Review On Number Systems

1. A number system consists of a set of numbers that follow a particular pattern. Common number systems include binary, decimal, octal, and hexadecimal. 2. Decimal uses base 10 with digits 0-9. Binary uses base 2 with digits 0-1. Octal uses base 8 with digits 0-7. Hexadecimal uses base 16 with digits 0-9 and A-F. 3. Converting between number systems involves grouping digits into the appropriate base and substituting them. For example, converting binary to octal involves grouping into sets of 3 digits and substituting them.

Uploaded by

FerrolinoLouie
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/ 57

Module 1:

Review on Number Systems


DIGITAL CIRCUITS 2:MICROPROCESSORS,
MICROCONTROLLER SYSTEMS AND DESIGN

ENGR. MELANNIE B. MENDOZA


Number System
• A NUMBER SYSTEM SIMPLY CONSISTS
OF A SET OF NUMBERS. HOWEVER,
TO BE PROPERLY CATEGORIZED AS A
NUMBER SYSTEM, THE NUMBERS IN
THE GROUP MUST FOLLOW A
PARTICULAR PATTERN OR MEET SETS
OF CRITERIA.
• FOR EXAMPLE, THE BASIC TYPE OF
NUMBER SYSTEM IN USE
INTERNATIONALLY IS THE DECIMAL
SYSTEM.
NUMBER SYSTEM
BASE NAME DIGITS
2 Binary 0-1
3 Tertiary 0-2
4 Quartery 0-3
5 Quinary 0-4
6 Senary 0-5
7 Septary 0-6
8 Octal 0-7
9 Nonary 0-8
10 Decimal 0-9
11 Unodinary 0-A
12 Duodinary 0-B
13 Terdinary 0-C
14 Quardinary 0-D
15 Quidinary 0-E
16 Hexadecimal 0-F
NUMBER SYSTEM
Decimal Hexadecimal Binary Octal
0 0 0000 0
1 1 0001 1
2 2 0010 2
3 3 0011 3
4 4 0100 4
5 5 0101 5
6 6 0110 6
7 7 0111 7
8 8 1000 10
9 9 1001 11
10 A 1010 12
11 B 1011 13
12 C 1100 14
13 D 1101 15
14 E 1110 16
15 F 1111 17
DECIMAL NUMBER SYSTEM (BASE 10)
This is the most commonly used number system in use by humans today. It uses ten
digits, 0 through 9. It is possibly used because humans have ten fingers, and these
were used for primitive counting. There is nothing intrinsically “right” about the
decimal number system, it is simply one of an infinite number. The number 19 is
represented by nine units and one ten, or 19.
Base-10 number System: Value of its digit is express as a power of 10
Example: 4 6. 7 2

101 100 10-1 10-2


BINARY SYSTEM (BASE 2)
A binary digit is often called a bit, it is either 0 (Low) and (High)
A binary number is often called a binary word or word
o A 4-bit binary world is called a nibble
o A 8-bit binary world is called a byte
o A 16-bit binary world is called a word
o A 32-bit binary word is called a double word
Example, a binary number 1 0 1 .1 1

22 21 20 2-1 2-2
OCTAL SYSTEM (BASE 8)
Each octal number is a power of 8.
Easy conversion of octal to decimal.
Example 1 2 3. 0 7

82 81 80 8-1 8-2
HEXADECIMAL SYSTEM (BASE 16)
Each hex number is a power of 16.
Easy to remember in comparing with the long binary words.
Easy conversion of binary to hexadecimal.
Example C 2 3. 0 A

162 161 160 16-1 16-2


CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Binary
4510 → X2
2 | 45 |1 1011012
2 | 22 |0
2 | 11 |1 1 * 20= 1
0 * 21= 0
2| 5 |1
1 * 22= 4
2| 2 |0 1 * 23= 8
0 * 24= 0
1
1 * 25=32
101101 =4510
2
CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Binary
4510 → X2
2 | 45 |1 1011012 45 . 75 10 = X2

2 | 22 |0
2 | 11 |1 1 * 20= 1
0 * 21= 0
2| 5 |1
1 * 22= 4
2| 2 |0 1 * 23= 8
0 * 24= 0
1
1 * 25=32
101101 =4510
2
CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Binary
4510 → X2
2 | 45 |1 1011012 45 . 75 10 = X2
101101 .112
2 | 22 |0
0.75* 2= 1.5
2 | 11 |1 1 * 20= 1 0.50* 2= 1.0
0 * 21= 0
2| 5 |1 101101 . 112= X10
1 * 22= 4
2| 2 |0 1 * 23= 8
0 * 24= 0
1
1 * 25=32
101101 =4510
2
CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Binary
4510 → X2
2 | 45 |1 1011012 45 . 75 10 = X2
101101 . 112
2 | 22 |0
0.75* 2= 1.5
2 | 11 |1 1 * 20= 1 0.50* 2= 1.0
0 * 21= 0
2| 5 |1 101101 . 112= X10
1 * 22= 4
2| 2 |0 45 . 752 1 * 2-1= 0.5
1 * 23= 8
1 * 2-2= 0.25
0 * 24= 0
1
1 * 25=32
101101 =4510
2
CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Octal
7510 → X8
8 | 75 |3 1138
8| 9 |1
1 3 * 80= 3
1 * 81= 8
113 1 * 82= 64
8
=7510
CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Octal
7510 → X8
8 | 75 |3 1138 75 . 75 10 = X2
113 . 68
8| 9 |1
0.75* 8= 6
1 3 * 80= 3
1 * 81= 8 113 . 62= X10
113 1 * 82= 64 75 . 752
8
=7510 6 * 8-1= 0.75
CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Hexadecimal
8010 → X16
16 | 80 |0 5016
5

50 0 * 160= 0
16 5 * 161= 80
= 8010
CONVERSION OF NUMBER SYSTEM
Convert Decimal ↔ Hexadecimal
8010 → X16
16 | 80 |0 5016
5 80 . 75 10 = X16
50 . C16
50 0 * 160= 0 0.75* 16= 12=C
16 5 * 161= 80
50 . C16= X10
= 8010
80 . 752
C * 16-1= 0.75
12 *16-1= 0.75
CONVERSION OF NUMBER SYSTEM
Convert Binary ↔ Octal
10111.01 10 → X8
010111.010
2 7 . 28

2 7 . 28 → X2
010 111. 010 DISCARD LSB AND LEFTMOST ZERO
10111.01 10
CONVERSION OF NUMBER SYSTEM
Convert Binary ↔ Hexadecimal
10111.01 10 → X16
000 1 0 1 1 1 . 0 1 00
1 7 . 216

1 7 . 216 → X2
000 1 0 1 1 1 . 0 1 00
10111.01 10
CONVERSION OF NUMBER SYSTEM
Convert any Base ↔ any Base
As we all know, 23 results to 8 and 24 gives 16. This reality, believe it or not, will help
you understand how to convert from binary to octal and hexadecimal and vice versa.
As we said before, 23 gives 8, so in order to convert a binary number to octal, we
need 3 digits that will represent a digit of the octal number. Therefore, for a
hexadecimal number we need 4 digits to represent a hexadecimal digit. For
that reason, we convert a binary number to octal, then separate the binary number
into triads or quadruples (when hex), starting from right to left when talking about
integers and from left to right when it’s about decimals starting from the period. If
there are digits left in the end that does not make a triple or a quadruple, for the hex
system we pad with 0 in front of the number. Then, we substitute each three digit
number or four digit binary number with a digit that corresponds to octal when it’s
triples or hex when its quadruples. Here are some examples to understand what was
said.
Addition of
Number System
• ADDITION OF NUMBER SYSTEM IS BASICALLY THE SAME
AS ADDITION OF DECIMAL NUMBERS. EACH SYSTEM HAS
AN AUGEND, AN ADDEND, A SUM, AND CARRIES.
ADDITION OF NUMBER SYSTEM
DECIMAL ADDITION
The usual addition of counting numbers.

111 1 CARRY

978.19 10 AUGEND

+ 128.19 10 ADDEND

1106.38 10 SUM
ADDITION OF NUMBER SYSTEM
BINARY ADDITION
Since only two symbols, 0 and 1, are used with the binary system,
only four combinations of addition are possible.
0+0 = 0
1+0 = 1
0+1 = 1
1+1 = 0 with a carry of 1
ADDITION OF NUMBER SYSTEM
BINARY ADDITION
1 1 1 11 1
1 11101.11 2 AUGEND

1 111111.01 2 ADDEND

1011101.00 2 SUM
ADDITION OF NUMBER SYSTEM
BINARY ADDITION
ADDITION OF NUMBER SYSTEM
OCTAL ADDITION
Getting the sum of octal numbers is just the same as getting the sum
of binary or decimal. But the sum that produces greater than or equal
to 8 needs a conversion to its octal equivalent

3 1 2.6 78
+ 6 4 0.3 58
ADDITION OF NUMBER SYSTEM
OCTAL ADDITION
Getting the sum of octal numbers is just the same as getting the sum
of binary or decimal. But the sum that produces greater than or equal
to 8 needs a conversion to its octal equivalent

1 1 7+5 = 12 – 8= 4 WITH 1 8’S


6+3+1= 9 - 8= 1 WITH 1 8’S
3 1 2.6 78 2+1 = 3 WITH 0 8’S
1+4 = 5 WITH 0 8’S
+ 6 4 0.3 58 3+6 = 9 – 8= 1 WITH 1 8’S

1 05 3.1 48
ADDITION OF NUMBER SYSTEM
HEXADECIMAL ADDITION
Getting the sum of octal numbers is just the same as getting the sum
of binary or decimal. But the sum that produces greater than or equal
to 8 needs a conversion to its octal equivalent

1 1 1 7+A = 17 – 16= 1 WITH 1 16’S


6+B+1= 18 - 16= 2 WITH 1 16’S
A D D.6 716 D+1 = 14 =E WITH 0 16’S
D+C = 25 – 16 =9 WITH 1 16’S
+ C 0.B A16 A+1 = B =B WITH 0 16’S

1 2 E.9B16
SUBTRACTION OF NUMBER SYSTEM
DECIMAL SUBTRACTION
9 9 9 10
1 0 0 0 0 10
- 9 9 9 9 10

0 0 0 1 10
1 1010
SUBTRACTION OF NUMBER SYSTEM
BINARY SUBTRACTION
The following are the four rules that you must observe when
subtracting:
Rule 1: 02 – 02 = 02
Rule 2: 12 – 02 = 12
Rule 3: 02 – 12 = 12
Rule 4: 12 – 12 = 12 with a borrow
SUBTRACTION OF NUMBER SYSTEM
BINARY SUBTRACTION
The following example (101102 - 11002) demonstrates the
four rules of binary subtraction:

1 0 1 1 02 Minuend
- 1 1 0 02 Subtrahend
? 0 1 02 Difference
Rule 1 02 – 02 = 02
Rule 2 12– 02 = 12
Rule 3 12– 12 = 02
Rule 4
SUBTRACTION OF NUMBER SYSTEM
BINARY SUBTRACTION
The following example (101102 - 11002) demonstrates the
four rules of binary subtraction:

Rule 4 presents a different situation


1 0 1 1 02 Minuend because you cannot subtract 1 from 0.
Since you cannot subtract 1 from 0 and
- 1 1 0 02 Subtrahend have a positive difference, you must
borrow the 1 from the next higher order
1 0 1 02 Difference column of the minuend.
Rule 1 02 – 02 = 02
Rule 2 12– 02 = 12
Rule 3 12– 12 = 02
Rule 4
SUBTRACTION OF NUMBER SYSTEM
OCTAL SUBTRACTION

6 1 8+5= 13 -7 = 6

73256 8
8+3= 11 -4 =7

-3 4 0 7 2 8

37164 8

Rule 1 02 – 02 = 02
Rule 2 12– 02 = 12
Rule 3 12– 12 = 02
Rule 4
SUBTRACTION OF NUMBER SYSTEM
HEXADECIMAL SUBTRACTION

9 14 16+1= 17 -A = 7

A 1 F 5 616 16+5= 21 -C =9

-4 A 2 C 516
5 7 C 9 116
MULTIPLICATION OF NUMBER SYSTEM
BINARY MULTIPLICATION

1 0 1 1 12 Applies regular multiplication of


x 10112 numbers and binary addition
101110
1 0 1 1 12
1 0 1 1 12
0 0 0 0 02
1 0 1 1 1 02
MULTIPLICATION OF NUMBER SYSTEM
OCTAL MULTIPLICATION

5 1 7.1 8 Applies regular multiplication of


x 5.2 8 numbers and OCTAL addition

1 2 3 6 28
3 2 1 3 58
4 4 5 1 78
MULTIPLICATION OF NUMBER SYSTEM
HEXADECIMAL MULTIPLICATION

B 1 7.1 16 Applies regular multiplication of


x A.1 16 numbers and HEXADECIMAL addition
B 1 7.1 16
6 E E 6.A16
7 9 F D.B16
DIVISION OF NUMBER SYSTEM
BINARY DIVISION

101101 2 /101 2

1 0 0 12
101 101101
-101
101
-101
0
DIVISION OF NUMBER SYSTEM
OCTAL DIVISION

5558 / 21 8

21 555
DIVISION OF NUMBER SYSTEM
OCTAL DIVISION

5558 / 21 8

25.36078
21 555.0000
- 42
1 35
- 1 25
100
63
150
146
200
DIVISION OF NUMBER SYSTEM
OCTAL DIVISION

5558 / 21 8

25.36078
21 555.0000
- 42
1 35
- 1 25
100
63
150
146
200
DIVISION OF NUMBER SYSTEM
HEXADECIMAL DIVISION

55516 / A 16

A 555
DIVISION OF NUMBER SYSTEM
HEXADECIMAL DIVISION

55516 / A 16

88.816
A 555.0
- 50
55
- 50
50
- 50
0
DIVISION OF NUMBER SYSTEM
HEXADECIMAL DIVISION

55516 / A 16

88.816
A 555.0
- 50
55
- 50
50
- 50
0
COMPLEMENTS
Digital computer’s negative representation of a number.
r’s complement – given a positive number N in base r with
an integer part of n digits, the r’s complement of N is
rn-N

Examples:
The 10’s complement of 67010 (N=670, r=10, n=3)
10’s complement of 67010= 103 – 670 = 330
COMPLEMENTS
Digital computer’s negative representation of a number.
r’s complement – given a positive number N in base r with
an integer part of n digits, the r’s complement of N is
rn-N

The 10’s complement of 0.67510 (N=0.675, r=10, n=0)


10’s complement of 0.67510= 100 – 0.675 = 0.325
COMPLEMENTS
Digital computer’s negative representation of a number.
r’s complement – given a positive number N in base r with an integer
part of n digits, the r’s complement of N is rn-N

The 2’s complement of 10102 (N=1010, r=2, n=4)


The 2’s complement of 10102 = 24 – 1010
= 1610 – 10102
= 100002 - 10102
= 001102
COMPLEMENTS
Digital computer’s negative representation of a number.
r’s complement – given a positive number N in base r with an integer
part of n digits, the r’s complement of N is rn-N

The 2’s complement of 10102 (N=1010, r=2, n=4)


The 2’s complement of 10102 = 24 – 1010
= 1610 – 10102
= 100002 - 10102
= 001102
COMPLEMENTS
(r-1)’s complement – given a positive N in base r with an integer part
of n digits and a fraction part of m digits, the (r-1)’s complement of N
is rn- r -m - N..
The 9’s complement of 5252010 (N=52520, r=10, n=5, m=0)
The 9’s complement of 5252010 = 105 – 100 – 52520
= 100000 –1 – 52520
= 47479
COMPLEMENTS
(r-1)’s complement – given a positive N in base r with an integer part
of n digits and a fraction part of m digits, the (r-1)’s complement of N
is (rn- 1) -N.
The 9’s complement of 5252010 (N=52520, r=10, n=5, m=0)
The 9’s complement of 5252010 = (105 -1)– 52520
= (100000 –1) – 52520
= 4747910
The 9’s complement of 0.32610 (N=0.326, r = 10, n = 0, m= 3)
The 9’s complement of 0.32610 = 100 – 10-3 – 0.326
= 1 – 0.001 – 0.326
= 0.673

The 1’s complement of 1011002 (N = 101100, r = 2, n = 6, m = 0)


The 1’s complement of 1011002 = 26 – 20 – 1011002
= 10000002 – 12 - 1011002
= 0100112

The 1’s complement of 0.01102 (N = 0.0110, r = 2, n = 0, m=4)


The 1’s complement of 0.01102 = 20 – 2-4 – 0.01102
= 12 – 0.00012 – 0.01102
= 0.10012
COMPLEMENTARY SUBTRACTION
A complement is used for subtractions. In most number systems
you will find two types of complements. The first type of
complement is the difference between a number and the next
higher power of the number base.

There are three important points we should mention before we


start:
1. Never complement the minuend in a problem.
2. Always disregard any carry beyond the number of positions of
the largest of the original numbers.
3. Add the R’s complement of the original subtrahend to the
original minuend.
COMPLEMENTARY SUBTRACTION
Example. Subtract 38 from 59

59- 38 = 21

Using R’s complement


102-38 = 62 (R’s complement of the Subtrahend)
59 + 62 = 121 = 21
Discard end carry
COMPLEMENTARY SUBTRACTION
COMPLEMENTARY SUBTRACTION

Step 1 - Start with the LSD, working to the MSD, writing the
digits as they are up to and including the first one.

Step 2-Now R's-1 complement the remaining digits:


COMPLEMENTARY SUBTRACTION
Now let's R's complement the same number using both methods:
COMPLEMENTARY SUBTRACTION
Subtract 910 from 510 (10012 from 01012):

Step 1 - Leave the minuend alone: 01012 remains 01012


Step 2 - R's complement the subtrahend: 01112 R's complement of subtrahend
Step 3 - Add the R's complement found in step 2 to the minuend of the original
problem:
COMPLEMENTARY SUBTRACTION
Step 4 - We do not have a carry; and this tells us, and any computer,
that our difference (answer) is negative. With no carry, we must R's
complement the difference in step 3. We will then have arrived at the
answer (difference) to our original problem. Let's do this R's complement
step and then check our answer:

01002 R's complement of difference in step 3


Remember, we had no carry in step 3. That showed us our answer was going
to be negative. Make sure you indicate the difference is negative. Let's
check the answer to our problem:

You might also like