Week 3-CS8113 - 022605
Week 3-CS8113 - 022605
CIRCUITS
• revision:
• Construct truth table for:
• ABC+AB’C’+A’B’C’
• A(BC’+B’C)
• (A+B)(A+C)(A’+B’)
• Simplify
• F.(K+R)+S.V+W.X’+V.S+X’.W+(R+K).F
• F.(E+F+G)
• (P.Q+R+S.T)T.S
• Prove that: (X+Y)(X’+Y) = Y
Definition
• Combinational logic circuits are electronic circuits that produce an
output based solely on the current inputs, without any consideration
of previous inputs or outputs.
• They are built using combinational logic gates, such as AND, OR, NOT,
NAND, NOR, and XOR gates.
• The basic building block of a combinational logic circuit is a logic gate.
• Combinational logic circuits can be designed by connecting logic gates
together in various ways to perform a specific logical operation.
• For example, a simple combinational logic circuit might take two
binary inputs and produce a binary output that is 1 only if both inputs
are 1.
• This can be achieved by connecting an AND gate to the two inputs
and using its output as the output of the circuit.
A B C F
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
What is F?
• To help eliminate potential confusion, logic designers specify a
Boolean function using a canonical, or standardized, form.
• For any given Boolean function, there exists a unique standardized
form.
• However, there are different “standards” that designers use.
• The two most common are the sum-of-products (SOP) form and the
product-of-sums (POS) form.
• F = A’BC’ + A’BC + ABC’
• There are three combinations of input values that cause F to be 1, and
if any one of these combinations occurs, the result is 1.
• This form of expression is known as the sum-of-products (SOP) form
• F = (A+B+C).(A+B+C’).(A’+B+C).(A’+B+C’).(A’+B’+C’)
• This form of expression is known as the product-of-sums (POS) form
• Thus, a Boolean function can be realized in either SOP or POS form.
• How to decide? POS/SOP?
• The choice would depend on whether the truth table contains more
1s or 0s for the output function.
• There are different methods that can be used to achieve simplification
including:
• Algebraic simplification
• Karnaugh maps
• Quine–McCluskey tables
• There are different methods that can be used to achieve simplification
including:
• Algebraic simplification
• Karnaugh maps
• Quine–McCluskey tables
• Using logic gates, design a circuit that will flush a toilet when a user
stands up or the toilet’s door is opened and there is a load on the
basin.
Half adder
• Design a circuit that does the following
• 0 + 0 = 0,
• 0 + 1 = 1 + 0 = 1,
• and 1 + 1 = 0 carry 1.
Block diagram
• Sum = x’y + xy’ XOR
• Carry = xy AND
• What about the full adder?
• We add the idea of a Carry in bit into our half adder.
• Why carry in? remember 1110 + 1011?
• Ok
Full
Adder
• Sum = (X’Y’C) + (X’YC’) + (XY’C’) + (XYC)
• Carry = (X’YC) + (XY’C) + (XYC’) + (XYC)
• Simplify to get a simpler circuit
• Adders are very important circuits, a computer would not be very
useful if it could not add numbers.
• The full adder in our example can only add a 3 bit number
• Its possible to build adders capable of adding two 16-bit words or
more.
• An example is a ripple carry adder
Decoders
• A decoder is a digital circuit that converts a binary code into a set of
outputs.
• The binary code typically represents a unique combination of inputs
that correspond to a specific output.
• Decoders are commonly used in digital systems to control a set of
output devices based on a digital input code.
• Decoders can be designed to have various numbers of inputs and
outputs.
• The simplest type of decoder is a 1-to-2 decoder, which has one input
and two outputs.
• The input can be either 0 or 1, and the decoder outputs the
complement of the input value on one output and the input value
itself on the other output.
1,0
0,1
0,1
• Another common type of decoder is the n-to-2n decoder, which has n
input lines and 2n output lines.
• This type of decoder is used to decode a binary code with n bits into a set
of 2n possible outputs.
• Each output corresponds to a unique binary code, so that when the input
code is presented to the decoder, the corresponding output is activated.
• Decoders are commonly used in digital circuits for address decoding,
where they are used to decode memory or input/output addresses.
• They are also used in control circuits, where they are used to decode
control signals for selecting different modes of operation.
Address decoding: Intuition
• If you have four addresses—addresses 0, 1, 2, and 3,
• The binary equivalent of these addresses is 00, 01, 10, and 11,
requiring two bits.
• We know 22 = 4.
• If you have four addresses, how many bits are required? 8 = 23,
therefore 3 bits
• Imagine memory consisting of 8 chips, each containing 8K bytes.
• We have a total of 8K × 8, or 64K (65,536) addresses available.
• Given 64 = 26 and 1K = 210, then 64K = 26 × 210 = 216
• We therefore need 16 bits to represent each address.
• How many bits will you need for 128K?
mux
• A multiplexer (also known as a "mux") is a digital circuit that selects one
of several input signals and forwards it to a single output.
• The selection of the input signal is controlled by a set of binary inputs,
which are interpreted as a binary number representing the desired input.
• A multiplexer has a certain number of input lines, usually in powers of 2
(such as 2, 4, 8, 16, etc.), and a single output line.
• The number of input lines determines the number of signals that can be
selected by the multiplexer.
• For example, a 2-to-1 multiplexer has two input lines and one output
line, while a 4-to-1 multiplexer has four input lines and one output line.
• Multiplexers are commonly used in digital circuits to switch between
different sources of data or to select between different inputs to a
circuit.
• They are also used in data communication systems to combine
multiple signals into a single transmission line, which can be more
efficient than transmitting each signal separately.
S2 S1 F
0 0 D0
0 1 D1
1 0 D2
1 1 D3
ROM
• Combinational circuits are often referred to as “memoryless” circuits,
because their output depends only on their current input and no history of
prior inputs is retained.
• However, there is one sort of memory that is implemented with
combinational circuits, namely read-only memory (ROM).
• A ROM is a memory unit that performs read-only operations.
• Its binary information is permanent and created during fabrication, meaning
the same input always produces the same output.
• As its outputs are solely based on the present inputs, a ROM is a
combinational circuit.
• A ROM can be implemented with a decoder and a set of OR gates.
SEQUENTIAL CIRCUITS
• Sequential circuits are digital circuits that use feedback to store and
remember previous input signals, allowing them to have memory and
process data over time.
• In contrast to combinational circuits, which have outputs that are
solely dependent on the present inputs, sequential circuits have
outputs that are dependent on both present and past inputs.
• Sequential circuits can be classified into two main types: synchronous
and asynchronous.
• Synchronous sequential circuits use a clock signal to synchronize their
operations.
• The clock signal determines the rate at which the circuit operates, and
all the internal memory elements of the circuit are updated
simultaneously on the rising or falling edge of the clock signal.
• This ensures that the circuit operates reliably and consistently.
• Asynchronous sequential circuits do not use a clock signal for
synchronization.
• Instead, they rely on the propagation delays of logic gates to control
the timing of their operations.
• As a result, they can be more complex and difficult to design and
analyze than synchronous circuits.
• Sequential circuits are widely used in digital systems, such as:
• Memory chips
• Processors
• Communication.
• They are also used in many other applications, such as control
systems, digital signal processing, and image processing.
• The simplest form of sequential circuit is the flip-flop
• There are a variety of flip-flops, all of which share two properties
1. The flip-flop is a bistable device.
• It exists in one of two states and, in the absence of input, remains in that
state.
• Thus, the flip-flop can function as a 1-bit memory.
2. The flip-flop has two outputs, which are always the complements of
each other.
• These are generally labeled Q and Q’.
• A Set-Reset latch (SR latch/SR flip-flop)
• Is a basic digital logic circuit that can be used to store one bit of information.
• It is constructed from two cross-coupled NOR (or NAND) gates, and it has two
inputs: the Set (S) input and the Reset (R) input.
• SR latches are widely used in digital circuits as basic building blocks for more
complex circuits, such as counters and registers.
• However, they have a disadvantage of being prone to race conditions, where
the state of the latch can oscillate rapidly between its two stable states.
• This problem can be overcome by using clocked flip-flops instead of latches.
Set Q to 1 and 0 This leads to a race-condition
simultaneously!!! btn the two gates. therefore, the next state cant be
Racing each other to feed determined.
the new output.
• A clocked SR flip-flop, also known as a gated SR flip-flop is a type of
flip-flop circuit that can store a single bit of information. It is an
extension of the SR latch that includes a clock input.
• The clock input allows the SR flip-flop to operate in synchronization
with other digital circuits, ensuring that input changes are processed
at specific times determined by the clock signal.
A clock is a periodic signal used to synchronize digital circuits.
It is generated by a separate circuit and controls the timing of state changes
and data transfers between different parts of the circuit.
The clock signal is an essential component of many digital circuits and affects
their performance and reliability.
• The clocked SR flip-flop has two inputs, S and R, which are the same
as those in the SR latch.
• In addition, it has a clock input (CLK), which is used to control when
the inputs are read and when the outputs are updated.
• When the CLK input changes state, the current inputs (S and R) are
read and the output is updated accordingly.
• One problem with S–R flip-flop is that the condition R = 1,S = 1 must
be avoided.
• One way to do this is to allow just a single input.
• The D flip-flop accomplishes this
• The D flip-flop is sometimes referred to as the data flip-flop because it
is, in effect, storage for one bit of data.
• The output of the D flip-flop is always equal to the most recent value
applied to the input. Hence, it remembers and produces the last
input.
• It is also referred to as the delay flip-flop, because it delays a 0 or 1
applied to its input for a single clock pulse.
• Another useful flip-flop is the J–K flip-flop.
• A JK flip-flop is a type of sequential logic circuit that can store one bit
of binary information.
• It has two inputs, J (set) and K (reset), and two outputs, Q and Q̅ (the
complement of Q).
• The operation of a JK flip-flop is based on the state of its inputs and
the clock signal.
• The JK flip-flop is a versatile circuit and can be used in a variety of
applications, such as counters, shift registers, and frequency dividers.
• It is also commonly used to correct errors in digital systems, such as in
memory circuits or communication channels.
Graphic symbols
Registers
• A register is a digital circuit used within the CPU to store one or more
bits of data.
• Two basic types of registers are commonly used: parallel registers and
shift registers.
• A parallel register consists of a set of 1-bit memories that can be read
or written simultaneously. It is used to store data.
• A shift register accepts and/or transfers information serially.
• Shift registers can be used to interface to serial I/O devices. they can
also be used within the ALU to perform logical shift and rotate
functions.
8-Bit Parallel Register
Load is a control signal, it controls writing into the register from signal
lines D11-D18, if they are output of mux then the data may come from a
variety of sources.
5-Bit Shift Register
• A counter is a digital circuit that can count the number of clock cycles
or events that occur in a system.
• It is a type of sequential logic circuit that can store a binary number
and increment or decrement its value in response to a clock signal.
• Can increment or decrement its value by one. When the maximum
value is reached, the counter resets to zero and begins counting
again.
• The maximum value that a counter can hold is determined by its
width, which is the number of bits in the register.
• Counters are commonly used in digital systems for a variety of
applications, such as counting events, generating timing signals, and
controlling the sequence of operations in a system.
• There are two main types of counters: asynchronous counters and
synchronous counters.
• Asynchronous counters are also known as ripple counters because the
output of one flip-flop triggers a change in the status of the next flip-
flop in a ripple-like manner.
• These counters are relatively slow due to the delay between the
propagation of the signal through each stage of the counter.
• Synchronous counters, on the other hand, change state at the same
time, using a common clock signal to trigger the flip-flops to change
state simultaneously.
• This makes synchronous counters much faster than asynchronous
counters, which is why they are commonly used in CPUs and other
high-speed digital systems.
• Synchronous counters can be designed to operate in a variety of
modes, such as up, down, or up/down counting, making them more
versatile than asynchronous counters.
Using NAND gates
• Active high SR latch:
• Its output stays HIGH until R goes HIGH
• The latch remembers that the SET input has been activated. If the SET
input goes HIGH for even a moment, the output goes HIGH and stays
HIGH, even after the SET input returns to LOW. The output returns to
LOW only when the RESET input goes HIGH.
• SR latch with NOR gates is an active high
• Active low SR latch:
• When the SET input momentarily goes LOW, the output goes HIGH.
• The output then stays HIGH until the RESET input briefly goes LOW.
• SR latch with NOR gates is an active high.
• NOR gates are commonly used in active-high SR latch circuits because
they have a simpler and more direct logic implementation compared
to NAND gates.
• Additionally, NOR gates are often preferred over NAND gates in latch
circuits because they are less susceptible to issues such as race
conditions and glitches, which can cause unstable behavior in digital
circuits.