Addition of Hexadecimal Numbers:: Examples
Addition of Hexadecimal Numbers:: Examples
58 3AF 58
+ 24 + 23C + 4B
7C 5EB 93
Second way: this procedure is quicker, subtract each hex digit from F, and
then add 1. let’s try this for the same hex number from the example above:
F F F
-7 -3 -A Subtract each digit from F
8 C 5
+1 adding 1
8 C 6 hex. Equivalent of 2’s comp.
2
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
2- AND Gate:
The AND Gate is one of the basic gates from which all logic functions are
constructed. An AND gate can have two or more inputs and performs what is
known as logical multiplication. Figure below, all possible logic levels for a 2-
input AND gate.
Inputs Output
Logic Symbol
A B X
0 0 0 A
X
0 1 0 B
1 0 0
1 1 1
3
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
3- OR Gate:
The OR gate is one of the basic gates from which all logic functions are
constructed. An OR gate can have two or more inputs and performs what is know
as logical addition. Figure below, all possible logic levels for a 2-input OR gate.
OR Gate Truth Table
Inputs Output
Logic Symbol
A B X
0 0 0 A
X
0 1 1 B
1 0 1
1 1 1
4- NAND Gate:
The NAND gate is a popular logic element because it can be used as a
universal gate; that is; NAND gate can be used to perform the AND, OR, and
Inverter operations, or any combination of these operations. The term NAND is a
contraction of NOT-AND and implies an AND function with a complemented
(Inverted) output. Figure below Operation of a 2-input NAND gate.
A A
X X
B B
4
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
Inputs Output
Logic Symbol
A B X
0 0 1 A
X
0 1 1 B
1 0 1
1 1 0
5- NOR Gate:
The NOR gate, like the NAND gate, is a very useful logic element because it
can also be used as a universal gate; that is; NOR gate can be used to perform the
AND, OR, and Inverter operations, or any combination of these operations.
Inputs Output
Logic Symbol
A B X
0 0 1 A
X
0 1 0 B
1 0 0
1 1 0
5
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
The term NOR is contraction of NOT-OR and implies an OR function with an
inverted output. Figure below Operation of a 2-input NOR gate.
A A
X X
B B
Inputs Output
Logic Symbol
A B X
0 0 0 A
X
0 1 1 B
1 0 1
1 1 0
6
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
Inputs Output
Logic Symbol
A B X
0 0 1 A
X
0 1 0 B
1 0 0
1 1 1
Example: (a) Develop the truth table for a 3-input AND gate.
(b) Determine the total number of possible input combinations for a
5-input AND gate.
For branch (a) there are eight possible input combinations for a 3-input AND gate.
7
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
Input Output
A B C X
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
For branch (b), N=25 =32. There are 32 possible combinations of input bits for a
5-input AND gate.
Example: for the two input waveforms, A and B, sketch the output waveform,
showing its proper relation to the inputs.
A A
B
B
X
X
When either or both inputs are HIGH, the output is HIGH as shown by the output
waveform X in the timing diagram.
8
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
Example: Sketch the output waveform for the 3-input NOR gate, showing the
proper relation to the input.
A A
B
B C
X
X
The output X is LOW when any input is HIGH as shown by the output waveform
X in the timing diagram.
Example: For the 4-input NOR gate operating as a negative-AND. determine the
output relative to the inputs.
A A
B
C
B D
9
X X
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
Review Questions:
1. When is the output of an AND gate HIGH?
2. Describe the truth table for a five-input AND gate?
3. How can you use an XOR gate to detect when two bits are different?
4. For the 3-input OR gate, determine the output waveform in proper relation
to the inputs?
A
A
B
B C
X
C
5. Determine the output waveform for the XOR gate and for the XNOR gate,
given the input waveforms, A and B?
A
B
A
B
X
10
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
(c) A=0, B=0, C=0 (d) All (e) only a and b
3. A pulse is applied to each input of a 2-input NAND gate. One pulse goes
HIGH at t=0 and goes LOW at t=1ms, the other pulse goes HIGH at
t=0.8ms and goes back LOW at t=3ms. the output pulse can be described as
follows:
(a) It goes LOW at t=0 and back HIGH at t=3ms.
(b) It goes LOW at t=0.8ms and back HIGH at t=3ms.
(c) It goes LOW at t=0.8ms and back HIGH at t=1ms.
(d) It goes HIGH at t=0.8ms and back LOW at t=1ms.
4. when the input to an inverter is HIGH, the output is :
(a) HIGH (b) LOW
592
Discarded + C5B
carry 1 1ED
84
+ D6
Drop carry 1 5A the difference is 5A(16)
C3
+ F5
Drop carry 1 B8 11 the difference is B8(16)
University of Anbar Subject / Digital TechniquesI
College of Engineering First Stage / 2nd Semester
Dept. of Electrical Engineering (2019 – 2020);lecture 3
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
Multiplication of Hexadecimal Numbers:
The multiplication of hex numbers is well illustrated in the following
example:
12