Chapter 1 LogicCircuitDesign Lecture
Chapter 1 LogicCircuitDesign Lecture
Number System
4. Hexadecimal 16 0-9,A,B,C,D,E,F
Note: A=10, B=11, C=12, D=13, E=14, F=15
▪ uses base 2
2
▪ includes only the digits 0 and 1 (any other digit
would make the number an invalid binary number)
▪ uses base 8
▪ includes only the digits 0 through 7 (any other digit
would make the number an invalid octal number)
3
The Hexadecimal system is based on the binary system
using a Nibble or 4-bit boundary. In Assembly Language
programming, most assemblers require the first digit of a
hexadecimal number to be 0, and we place an H at the
end of the number to denote the number base.
▪ uses base 16
▪ includes only the digits 0 through 9 and the letters
A, B, C, D, E, and F
4
Example: Convert the decimal number 82 to base 6:
82/6 = 13 remainder 4
13/6 = 2 remainder 1
2/6 = 0 remainder 2
The answer is formed by taking the remainders in reverse
order: 2
1 4 base 6
2910 - N2
Remainder
21 29
20 14
21
21 7
1 3
1
Therefore, 2910 =
111012
5
Base 8)
94210-N8
Remainder 942
86 117
85
86 14
1 1
259810 - N16
Remainder 2598
16 6 162
16 2
A 10
6
Therefore, 259810 = A2616
1012-N10
1 * 2 = 2
2 + 0 = 2
2 * 2 = 4
4 + 1 = 5
7
Therefore, 1012 = 510
1 * 8 = 8 8 + 7
= 15
15 * 8 = 120 120 + 5
= 125
3AE16 – N10
3 * 16 = 48
48 + 10 = 58
58 * 16 = 928
928 + 14 = 942
8
Therefore, 3AE16 = 94210
1012
1 * 20 = 1
0 * 21 = 0
1 * 22 = 4
510
1758 - N10
1752
5 * 80 = 1
7 * 81 = 56
1 * 82 = 64
12510
3AE16
14 * 160 = 14
10 * 161 = 160
3 * 162 = 768
94210
9
3. Converting from Binary to Octal and Hexadecimal
11010112 – N8
421 421 421
001/101/011
1 5 3
T
h
er
ef
or
e,
1
1
0
1
0
1
12
is
1
5
3
8
B. Binary Number to Hexadecimal Number
Rules:
10
1. Begin at the binary point (rightmost digit) and block off
groups of four binary digits.
2. Replace each group of three binary digits with its
equivalent hexadecimal digit. The digit will range from 0
– 15.
8 4 2 18 4 2 1
1 1 1 01 011
14 11
Rules:
Replace each Octal digit with the equivalent three
binary digit/ each Hexadecimal digit with the
equivalent four binary digit.
264
0 1 01 1 01 0 0
Answer 0101101002
Chapter 1
Lecture Activity No. 1
11
Name: ______________________________ Rating: _________________
Instructor: _________________________ Schedule: _____________
2 8 16
1.1 26510
2 8 16
1.2 23510
2 8 16
1.3 121071
0
10
2.1 10000110112
10
2.2 65408
10
2.3 CA4D16
3.1 111100012 10
10
3.2 3768
10
3.3 8A216
12
4.1 11001112 10 8 16
2 16 10
4.2 73758
2 8 10
4.3 B49F16
ARITHMETIC OPERATIONS
A. BINARY ADDITION.
Rules:
0+0=0
0+1=1
1+0=1
1 + 1 = 0 with a carry of 1 to the next digit to the left
1 1
13
1 0 1 0 1 1
+ 1 1 0 0 1 01 0
1 1 1 0 1
B. OCTAL ADDITION
Rules:
a. Add the rightmost digit and divide the sum by
8.
b. The quotient will be carried to the next digit to
the left and the remainder is brought down as
the actual sum.
c. Repeat the whole process until the leftmost
digits have been added.
111 755
+ 1 6 5
1 1 4 2
1 1 2 1
7 6 4 3
+ 1 3 5 7
2 4 6 5
1 3 7 0 7
1 1 1 1
9A43
+FACE
1 9 5 1 1
1 1 1
A 7 A 6 2
+ 1 D E A C C 5 9
0 E
15
Rules:
a. Complement the subtrahend by converting 1’s
to 0’s and 0’s to 1’s.
b. Add the complemented subtrahend to the
minuend, using the rules in binary addition.
c. If there is no-carry over, re-complement the
result and a negative sign must be attached.
d. If there is a carry-over, add 1 to the unit
position of the result and the result is positive.
Examples:
0 1 0 1
+ 1
0 1 1 02 Difference
1. 1 0 1 1 12
-
Complement of the subtrahend
+1 1 1 1 0 1 2 1 1 0
0 1 0
0 0
0 1 1
0
1
1
There is no carry-over, apply rule c.
16
11100 => 000112 or – 112
Differences
B. OCTAL SUBTRACTION
Rules:
1. 7 6 58 2. 7 3 4 28
- 4 7 38 - 1 4 5 6
8
2 7 28 5 6 6 48
C. HEXADECIMAL SUBTRACTION
Rules:
17
9 8 7
- 4 6 9
5 1 E16
F 8 7 916
- A B C D16
4 C A C16
A. BINARY MULTIPLICATION
Rules:
0 x 0 = 0 Follow
the given rules and then proceed to binary
addition
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1
18
1
.
+
x 0 + 1 1 0 1 1 02
B. OCTAL MULTIPLICATION
Rules:
1. 4 6 78
1
+ 4
6
x 1
28
1 5 6
6 7
0 4 68
C. HEXADECIMAL MULTIPLICATION
Rules:
19
d. Continue the process until the leftmost digit
has been multiplied.
1. 9 8 716
1 5
x 6
7
4 316
C 9
+ 2 1 C
2 E 5 51
6
A. BINARY DIVISION
Rules:
20
1 0 x 1
- 1
0 0 1 0 0 0 02
r
0 0 0 1 1 1 0
1
Checking: 0
1 02 1 1 0 1 2 1 1
0
1 0
0 0 0
1
0
1 + 1
1 1 0 1
58
+
7
3
3 4 5 2
1 8 316 r 7 Checking
A16 F 516 1 8 316
2 A x
A16 5
25 1
0 7
F E
+
5 F 2 5
E
7
Chapter 1
Lecture Activity No. 2
22
Perform addition for the following sets of integer numbers:
1. B C A E D16
+ 1 B F A C E16
2. 6 7 8 2 2 910
+ 5 6 7 8 9 810
2. 6 7 5 5 68
+ 7 6 7 7 58
Chapter Lecture
Activity No. 3
23
1. Subtract (ADFA816) from (FF25D16)
Chapter 1
Lecture Activity No. 4
2. BFAD16 X 13516
--------------
3. 76558
X 1238
------
Chapter 1
Lecture Activity No. 5
25
1.(123459) / (1239) 4. (1011102) / (11012)
26