0% found this document useful (0 votes)
50 views75 pages

Bec Unit 2

The document describes various logic gates and sequential circuits. It defines logic gates as electronic circuits that produce basic logic functions like AND, OR, etc. It also defines sequential circuits as circuits whose outputs depend not just on present inputs but also past history of inputs, allowing them to store memory. The document then goes on to explain common logic gates like buffers, inverters, AND, OR, NAND, NOR gates and their truth tables. It also discusses half adders, full adders, multiplexers, decoders and various types of bistable circuits like R-S, D, and J-K flip-flops.

Uploaded by

kbkb
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)
50 views75 pages

Bec Unit 2

The document describes various logic gates and sequential circuits. It defines logic gates as electronic circuits that produce basic logic functions like AND, OR, etc. It also defines sequential circuits as circuits whose outputs depend not just on present inputs but also past history of inputs, allowing them to store memory. The document then goes on to explain common logic gates like buffers, inverters, AND, OR, NAND, NOR gates and their truth tables. It also discusses half adders, full adders, multiplexers, decoders and various types of bistable circuits like R-S, D, and J-K flip-flops.

Uploaded by

kbkb
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/ 75

Dept of ECE,BMSCE

Course: Basic Electronics and Communication

Unit II
UNIT 2

Logic Gates
▪ Logic Systems consists of Gates and Flip-flops
▪ Logic gates are electronic circuits designed to produce the basic logic
functions such as AND, OR, etc.

▪ Flip-flops are memory devices capable of storing logic constants.

▪ The Interconnection of Gates and Flip-flops results in Logic


Networks.
Buffers:
▪ Buffers do not affect the logical state of a digital signal.
▪ A logic 1 input results in a logic 1 output whereas a logic 0 input
results in a logic 0 output.
▪ Buffers are used to provide extra current drive at the output.
▪ The Boolean expression for the output : Y = X.
Inverters
• Inverters are used to complement the logical state.
• A logic 1 input results in a logic 0 output and vice versa.
• The Boolean expression for the output, Y, of an Inverter with an input,
X, is:
AND Gate:
● AND gates will only produce a logic 1 output when all inputs are
simultaneously at logic 1.
● Other input combination results in a logic 0 output.
● The Boolean expression for the output, Y = A ∙ B
OR Gate
▪ OR gates will produce a logic 1 output whenever any one, or
more, inputs are at logic 1.
▪ OR gate will only produce a logic 0 output whenever all of its inputs
are at logic 0.
▪ The Boolean expression for the output, Y = A + B
NAND Gate:
• NAND (i.e. NOT-AND) gates will only produce a logic 0 output when
all inputs are simultaneously at logic 1.
• Other input combination will produce a logic 1 output.
• A NAND gate, is an AND gate with its output inverted. The circle
shown at the output denotes this inversion.
• The Boolean expression for the output:
NOR Gate
• NOR (i.e. NOT-OR) gates will only produce a logic 1 output when all
inputs are simultaneously at logic 0.
• Other input combination will produce a logic 0 output.
• A NOR gate, is an OR gate with its output inverted. A circle is used
to indicate inversion.
• The Boolean expression for the output.
EX-OR Gate
• A two input Exclusive-OR gates will produce a logic 1 output,
whenever either one of the inputs is at logic 1 and the other is at logic
0.
• Exclusive-OR gates produce a logic 0 output whenever both inputs
have the same logical state (i.e. when both are at logic 0 or both are at
logic 1).
• The Boolean expression for the output, Y, of an exclusive-OR gate
with inputs A and B is:
EX-NOR Gate
• A two input Exclusive-NOR gates will produce a logic 1 output,
whenever both of its inputs are same otherwise it produces logic 0
output.
• The Boolean expression for the output, Q, of an exclusive-NOR gate
with inputs A and B is:
Adder
• An adder is a device that will add together two bits and give the result
as the output.
• There are two kinds of adders - half adders and full adders.
• A half adder just adds two bits together and gives a two-bit output.
• A full adder adds two inputs and a carried input from another adder,
and also gives a two-bit output.
Half adder
The circuit adds two binary variables, yields a carry but does not accept
carry from another circuit(adder).
The truth table of the half adder with its circuit is shown below.
Full adder
• Full Adder is the adder which adds three inputs and produces two
outputs.
• The first two inputs are A and B and the third input is an input carry,
C i.
• The output carry is given as Co and the normal output as S which is
SUM. Truth Table of Full adder
Full adder …
• It is observed from the truth table that C0=1 for rows which have two 1’s otherwise it is 0.
• Its Boolean Function is C0=AB+BCi+CiA
• It can be implemented by three AND and one OR gates. S=1 for rows with one 1 and three 1’s., i.e
odd number of 1’s. its implemented by a three input XOR.
Multiplexer
Multiplexer is to select one signal from a group of 2n inputs, and map
on to a single output line.
• Example: 2:1, 4:1, 8:1
• Block diagram of an 8:1 Multiplexer is shown below.
• Lines D0,D1,….. D7 are the data input lines and F is the output line,
Lines A, B and C are called select lines.
Multiplexer Implementation
Multiplexer logic diagram
Multiplexer Application
• To choose one of the several Inputs
n
• 2 :1 multiplexer can be used to Implement Boolean function with n
variables by associating each input line with a row of truth table.
Decoder
• It decodes an n-bit binary number, producing a signal on one of 2n
output lines.
•If input A=1, B=0, C=1 , the output D5 is 1 and all other
outputs are 0.
Truth table of 3-to-8 decoder
Decoder logic diagram
Decoder application
• A decoder with an Enable line can be used as a De-Multiplexer,
which directs a single data line to one of the 2n output lines
• Decodes memory address for read or write operation of RAM
COMBINATIONAL LOGIC CIRCUITS
•A combinational logic circuit is defined as a circuit in which
the outputs at any instant are dependent only upon the inputs
present at that instant.
•Examples – Adders, subtractors, decoders, multiplexers.
SEQUENTIAL LOGIC CIRCUITS
• A sequential circuits is defined as a circuit in which the outputs at any
instant are dependent not only upon the present inputs, but also upon
the past history or sequence of inputs.
• In order to preserve past history of inputs, sequential circuits are said
to have memory.

Examples include counters,


registers etc.
BISTABLES
•All memory elements consist of a basic bistable element.
•The basic bistable element has two stable conditions or states.

0 1 1 0

1 0 0 1
BISTABLES

R-S BISTABLES

OPERATION OF AN R-S BISTABLE
1 0 0 0

0
0 1 1

0 0 1
1

1 0 0 0
OPERATION OF AN R-S BISTABLE
1 0

1 0

• The above analysis yields contradictory results


• Hence, R=1, S=1 is an invalid and forbidden state
• R-S bistable cannot be used when both the input are at logic 1
TRUTH TABLE OF R-S BISTABLES
D-TYPE BISTABLES
• The D-type bistable has two inputs: D (standing for ‘data’ or ‘delay’)
and CLOCK (CLK).
• D-type bistable is a modified Set-Reset bistable with the addition of an
inverter to prevent the S and R inputs from being at the same logic
level.
WORKING OF A D-TYPE BISTABLE
• The D-type bistable consists of
• Input D that determines its next state and control.
• Input clock that determines when the D input is effective.
WORKING OF A D-BISTABLE
When clock=0 When clock=1, D=0
0 or 1 Q 0
0
0 1

1 1

INPUTS OUTPUTS COMMENTS


S R
0 0 Q Q Memory
0 1 0 1 Reset
1 0 1 0 Set
1 1 ? ? Forbidden
WORKING OF A D-TYPE BISTABLE
When clock=1, D=1
1
1

0
0

INPUTS OUTPUTS COMMENTS


S R
0 0 Q Q Memory
0 1 0 1 Reset
1 0 1 0 Set
1 1 ? ? Forbidden
TRUTH TABLE OF D-TYPE BISTABLE
INPUTS OUTPUTS COMMENTS
CLOCK D
0 X Q Q Memory
1 0 0 1 Reset
1 1 1 0 Set
TIMING DIAGRAM FOR A D-TYPE BISTABLE
J-K BISTABLES

INPUT AND OUTPUT STATES (PRESET AND
CLEAR INPUTS)

INPUTS OUTPUT
COMMENTS
CLEAR PRESET
0 0 ? Indeterminate
0 1 0 Q is reset
1 0 1 Q is set
1 1 Clocked operation Enables clocked
operation
INPUT AND OUTPUT STATES (CLOCKED
OPERATION)

1
INPUTS OUTPUT COMMENTS
J K
0 Q
0 0 Q No change in state of the Q
output
0 0 1 0 Q is reset
1 1 0 1 Q is set
1 1 Q output changes to the
opposite state
CLOCKED OPERATION OF A J-K BISTABLE
1
INPUTS OUTPUT COMMENTS
0 0
J K

0 0 Q No change in state of the Q


1 1 output
1 0 1 0 Q is reset
1 0 1 Q is set
1
1 1 Q output changes to the
1 1 opposite state

0 0

1
CLOCKED OPERATION OF J-K BISTABLE
INPUTS OUTPUT COMMENTS
J K
1

0 0 Q No change in state of the Q


1
output
0 1 0 Q is reset
1 0 1 Q is set
1 Q
1 1 Q output changes to the
1 opposite state
J-K Bistables can be configured in various ways
•Binary Dividers
•Binary Counters
•Shift Registers
Data Representation and
Microcontroller System
Data Representation

•Binary(Base 2)
•Large binary numbers are inconvenient to handle
•Hence convert to hexadecimal
•Hexadecimal(Base 16)
•Easy to comprehend
•Offers advantage over decimal (base 10)
•Conversion from binary to hexadecimal and vice versa is easy
•A single hexadecimal character(range is 0 to F) represents 4 binary digits
Nibble, byte, word, double word
hex-make
groups of
four bits
(nibble)-
then
Ex:
•Each
represent
$64H=0110
hexadecim
each
0100 nibble
in
al number
in
is hex.
binary
represente
=100 in
d using $
decimal
before the
$7FH
number = or
0111
add
•Ex. H
A31111
to
in
the
in
hex end
binary
= of
1010
the
=127
0011 in
in
number
decimal
binary
•11101000
Data Types
• One byte of data can be stored at each address of the memory space
in a microprocessor
• For a 16 bit address bus, total memory locations =65,536
• Within a byte, bits are numbered 0 (Least Significant Bit) to 7(Most
Significant Bit)
• For 16 bit words, 15 is the MSB bit
• Negative(signed) numbers are represented using 2’s complement
notation.
• Here MSB indicates the sign of the number(1=negative, 0= positive)
• Only bits 0 to 6 represent the magnitude of the number
•Ex: signed 8 bit number 10000001 = -1(denary)
Range of Integer Data values
Data Storage

•Semiconductor ROM
•Provides storage for the program code
•Stores any permanent data
•These are non-volatile
•They remain intact when power supply is off
•Semiconductor RAM
•Provides storage for transient data, variables used by the program
•Part of RAM temporarily stores data while doing normal tasks

•CMOS RAM
•Data stored in RAM is lost when power switched off
•In CMOS RAM, data is kept alive using a small battery
•It retains important data- time and date
Data Storage
• The data stored in the memory device is represented in kilobytes(KB)
• 1 Kilobyte = 1024 bytes . It is nearest power of 2.(210 =1024)
• Semiconductor ROM capacity = address range * number of bits stored
at each address
• Ex: 2k x 8 bits(2KiloBytes) , 4k x 8 bits (4 Kilobytes)
Microcontroller system
Microcontroller system
Typical Microcontroller system
• The sensed quantities(temperature, position) are converted to
electrical signals using sensors
• Sensor outputs are either digital or analogue in nature
• These signals passed to microcontroller. Microcontroller also accepts
user options
• Software instructions control the operation of the microprocessor
and output signals sent to controlled devices
• Controlled device converts electrical energy from one form into
another form
• In real world, systems are self regulating called closed loop system
Ex. Heating control system
Typical Microcontroller system
• Micro controllers have a CPU which performs arithmetic, logical and
timing operations
• Some input sources are switches, sensors, keypads
• Some output devices are LED indicators, LED 7 segment displays,
motors and actuators, relays, transistor drivers and other solid-state
switching devices
Input devices
• Input device is keyboard, mouse scanner and modem
• Switches or contacts which make and break
• Sensors which provide logic level outputs
• To connect an input device to a microcontroller, the device must
provide a logic compatible signal.
• In microcontroller inputs can only accept digital input signals
0v= logic 0 and 5v = logic 1 signal
• Some devices sense analogue quantities
• Some microcontrollers provide ADC and provide digital data.
• Resolution of the ADC depends on the number of bits used (8, 10 or
12 bits)
Output devices
• They are used to communicate information to the outside world
• Common output devices are flat screen display, printers and modems
• Microcontroller uses output devices such as LEDs, piezoelectric
sounders, relays and motors
• DAC are required at the output of the microcontroller
• The resolution of the DAC also depends on the number of bits
Interface Circuit
• When the output and input signals are not logically compatible
interface circuits are needed
• Also, when a load requires more current than is available from
standard logic device or output port
• They provide the additional current drive

Ex: Interface circuits allow a microcontroller to interface to an AC


mains
connected load. To control a central heating system
Ex: An analog input signal connected to a
microcontroller via ADC
Ex: An analog output signal produced by
connecting DAC to microcontroller
Shift Register
• Registers are the devices used to store multiple bits of information
• Flip-flops are used to store 1-bit of information, for n-bit of
information to be stored in the registers, registers use n-number of
flip-flops.
• Using the shift registers along with storing the information, stored
information can be read parallel or series.
• Shift registers are used to write/read the information either in
series(1-bit at a time) or in parallel (all bits of data at a time).
Block diagram of shift register (SISO):

• JK flip-flop with active low Preset and Clear is used to construct the
4-bit shift register.
• Negative edge of the clock is used to trigger the operation of the
flip-flops
• 4-bit data of 1010 is sent to the shift register serially (1-bit per clock )
through serial in. Data 1010 is fed in with LSB first
• Each bit is shifted to the through the 4 flip-flops and output through
serial out after the occurrence of 4 negative edges of the clock.
Operation of Shift Register:
Register types

• Serial In Serial Out(SISO)


• Serial In Parallel Out (SIPO)
• Parallel In Serial Out(PISO)
• Parallel In Parallel Out(PIPO)
Register types
• Parallel out – output connections taken from Q3 to Q0
• Parallel in – After clearing the FFs, “Parallel in” is set ‘1’. Data fed
simultaneously on D3-D0
Shifting of Data to Left
• Previously, the data was shifted from left by one bit at clock pulse by
feeding output at FF0 to input FF1, and FF1 to FF2, FF2 to FF3.
• In the below fig, On the occurrence of a pulse, the data word will shift
one bit to left.
Bidirectional Shift Registers
Counters
• A counter is a circuit that counts the number of occurrence of an input.
• Each count, a binary number, is called a state of the counter.
• A counter counting in terms of n-bits has 2n different states.
• The number of different states of a counter is known as the modulus of
the counter. Thus an n-bit counter is a modulo-2n counter.
• Counter circuits are primarily constituted of flip-flops, along with
combinational elements are used for the generation of counter
signals.
Counters
Counter can be divided into two major categories:
1. Asynchronous counter (Ripple counter): all the flip-flops are not
clocked simultaneously.
2. Synchronous counter: all the flip-flops are clocked simultaneously.
Asynchronous Counters
The below figure shows a 3-bit (modulo 8) asynchronous counter.
Operation: All the flip flops are initially cleared. The clock pulses are
then applied.
•With each negative edge of the clock pulse (1 to 0), Q0 toggles.
•For each negative edge (1 to 0) of Q0, Q1 toggles.
•Similarly for 1 to 0 transition of Q1 , Q2 toggles.
Operation of Asynchronous Counter
Observation
• The 3-bit counter counts the 8-clock pulses, negative edge occurs at Q0
4 times, Q1 2 times and Q3 1 time.
• The frequency of the clock pulse reduces by a factor of 2 at each stage.
Counters

You might also like