Section 2 Digital Logic Circuits: Structure Page No
Section 2 Digital Logic Circuits: Structure Page No
2.0 INTRODUCTION
The logic circuits are the basic building blocks of an electronic circuit. We have
covered these concepts in Block 1 of MCS – 12. In this section you must attempt to
build the combinational circuits using tools created by “Alun Davies”, Designer and
Programmer of the software called Logic. We hope that you will find this software
useful and productive. We hope that it will generate interest in designing Logic
Circuits on a small scale. In addition, you must do paper – based design of some of the
sequential circuit – related problems.
Our attempt in this section is to make you familiar with the package such that you are
able to use the software as quickly as possible. We will discuss about how to build and
test a successful logic circuit project. You must experiment with the package by
yourself and attempt the problems; in doing this you will gain valuable experience and
your efficiency will increase. We hope that your experience with Logic Circuits
design will be a productive experience. We have also presented an example for
creation of logic circuit that you would like to test using Logic. We have also added
practice problems that you can attempt.
2.1 OBJECTIVES
After completing this section and doing all the practical problems given, you would be
able to:
You need to download the file logic zip and install it at your computer. On execution a
simple screen appears having a two-menu option: File and Help. Select the “New
Project” option of the File Menu to get the project window abeled “Logic Gates
Construction” having a grid on the screen. It also includes a Gate and Connection
Tool Bar. (Please refer to the Figure below.)
25
Lab Manual
In the package a lot of projects and circuits are given, so if you want to study the
functionality of any given circuit, please open it from the file menu.
On right click of the circuit you will get options: Where Test Circuit is find that circuit
having any error or not, if not you can proceed in execution of the circuit.
Like in the given figure we have chosen MULTIPLEX.CRC from the projects. On
clicking Execute circuit it displays the Truth table of circuit.
Please note that this Package cannot be used for making SEQUENTIAL Circuits,
those can be made and tested on paper.
26
Digital Logic
2.3 MAKING A LOGIC CIRCUIT USING LOGIC Circuits
Let us try to create the logic circuit given in the following figure using LOGIC:
To create a logic circuit as above you need to perform the following steps:
Step 1: Create a new project using “File/ New Project” Menu options.
Step 2: Locate find AND gate symbol in the toolbox
Step 3: Click on the AND gate button.
Step 4: Place the AND gate at desired locations by just clicking at that location.
Step 5: Similarly place OR gate on the desired location.
Note: (1) You can place as many gates as you like by just selecting and
then clicking on screen.
(2) To delete any extra Gate Object, Right Click on that Object and
select “Delete” from the menu that will get displayed.
(3) If you want to change the position of any gate then first deselect
the Gate button on the tool bar by clicking on the selected button
again. Now click on the desired object whose position you want to
change and drag the pointer wherever you want to place it.
Step 6: Now add labels input ‘a’ ‘b’ ‘c’ ‘d’ and ‘e’ by first clicking on the label
button of the tool bar. The names are given as you place the label on the
project grid through the text dialog box.
Step 7: Linking Gates: To link a label and a gate (or gate to gate) select "Link" ( )
button from the toolbar. Press and hold mouse on the source gate/label and
move the mouse to the destination connection object and release the mouse
button.
A line should appear. You can remove a connection by selecting the Break
connection ( ) button on the toolbar.
Step 8: Testing a Circuit: Once you have made all the connections test your circuit
for correctness by pressing the Test button on the toolbar.
27
Lab Manual
Step 9: Executing a Circuit: If testing is successful then execute the circuit to get
the truth table. You can do it by selecting Execute button, which is labelled
as a truth table in the tool bar.
Step 10: Saving the Project: Select File/ Save Project option to save with a suitable
name with .CRC for future use.
A complete example
One of our objectives is that you should be able to design your very own
combinational logic circuit. Here we are explaining you one example of Full Adder
circuit.
a1 a2 a3 S C
0 0 0 0 0 0.
0 0 1 1 0 1.
0 1 0 1 0 2.
0 1 1 0 1 3.
1 0 0 4.
1 0
5.
1 0 1 0 1 6.
1 1 0 0 1 7.
1 1 1 1 1
28
Digital Logic
Step 4: Draw Karnaugh maps & forming groups of 1's on the K-map Circuits
a2 a2
00 01 11 10 00 01 11 10
0 0 1 1 1
a1 1 a1 1 1 1 1 1 1
a3 a3
S= a1 a2 a3 + a1 a2 a3 + a1 a2 a3 + a1 a2 a3
C= a1 a2 + a1 a3 + a2 a3
S= a1 a2 a3 + a1 a2 a3 + a1 a2 a3 + a1 a2 a3
( ) (
S= a1 a2 a3 + a2 a3 + a1 a2 a3 + a2 a3 )
C= a1 a2 + a1 a3 + a2 a3
C= a2 a3 + a1 (a2 XOR a3 )
29
Lab Manual
Step 8: Test the Digital Circuits using given software
• Highlighting Inputs and Outputs: In a complex circuit, you would like to highlight
the connections. You can do it by selecting show output ( ) or show input ( )
buttons. The output is shown in red colour and input is shown in blue colour.
• Editing Circuits: You can use options for copy, paste, or reposition gates etc.
• Printing Circuits and Truth Tables: To print a logic circuit or a truth table simply
select the window containing the data and then select "File / Print...", option.
• Clocks are not used for any purpose in the circuit at present.
• Sample Circuits are available, use them for better understanding.
Circuit or Truth Table does Ensure proper printer is set up and check printer to be
not print. online.
On some high-resolution printers circuits and truth
tables will be printed smaller.
Clock does not work when The clock is not there for execution purposes. It is
circuit is executed. not supported by this version of "Logic Gates."
File does not load. Please check that the file you are trying to load is a
valid ".CRC" file and it exists.
File cannot be saved. Check for the storage device, whether full?
Tool Box does not appear. It has probably been closed. To open it again select
"Window / Show” Menu option.
Session 1:
1. Design and implement the Exclusive-OR gate using AND, OR & NOT gates.
3. We know NAND gate is universal gate but we need proof, so Design other
gates like NOT, OR, AND & NOR using only NAND gates which will prove
that NAND is universal gate.
4. Design a digital circuit whose output is equal to 1 if the majority of inputs are
1’s. The output is 0 otherwise.
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
Explain why your circuit is correct
7. Design a combinational circuit that takes a 3-bit number and the output of that
circuit should be the square of the input Number.
8. Design a combinational circuit where input is a 4 bit number and whose output
is the 2’s complement of the input number.
9. Design the Encoder Circuit, which will convert decimal number to binary
number.
Session 2:
10. Design Sequential Circuit, of clocked RS flip flop with 4 NAND gates.
11. Design Sequential Circuit of clocked D flip flop with AND and NOR gates.
14. Design a logical circuit that will calculate the less-than (<) function for two 2-
bit inputs. That is, if the inputs are A and B, each of whose values can be in the
range 0-3 (i.e., 00-11 in binary), then the output should be 1 whenever A < B,
and 0 otherwise. This circuit requires four inputs, referred to as a1, a2, b1, and
b2. a1 and a2 represent a 2-bit number, as do b1 and b2. The output will be true
if the decimal number represented by the pair a1a2 is less than the decimal
number represented by b1b2. Design this circuit with an optimal number of
gates.
15. A multiplexer circuit accepts N inputs and outputs the value of one of those
inputs. The selection of which input goes out on the output is determined by a
set of M control inputs. A multiplexer with M control inputs can steer up to 2M
inputs to a single output. Design 2-to-1 multiplexer.
16. A decoder has M inputs and up to 2M outputs. If the logic values on the M
inputs are interpreted as a binary number of value P, then the Pth output will be
at logic 1 while all the others are at logic 0. Design 2-to-4 decoder.
2.6 SUMMARY
This section, although it involves only two practice sessions, requires a lot of
groundwork done by you on the paper. These problems will provide you a foundation
on the logic circuit design. You must attempt all these problems. This will also help
your basics with MCS 012 subject and will provide confidence to you for any
challenge in circuit design.
32