Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

MKT2802 Logic Circuits

Dr. Kadir ERKAN


Mechatronics Engineering Department

Spring : 2021

3/21/2021 Logic Circuits 1


1’s-Complement Form
The 1’s complement of a binary number is obtained by changing each 0 to a
1 and each 1 to a 0. In other words, change each bit in the number to its
complement. The process is shown below.

3/21/2021 Logic Circuits 2


2’s-Complement Form
The 2’s complement of a binary number is formed by taking the 1’s
complement of the number and adding 1 to the least-significant-bit position.
The process is illustrated below for (101101)2 = (45)10.

Here’s another example of converting a binary number to its 2’s- complement


representation:

3/21/2021 Logic Circuits 3


Subtraction by 2’s-Complement Form
Take 2’s complement of
subtrahend number

Sum up minuend and


complemented number

Observe the result


Clear MSD, rest of the result YES Number of digit of resulted
number is the expected
grater than highest digit
result
number?

NO

Find 2’s complement of


result number and put – sign
in front of result ! This is the
expected result

3/21/2021 Logic Circuits 4


Subtraction by 2’s-Complement Form

3/21/2021 Logic Circuits 5


Subtraction by 2’s-Complement Form

3/21/2021 Logic Circuits 6


Subtraction by 1’s-Complement Form

Take 1’s complement of the


subtrahend number

Sum up them inuend and the


complemented number

Observe the result


Clear MSD, add 1 to rest of YES Number of digit of the result
the result, this is the
grater than the highest digit
expected result
number?

NO

Find 1’s complement of the


result and put – sign in front
of the result! This is the
expected result

3/21/2021 Logic Circuits 7


Subtraction by 1’s-Complement Form

3/21/2021 Logic Circuits 8


Subtraction by 1’s-Complement Form

3/21/2021 Logic Circuits 9


Binary Logic and Gates
 Logic gates are the basic building blocks for forming digital electronic
circuitry.
 A logic gate has one output terminal and one or more input terminals.
 Its output would be HIGH (1) or Low (0) depending on the digital level (s)
at the input terminal (s).
 The logic gates can be used to design digital systems that will evaluate
digital input levels and produce a specific output response based on that
particular logic circuit design.

We will study the following logic gates in this

 The INVERTER, AND and OR gates are considered to be the basic


logic gates in the field of digital electronics.

 The NAND, NOR, Exclusive-OR and Exclusive- NOR gates are


constructed using the basic logic gates.
3/21/2021 Logic Circuits 10
Binary Logic and Gates
A truth table is a means for describing how a logic circuit’s output depends
on the logic levels present at the circuit’s inputs.

3/21/2021 Logic Circuits 11


NOT Gate
A NOT gate is a one-input, one-output logic circuit whose output is always
the complement of the input. That is, a LOW input produces a HIGH output,
and vice versa.

3/21/2021 Logic Circuits 12


NOT Gate
An OR gate performs an ORing operation on two or more than two logic
variables.
The OR operation on two independent logic variables A and B is written as
Y = A+B and reads as Y equals A OR B and not as A plus B.
An OR gate is a logic circuit with two or more inputs and one output. The
output of an OR gate is LOW only when all of its inputs are LOW. For all
other possible input combinations, the output is HIGH.

3/21/2021 Logic Circuits 13


OR Gate

3/21/2021 Logic Circuits 14


NOR Gate
An OR gate followed by a NOT circuit makes it a NOR gate!
The truth table of a NOR gate is obtained from the truth table of an OR gate by
complementing the output entries. The output of a NOR gate is a logic ‘1’ when all its
inputs are logic ‘0’. For all other input combinations, the output is a logic ‘0’.

3/21/2021 Logic Circuits 15


NOR Gate

3/21/2021 Logic Circuits 16


AND Gate
An AND gate is a logic circuit having two or more inputs and one output. The
output of an AND gate is HIGH only when all of its inputs are in the HIGH
state. In all other cases, the output is LOW.

3/21/2021 Logic Circuits 17


AND Gate

3/21/2021 Logic Circuits 18


NAND Gate
An AND gate followed by a NOT circuit makes it a NAND gate!
The truth table of a NAND gate is obtained from the truth table of an AND
gate by complementing the output entries. The output of a NAND gate is a
logic ‘0’ when all its inputs are a logic ‘1’. For all other input combinations, the
output is a logic ‘1’.

3/21/2021 Logic Circuits 19


NAND Gate

3/21/2021 Logic Circuits 20


EXCLUSIVE-OR (EXOR) Gate
The EXCLUSIVE-OR gate, commonly written as EX-OR gate, is a two-input, one-
output gate.
The output of an EX-OR gate is a logic ‘1’ when the inputs are unlike and a logic ‘0’
when the inputs are like. Although EX-OR gates are available in integrated circuit
form only as two-input gates, unlike other gates which are available in multiple inputs
also, multiple-input EX-OR logic functions can be implemented using more than one
two-input gates.

3/21/2021 Logic Circuits 21


EXCLUSIVE-OR (EXOR) Gate

3/21/2021 Logic Circuits 22


EXCLUSIVE-NOT-OR (EXNOR) Gate
EXCLUSIVE-NOR (commonly written as EX-NOR) means NOT of EX-OR, i.e. the
logic gate that we get by complementing the output of an EX-OR gate.

3/21/2021 Logic Circuits 23


EXCLUSIVE-NOT-OR (EXNOR) Gate

3/21/2021 Logic Circuits 24


Digital Buffer
In digital electronic circuits we need to isolate logic gates from each other or have
them drive or switch higher than normal loads, such as relays, solenoids and lamps
without the need for inversion. One type of single input logic gate that allows us to do
just that is called the Digital Buffer.

3/21/2021 Logic Circuits 25


Three-State Buffer
A Tri-state Buffer can be thought of as an input controlled switch with an output that
can be electronically turned “ON” or “OFF” by means of an external “Control” or
“Enable” ( EN ) signal input. This control signal can be either a logic “0” or a logic “1”
type signal resulting in the Tri-state Buffer being in one state allowing its output to
operate normally producing the required output or in another state were its output is
blocked or disconnected.

Digital Buffers and Tri-state Buffers can provide current amplification in a


digital circuit to drive output loads

3/21/2021 Logic Circuits 26


Three-State Buffer
Tri-state Buffers are available in integrated form as quad, hex or octal buffer/drivers in
both uni-directional and bi-directional forms, with the more common being the TTL
74240, the TTL 74244 and the TTL 74245

3/21/2021 Logic Circuits 27


Pull-up and Pull-down Resistors
One final point to remember, when connecting together digital logic gates to produce
logic circuits, any “unused” inputs to the gates must be connected directly to
either a logic level “1” or a logic level “0” by means of a suitable “Pull-up” or
“Pull-down” resistor ( for example 1kΩ resistor ) to produce a fixed logic signal.
This will prevent the unused input to the gate from “floating” about and producing
false switching of the gate and circuit.

3/21/2021 Logic Circuits 28


Pull-up and Pull-down Resistors
As well as using pull-up or pull-down resistors to prevent unused logic gates from
floating about, spare inputs to gates and latches can also be connected together or
connected to left-over or spare gates within a single IC package as shown.

3/21/2021 Logic Circuits 29


Three-State Buffer

3/21/2021 Logic Circuits 30


IEEE / ANSI symbols.

This standard uses a


rectangular symbol for all
devices instead of a different
symbol shape for each
device.

3/21/2021 Logic Circuits 31


Application-Relevant Information

3/21/2021 Logic Circuits 32


Application-Relevant Information

3/21/2021 Logic Circuits 33


Application-Relevant Information

3/21/2021 Logic Circuits 34


Key terms

3/21/2021 Logic Circuits 35

You might also like