Combinational Circuits Exercises
Combinational Circuits Exercises
Combinational Circuit
Encoder/Decoder
Multiplexer/Demultiplexer
Half-Adder/Full adder
Agenda
Combinational Circuit
Encoder/Decoder
Multiplexer/Demultiplexer
Half-Adder/Full adder
Combinational Circuit
Combinational Circuit
Encoder/Decoder
Multiplexer/Demultiplexer
Half-Adder/Full adder
Exercise
You have 4 different sensors labeled from 1 to 4. At each
moment, only one of the sensor is triggered. Build the truth
table, Boolean expression and draw the logical diagram of it.
Encoder 4:2
From a set of inputs (of which only one is active) generate a
code to identify which one is active
‘n’ input data and ‘m’ output data
n= 2𝑚
Exercise
n= 2𝑚
Priority Encoder
if more than one input is ‘1’ at the same time, the output
will be the (binary) code corresponding to the input, which
is having higher priority
Lowest Priority
Highest Priority
Decoder
Objective: Perform the inverse of a encoder
From a set of inputs (of which only one is active)
generate a code to identify which one is active
Exercise
Given a 2bit binary number, you want to light up one LED of
4 LEDs total. Build the truth table, Boolean expression and
draw the logical diagram of it.
O0 = A1 . A0
O1 = A1 . A0
O2 = A1. A0
O3 = A1. A0
Agenda
Combinational Circuit
Encoder/Decoder
Multiplexer/Demultiplexer
Half-Adder/Full adder
Multiplexer
We may “interrogate” a set of sensors, sending the code of
the one we want to see
A MUX is an OR of ANDs, and each AND corresponds to a
MINTERM of the selection inputs, with one (and only one) of
the data inputs
Multiplexer - NOT Gate
Multiplexer - AND GATE
Using a 2x1 MUX, built a and Gate
Multiplexer - OR GATE
Using a 2x1 MUX, built a OR Gate
Exercise
You only have in your lab 2:1 multiplexer. You need to try a
circuit that need a 4:1 multiplexer. You won't let this affect
your testing and you will come up with a solution using only
2:1 multiplexers.
Exercise
You only have in your lab 4:2 multiplexer. You need to try a
circuit that need a 16:4 multiplexer. You won't let this
affect your testing and you will come up with a solution
using only 4:1 multiplexers.
Exercise
Implement the following function:
F(A,B)=S(0,3)
A B F
0 0 1
0 1 0
1 0 0
1 1 1
Exercise
Implement the following function:
F(A,B,C)=S(1,2,6)
A B C F
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
Demultiplexer
It is the inverse operation of multiplexing
Sent an input to one (and only one) of the outputs.
The ouputs that are not connected to input are “inactive”
(normally “0”)
EXERCISE
Project a system to transmit data from 4 sensors over
just 3 wires.
Agenda
Combinational Circuit
Encoder/Decoder
Multiplexer/Demultiplexer
Half-Adder/Full adder
Exercise
Build a truth table for adding A and B. (A and B are 1bit
binary number and the SUM is also 1bit)
A B SUM
0 0 0
0 1 1
1 0 1
1 1 0
A B SUM Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Exercise
Write the Boolean expressions for the following truth
table and draw the logical circuit
A B SUM Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
𝑆𝑈𝑀 ⟶ 𝐴⨁𝐵
𝐶𝑎𝑟𝑟𝑦 ⟶ 𝐴 . 𝐵
HALF-ADDER
Adds two bits (without a carry input)
Can only add numbers with 1 bit
May generate a “carry” bit
FULL-ADDER
Adds three bits (2 Bits + Carry)
Can be done directly as a logical function with 3 input
variables
Carry
Exercise
You want to built a circuit that add 1 to any 4-bit binary
number. You only have half adders in your lab. What is
the diagram of your circuit?
Exercise - FULL-ADDER
You want to built a circuit that add any two 4-bit binary
numbers. You only have full adders in your lab. What is
the diagram of your circuit?