Eee311 L04

You might also like

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

EEE311

Digital Electronics
Lecture 4 – 18/08/2022

Dr. MD. AMIRUL ISLAM


Associate Professor
EEE, BSMRSTU, Gopalganj
Binary Arithmetic
2's complement

 M. Morris Mano, Michael D. Ciletti - Digital Design, Global Edition (2018). 3


Subtraction
"Subtraction is basically addition using 2's complement"
 Determine 2's complement of the negative number(s)
 Discard end carry (if any)

There is no end carry. Therefore, the


answer is Y – X = 1101111.
 M. Morris Mano, Michael D. Ciletti - Digital Design, Global Edition (2018). 4
Addition and subtraction of signed binary numbers
 Example: Perform addition and subtraction operation on 6 and 13. Also
negate the numbers and perform the operations.

 M. Morris Mano, Michael D. Ciletti - Digital Design, Global Edition (2018). 5


Subtraction

 M. Morris Mano, Michael D. Ciletti - Digital Design, Global Edition (2018). 6


Binary Logic
Boolean Algebra
Binary Logic
Binary logic deals with variables that take on two discrete values and
perform operations that assume logical meaning. The variables can be
called by different names (e.g. true and false; yes and no; high and low; 1
and 0). There are three basic logical operations: AND, OR, and NOT. All
these logical operations are called Boolean Algebra. The logical
operations may be listed in a compact form called truth tables. The
electronic circuits that perform the actual logical operations are called logic
gates.
 M. Morris Mano, Michael D. Ciletti - Digital Design, Global Edition (2018). 8
NOT
NOT operation is referred as inversion or complementation.

(a) Truth table; (b) symbol for the INVERTER (NOT circuit); (c) sample waveforms.
 https://pijaeducation.com/basic-electronics/electronic-components-and-circuits/section-c/logic-gates-using-transistor/
 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007)
9
NOT
There are two options for the current to flow: (i) through the transistor when it is short-circuited or
(ii) through the LED when the transistor is open circuit.
When, switch is open (logic 0), both CB and BE
Output
junctions are reverse biased and no current (OFF or ON)
flows through the collector to emitter. Hence,
Input
the current flows through LED (logic 1). (OFF or ON)

C
When, switch is close (logic 1), both BE and CB
B
junctions are forward biased and all the current
E
flows through the collector to emitter. Hence, no
current flows through LED (logic 0).

 https://pijaeducation.com/basic-electronics/electronic-components-and-circuits/section-c/logic-gates-using-transistor/ 10
NOT
Q. What will happen if you pass the input through two series NOT gates?

Answer: The output will be same as input logic levels.

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 11


OR
"Output is 1 if one of the input is 0"

Not plus sign, it’s called OR sign

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 12


OR
OR gate using transistor works similar to OR
gate using switch. We need 2 inputs and 1
output device that are buttons and LED
respectively.
If any of the buttons are ON (logic 1) then that
transistor is short circuited, and current flows
through LED. Only if both of them are OFF
(logic 0), both BJT is open circuited, and
LED is OFF.
 https://pijaeducation.com/basic-electronics/electronic-components-and-circuits/section-c/logic-gates-using-transistor/ 13
OR

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 14


OR

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 15


OR

Explanation: The three OR gate inputs A, B, and C are varying, as shown by their waveform diagrams. The OR gate output is determined by realizing that it will be HIGH whenever any of
the three inputs is at a HIGH level. Using this reasoning, the OR output waveform is as shown in the figure. Particular attention should be paid to what occurs at time t1.The diagram shows
that, at that instant of time, input A is going from HIGH to LOW while input B is going from LOW to HIGH. Since these inputs are making their transitions at approximately the same time,
and since these transitions take a certain amount of time, there is a short interval when these OR gate inputs are both in the undefined range between 0 and 1.When this occurs, the OR
gate output also becomes a value in this range, as evidenced by the glitch or spike on the output waveform at t1.The occurrence of this glitch and its size (amplitude and width) depend on
the speed with which the input transitions occur.
 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 16
OR

1. When all the inputs are LOW (logic 0)


2. Do yourself
3. For OR gate, only one HIGH input gives a HIGH in the output. So, the output will
be always HIGH.

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 17


AND
"Output is 0 if one of the input is 0"

Not multiplication sign, it’s


called AND sign

 https://technologystudent.com/elec1/dig2.htm 18
AND
AND gate using transistor works similar as
AND gate using switch. We need 2 inputs
and 1 output device that are buttons and
LED respectively.
If both the buttons are ON (logic 1) then
both the transistors are short circuited, only
then current flows through LED. If one of
them is OFF (logic 0), that BJT is open
circuited, and LED is OFF.
 https://pijaeducation.com/basic-electronics/electronic-components-and-circuits/section-c/logic-gates-using-transistor/ 19
AND

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 20


AND

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 21


AND

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 22


AND

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 23


AND

Answer 1: All 5 inputs = 1


Answer 2: A LOW input will keep the output LOW
Answer 3: False

 Ronald J. Tocci,Neal S.Widmer - Digital Systems Principles and Applications (2007) 24


Thank You

You might also like