Second Semester Digital Lab Manual
Second Semester Digital Lab Manual
TECH IT
SECOND SEMESTER
IT6211 DIGITAL LABORATORY
LAB MANUAL
REGULATION 2013
[Type the abstract of the document here. The abstract is typically a short summary of the contents of the
document. Type the abstract of the document here. The abstract is typically a short summary of the
contents of the document.]
: 1A
AIM:
To verify the truth table of basic digital ICs of AND, OR, NOT, NAND, NOR, EX-OR
gates.
APPARATUS REQUIRED:
Sl.No.
COMPONENT
SPECIFICATION
QTY.
AND GATE
IC 7408
OR GATE
IC 7432
NOT GATE
IC 7404
NAND GATE
IC 7400
NOR GATE
IC 7402
X-OR GATE
IC 7486
IC TRAINER KIT
As needed
THEORY:
Logic gates are the basic elements that make up a digital system.The electronic gate is a
circuit that is able to operate on a number of binary inputs in order to perform a particular logic
function.The type of gates available are the NOT,AND,OR,NAND,NOR,Exclusive-OR and the
Exclusive-NOR.
1.AND gate:
An AND gate is the physical realization of logical multiplication operation. It is an
electronic circuit which generates an output signal of 1 only if all the input signals are 1.
2.OR gate:
An OR gate is the physical realization of the logical addition operation. It is an electronic
circuit which generates an output signal of 1 if any of the input signal is 1.
3.NOT gate:
A NOT gate is the physical realization of the complementation operation. It is an electronic
circuit which generates an output signal which is the reverse of the input signal. A NOT gate is also
known as an inverter because it inverts the input.
4.NAND gate:
A NAND gate is a complemented AND gate. The output of the NAND gate will be 0 if all the
input signals are 1 and will be 1 if any one of the input signal is 0.
5.NOR gate:
AND GATE
LOGIC DIAGRAM:
TRUTH TABLE
INPUT
S.No
A
0
0
1
1
1.
2.
3.
4.
OUTPUT
B
0
1
0
1
Y=A.B
0
0
0
1
OR GATE:
LOGIC DIAGRAM:
TRUTH TABLE
S.No
1.
2.
3.
4.
INPUT
A
0
0
1
1
OUTPUT
B
0
1
0
1
Y=A+B
0
1
1
1
TRUTH TABLE:
S.No
1.
2.
INPUT
A
0
1
OUTPUT
Y = A
1
0
NAND GATE
LOGIC DIAGRAM:
TRUTH TABLE
S.No
1.
2.
3.
4.
NOR GATE:
LOGIC DIAGRAM:
INPUT
A
0
0
1
1
B
0
1
0
1
OUTPUT
Y = (A . B)
1
1
1
0
TRUTH TABLE
INPUT
S.No
A
0
0
1
1
1.
2.
3.
4.
B
0
1
0
1
OUTPUT
Y = (A + B)
1
0
0
0
EX-OR GATE:
LOGIC DIAGRAM:
TRUTH TABLE
S.No
1.
2.
3.
4.
INPUT
A
0
0
1
1
B
0
1
0
1
PROCEDURE:
1. Connections are given as per the circuit diagram
2. For all the ICs 7th pin is grounded and 14th pin is given +5 V supply.
3. Apply the inputs and verify the truth table for all gates.
RESULT:
OUTPUT
Y=A
B
0
1
1
0
Aim:
To verify the truth tables of DeMorgan's theorem and Boolean algebraic laws by using logic
gates.
Apparatus Required:
S.NO
1
COMPONENTS
Digital IC trainer kit
IC
SPECIFICATION
7400
7402
7404
7408
7432
7486
-
QUANTITY
1
1
1
1
1
1
1
As required
Theory:
DeMeorgans Theorems
First Theorem:
It states that the complement of a product is equal to the sum of the complements.
(AB) ' =A' + B'
Second Theorem:
It states that the complement of a sum is equal to the product of the complements.
(A+B)' =A' . B'
Boolean Laws:
Boolean algebra is a mathematical system consisting of a set of two or more distinct
elements, two binary operators denoted by the symbols (+) and (.) and one unary operator denoted
by the symbol either bar (-) or prime (). They satisfy the commutative, associative, distributive and
absorption properties of the Boolean algebra.
Commutative Property:
Boolean addition is commutative, given by
A+B=B+A
Boolean algebra is also commutative over multiplication, given by
A.B=B.A
Truth Table
Input
Output
(A+B) '
A '. B '
De-Morgans Theorem: 2
Input
Output
(A.B) '
A'+B'
Associative Property:
The associative property of addition is given by
A+ (B+C) = (A+B) +C
The associative law of multiplication is given by
A. (B.C) = (A.B).C
Distributive Property:
The Boolean addition is distributive over Boolean multiplication, given by
A+BC = (A+B) (A+C)
Boolean multiplication is also distributive over Boolean addition given by
A. (B+C) = A.B+A.C
Procedure:
1. Connections are made as per the circuit/logic diagram.
2. Make sure that the ICs are enabled by giving the suitable V cc and ground connections.
3. Apply the logic inputs to the appropriate terminals of the ICs.
4. Observe the logic output for the inputs applied.
5. Verify the observed logic output with the verification/truth table given.
Commutative Law:
Truth Table:
Input
Output
A+B
B+A
Truth Table:
Input
Output
A+B
(A+B)+C
B+C
A+(B+C)
Distributive Law:
Input
Output
B+C
A.(B+C)
A.B
A.C
A.B+A.C
Result :
Aim :
To realize the given Boolean functions using NAND and NOR gates
Apparatus required :
SI.No.
COMPONENT
SPECIFICATION
QTY.
AND GATE
IC 7408
NAND GATE
IC 7400
NOR GATE
IC 7402
IC 7410
IC TRAINER KIT
As needed
Theory :
A Boolean function described by an algebraic expression consists of binary variables, the
constants 0 & 1, and the logic operation symbols. When a Boolean expression is implemented with
logic gates, each term requires a gate & each variable within the term designates an input to the
gate. The Boolean functions are expressed either in sum of product (SOP) form for NAND
implementation (or) product of sum (POS) form for NOR implementation. The given Boolean
function is minimized using K map.
f= ( W+Y )( W+X )
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
F
0
0
d
1
0
0
1
1
0
0
d
0
1
1
1
1
001
010
011
100
101
110
111
f=
+
y
+
x
w
w
Logic diagram :
x
y
Fig.
2.1 12, 14, 15 ) using only NAND gates.
B] Realize f ( w, x, y, z ) = ( 3, 5, 6, 7, 8, 9, 10 ) +d(
4, 11,
TRUTH TABLE
W
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
X
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
Y
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
Z
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
F
0
0
0
1
d
1
1
1
1
1
1
d
d
0
d
d
f=
w
x
+
w
x
+
y
z
f=w
x
w
x
y
z
Procedure :
i. The connections are given as per fig 2.1, 2.2.
ii. For various combinations of inputs the outputs verified.
Viva question:
What is a combinational circuit
What is SOP & POS?
Result :
Thus the given functions are realized using NAND & NOR gates .
CODE CONVERTERS
AIM:
To design, construct and test the following code converters.
1. Binary Gray code converter (4 bit)
2. Gray - Binary code converter (4 bit)
3. Excess 3 to BCD code converter
APPARATUS REQUIRED:
Sl.No.
COMPONENT
SPECIFICATION
QTY.
AND GATE
IC 7408
OR GATE
IC 7432
NOT GATE
IC 7404
X-OR GATE
IC 7486
IC TRAINER KIT
As needed
THEORY:
Code converter is a circuit that makes two systems compatible even though each uses a
different code. In order that conversion from binary code to gray code & gray code to binary code, a
combinational circuit code converter can be implemented with gates.
Binary code has two elements 0 & 1 each bit of binary code has a weight of 2. Gray code
also has 0 & 1 as elements. But in this code there is no weight for bits.
Binary to Gray conversion:
The most significant bit w is obtained directly from binary code. The second bit x is
obtained by XORing a & b . Likewise all other bits are obtained in gray code by XORing the
corresponding & preceding bits of binary code.
Gray to binary conversion:
The MSB is obtained directly from the MSB and the other bits are obtained by XORing the
corresponding bit in gray code with preceding binary bit.
Example:
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
Binary code
b
c
0
0
0
0
0
1
0
1
1
0
1
0
1
1
1
1
0
0
0
0
0
1
0
1
1
0
1
0
1
1
1
1
d
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
W
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
Gray Code
X
Y
0
0
0
0
0
1
0
1
1
1
1
1
1
0
1
0
1
0
1
0
1
1
1
1
0
1
0
1
0
0
0
0
Z
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
W=a
X=a1b + a b1 = a b
Y=bc1 + b1c = b c
Z=c1d + cd1 =c d
W
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
Z
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
Binary Code
B
c
0
0
0
0
0
1
0
1
1
0
1
0
1
1
1
1
0
0
0
0
0
1
0
1
1
0
1
0
1
1
1
1
D
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
The K-maps for a, b, c & d based on the truth table & the minimized expressions from them are
shown below.
a=W
b=W1X +WX1 =W X
d = W XYZ
CIRCUIT DIAGRAM
Gray to binary code converter
BCD Output
X1
X2
X3
X4
0
0
0
0
0
1
1
1
1
1
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
A = X1 X2 + X3 X4X1
K-Map for B:
K-Map for C:
K-Map for D:
PROCEDURE:
1. The connections were made as per the circuit diagram
2. The input with different combinations is given and its truth table is to be verified.
Viva Questions :
1. What is unit distance code
2. What are weighted & non weighted codes.
3. What is gray code.
4. What is BCD code
5. What is self complementing code
RESULT:
: 3A
DATE
AIM:
To design and construct half adder, full adder, half subtractor and full subtractor circuits
and verify the truth table using logic gates.
APPARATUS REQUIRED:
Sl.No.
COMPONENT
SPECIFICATION
QTY.
1.
AND GATE
IC 7408
2.
X-OR GATE
IC 7486
3.
NOT GATE
IC 7404
4.
OR GATE
IC 7432
5.
IC TRAINER KIT
6.
PATCH CORDS
As needed
THEORY:
HALF ADDER:
A half adder has two inputs for the two bits to be added and two outputs one from the
sum S and other from the carry c into the higher adder position. Above circuit is called as
a carry signal from the addition of the less significant bits sum from the X-OR Gate the carry
out from the AND gate.
FULL ADDER:
A full adder is a combinational circuit that forms the arithmetic sum of input; it consists
of three inputs and two outputs. A full adder is useful to add three bits at a time but a half adder
cannot do so. In full adder sum output will be taken from X-OR Gate, carry output will be taken
from OR Gate.
HALF SUBTRACTOR:
The half subtractor is constructed using X-OR and AND Gate. The half subtractor has
TRUTH TABLE:
A
CARRY
SUM
0
0
1
1
0
1
0
1
0
0
0
1
0
1
1
0
SUM = AB + AB
CARRY = AB
TRUTH TABLE:
A
CARRY
SUM
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
0
1
1
0
1
0
0
1
CARRY = AB + BC + AC
LOGIC DIAGRAM:
HALF SUBTRACTOR
TRUTH TABLE:
A
BORROW
DIFFERENCE
0
0
1
1
0
1
0
1
0
1
0
0
0
1
1
0
DIFFERENCE = AB + AB
BORROW = AB
LOGIC DIAGRAM:
FULL SUBTRACTOR
TRUTH TABLE:
A
BORROW
DIFFERENCE
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
1
1
0
0
0
1
0
1
1
0
1
0
0
1
Borrow = AB + BC + AC
PROCEEDURE:
(i)
(ii)
(iii)
RESULT:
AIM:
To design and implement 4-bit adder / subtractor using IC 7483.
APPARATUS REQUIRED:
Sl.No.
COMPONENT
SPECIFICATION
QTY.
1.
IC
IC 7483
2.
EX-OR GATE
IC 7486
3.
NOT GATE
IC 7404
4.
IC TRAINER KIT
5.
PATCH CORDS
As
needed
THEORY:
4 BIT BINARY ADDER:
A binary adder is a digital circuit that produces the arithmetic sum of two binary
numbers. It can be constructed with full adders connected in cascade, with the output carry from
each full adder connected to the input carry of next full adder in chain. The augends bits of A
and the addend bits of B are designated by subscript numbers from right to left, with subscript
0 denoting the least significant bits. The carries are connected in chain through the full adder.
The input carry to the adder is C0 and it ripples through the full adder to the output carry C4.
LOGIC DIAGRAM:
4-BIT BINARY ADDER/SUBTRACTOR
Input Data A
Input Data B
Addition
A4 A3 A2 A1 B4 B3 B2 B1
Subtraction
S4 S3 S2 S1
D4 D3 D2
D1
Res
ult :
AIM:
Design and implementation of Even and Odd Parity Generator/Checker using logic gates and MSI
device.
APPARATUS REQUIRED:
S.NO
COMPONENTS
IC
3
4
Connecting wires
Patch cords
CONFIGURATIO
N
7486
7404
74180
-
QUANTITY
1
1
1
1
As required
As required
Theory:
Parity generator:
A parity bit is a scheme of detecting error during transmitting of binary information. A parity
bit is an extra bit included with a binary message to make the number of 1s either odd or even.
Parity generators are used in digital transmission system for the errorless transmission of
digital data. A parity bit is added to the data before the transmission and it will be checked for the
correctness at the receiver end. There are two types of parity systems, even parity and odd parity. In
the even parity system if the number of 1s in the data word is odd, a 1 will be added as a parity bit
to the data to make total number of 1s even. If the number of 1s even, a 0 bit will be added. In the
odd parity system if the number of 1s in the data word is odd, a 0 will be added to make the
number of 1s odd. Otherwise, a 1 is added to make it odd. The circuit shown in the figure is used as
a parity generator as well as a checker. ABCD is the 4-bit data word. Pi and Po are the parity input
and parity output respectively.
The message, including the parity bit, is transmitted and then checked at the receiving end
for errors. An error detected if the checked parity does not correspond with the one transmitted. The
circuit that generates the parity bit in the transmitter is called a parity generator. The circuit that
checks the parity in the receiver is called parity checker. In even parity the added parity bit will
make the total number of 1s an even amount. In odd parity the added parity bit will make the total
number of 1s an odd amount.
EPB = D1D2D3D4
OPB = (D1D2D3D4)'
D1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
Data Inputs
D2
D3
0
0
0
0
0
1
0
1
1
0
1
0
1
1
1
1
0
0
0
0
0
1
0
1
1
0
1
0
1
1
1
1
D4
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
Parity Bit
Even Odd
0
1
1
0
1
0
0
1
1
0
0
1
0
1
1
0
1
0
0
1
0
1
1
0
0
1
1
0
1
0
0
1
PEC = ABCP
Truth Table for Even Parity Checker
4 BIT DATA RECEIVED
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
P
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
PARITY ERROR
CHECK
PEC
0
1
1
0
1
0
0
1
1
0
0
1
0
1
1
0
Procedure:
Connections are made as per the circuit/logic diagram.
Make sure that the ICs are enabled by giving the suitable Vcc and ground
connections.
Apply the logic inputs to the appropriate terminals of the ICs.
Observe the logic output for the inputs applied.
Verify the observed logic output with the verification/truth table given.
Result:
PO
0
0
1
1
OUTPUTS
O
E
0
1
0
1
1
0
1
0
EX NO.: 5
DATE :
AIM:
To design and implement
(i)
(ii)
APPARATUS REQUIRED:
Sl.No
COMPONENT
SPECIFICATION
QTY.
.
1.
AND GATE
IC 7408
2.
X-OR GATE
IC 7486
3.
OR GATE
IC 7432
4.
NOT GATE
IC 7404
5.
4-BIT MAGNITUDE
IC 7485
COMPARATOR
6.
IC TRAINER KIT
7.
As needed
THEORY:
The comparison of two numbers is an operator that determine one number is greater
than, less than (or) equal to the other number. A magnitude comparator is a combinational
circuit that compares two numbers A and B and determine their relative magnitude. The
outcome of the comparator is specified by three binary variables that indicate whether A>B, A=B
(or) A<B.
A = A3 A2 A1 A0
B = B3 B2 B1 B0
The equality of the two numbers and B is displayed in a combinational circuit designated
by the symbol (A=B).
This indicates A greater than B, then inspect the relative magnitude of pairs of significant
digits starting from most significant position. A is 0 and that of B is 0.
We have A<B, the sequential comparison can be expanded as
LOGIC DIAGRAM:
2 BIT MAGNITUDE COMPARATOR
K MAP
TRUTH TABLE
Inputs
Outputs
A1
A0
B1
B0
A>B
A=B
A<B
LOGIC DIAGRAM:
4 BIT MAGNITUDE COMPARATOR
TRUTH TABLE:
OUTPUT:
A>B
A=B
A<B
0000
0000
0001
0000
0000
0001
1000
0001
0101
1000
0111
0101
PROCEDURE:
(i)
(ii)
(iii)
RESULT:
COMPONENT
SPECIFICATION
QTY.
1.
IC 7411
2.
OR GATE
IC 7432
3.
NOT GATE
IC 7404
4.
IC TRAINER KIT
5.
PATCH CORDS
As required
THEORY:
MULTIPLEXER:
Multiplexer means transmitting a large number of information units over a smaller number of
channels or lines. A digital multiplexer is a combinational circuit that selects binary information from one
of many input lines and directs it to a single output line. The selection of a particular input line is
controlled by a set of selection lines. Normally there are '2n input line and n' selection lines whose bit
combination determine which input is selected.
DEMULTIPLEXER:
The function of Demultiplexer is in contrast to multiplexer function. It takes information from one
line and distributes it to a given number of output lines. For this reason, the demultiplexer is also known
as a data distributor. Decoder can also be used as demultiplexer.
In the 1: 4 demultiplexer circuit, the data input line goes to all of the AND gates. The data select
lines enable only one gate at a time and the data on the data input line will pass through the selected
gate to the associated data output line.
FUNCTION TABLE:
S1
S0
INPUTS Y
D0 D0 S1 S0
D1 D1 S1 S0
D2 D2 S1 S0
D3 D3 S1 S0
Y = D0 S1 S0 + D1 S1 S0 + D2 S1 S0 + D3 S1 S0
TRUTH TABLE:
S1
S0
Y = OUTPUT
D0
D1
D2
D3
FUNCTION TABLE:
S1
S0
INPUT
X D0 = X S1 S0
X D1 = X S1 S0
X D2 = X S1 S0
X D3 = X S1 S0
Y = X S1 S0 + X S1 S0 + X S1 S0 + X S1 S0
TRUTH TABLE:
INPUT
OUTPUT
S1
S0
I/P
D0
D1
D2
D3
PROCEDURE:
iii. Connections are given as per circuit diagram.
iv. Logical inputs are given as per circuit diagram.
COMPONENT
SPECIFICATION
QTY.
IC 7476
1.
JK FLIP FLOP
IC TRAINER KIT
PATCH CORDS
As required
THEORY:
A counter is a register capable of counting number of clock pulse arriving at its clock
input. Counter represents the number of clock pulses arrived. A specified sequence of states
appears as counter output. This is the main difference between a register and a counter. There
are two types of counter, synchronous and asynchronous. In synchronous common clock is given
to all flip flop and in asynchronous first flip flop is clocked by external pulse and then each
successive flip flop is clocked by Q or Q output of previous stage. The clock of second stage is
triggered by output of first stage. Because of inherent propagation delay time all flip flops are
not activated at same time which results in asynchronous operation.
PIN DIAGRAM FOR IC 7476:
TRUTH TABLE:
CLK
QA
QB
QC
QD
10
11
12
13
14
15
PROCEDURE:
(i)
(ii)
(iii)
RESULT:
DATE :
AIM:
To design and implement
vi. Serial in serial out
vii. Serial in parallel out
viii.
Sl.No.
COMPONENT
SPECIFICATION
QTY.
1.
D FLIP FLOP
IC 74174
2.
OR GATE
IC 7432
3.
IC TRAINER KIT
4.
PATCH CORDS
As required
THEORY:
A register is capable of shifting its binary information in one or both directions is known
as shift register. The logical configuration of shift register consist of a D-Flip flop cascaded with
output of one flip flop connected to input of next flip flop. All flip flops receive common clock
pulses which causes the shift in the output of the flip flop.
The
simplest
possible
shift
register is one that uses only flip flop. The output of a given flip flop is connected to the input of
next flip flop of the register. Each clock pulse shifts the content of register one bit position to
right.
PIN DIAGRAM: IC
74174
LOGIC DIAGRAM:
SERIAL IN SERIAL OUT:
TRUTH TABLE:
Serial in
Serial out
CLK
LOGIC DIAGRAM:
SERIAL IN PARALLEL OUT:
TRUTH TABLE:
OUTPUT
CLK
DATA
QA
QB
QC
QD
LOGIC DIAGRAM:
PARALLEL IN SERIAL OUT:
TRUTH TABLE:
CLK
Q3
Q2
Q1
Q0
O/P
LOGIC DIAGRAM:
PARALLEL IN PARALLEL OUT:
TRUTH TABLE:
DATA INPUT
OUTPUT
CLK
DA
DB
DC
DD
QA
QB
QC
QD
PROCEDURE:
Connections are given as per circuit diagram.
Logical inputs are given as per circuit diagram.
Observe the output and verify the truth table.
RESULT:
2.Relational Operators.
Eg: =, /=, <, <=, >, >=.
3.Shift Operators.
Eg: sll, sla, srl, rol,ror.
4.Adding Operators.
Eg: +, -, &.
5.Multiplying Operators.
Eg: *, /, mod.
6. Miscellaneous Operators. Eg: **, abs.
4. SEQUENTIAL STATEMENTS: These statements are executed serially. The following are the
some examples of Sequential statements.
(iv)
(v)
(vi)
Variable assignment statement: It can be declared and used inside the Process
statement. A variable is assigned a value using the Variable assignment statement.
The syntax is given by
Signal assignment statement: Signals are assigned values using a signal assignment
statement. The syntax is given by
Component Instantiation :
Date:
AIM:
To verify the Functionality of a full adder and a four bit binary adder using HDL.
THEORY:
A full adder is capable of adding 2, 1 bit numbers & an input carry. Four full adder circuits
are needed to sum, two 4 bit binary numbers, A&B in parallel. All the bits of A&B are applied
simultaneously. The output carry from one full adder is connected to their input carry of the full
adder to its left. As soon as the carries are generated, the correct sum bits emerge from the sum
outputs of all full adder.
TRUTH TABLE FOR SINGLE BIT FULL ADDER:
Input
Output
Ci
C0
Source Code:
1
0
1
SINGLE BIT FULL ADDER
1
0
library ieee; 1
1
1
1
use ieee.std_logic_1164.all;
entity faddr is
port (a,b,ci : in std_logic;
s,c0 : out std_logic);
end faddr;
architecture struct of faddr is
Full Adder:
RESULT:
Thus the functionality of the Four bit binary adder was verified using VHDL
DATE:
AIM:
To verify the Functionality of 4 to 2 Priority Encoder using HDL
THEORY:
A priority encoder is an encoder circuit that includes the priority function. The operation of
the priority encoder is such that if 2 (or) more inputs are equal to 1 at the same time, the input
having the highest priority will take precedence. The truth table of a 4 input priority encoder is
shown in table. The Xs are dont care conditions that designate the binary value, it may be equal
either to 0 or 1. Input D3 has highest priority. D2 has next priority level. D0 has the lowest priority
level.
TRUTH TABLE:
Input
Output
W0 W1 W2 W3 Y0 Y1
0
0
0
0
x
x
1
0
0
0
0
0
x
1
0
0
1
0
x
1
0
1
0
x
x
x
x
1
1
1
Z
0
1
1
1
1
Source Code:
4 TO 2 PRIORITY ENCODER
library ieee;
use ieee.std_logic_1164.all;
entity priority4to2 is
port(w : in std_logic_vector (3 downto 0);
y : out std_logic_vector(1 downto 0);
z : out std_logic);
end priority4to2;
architecture behavior of priority4to2 is
begin
y <= "11" when w(3) = '1' else
"10" when w(2) = '1' else
"01" when w(1) = '1' else
"00" ;
z <= '0' when w = "0000" else '1';
end behavior;
RESULT:
Thus the functionality of the 4 to 2 Priority Encoder was verified using VHDL
AIM:
To verify the Functionality of 4 Bit Up Counter using HDL
THEORY:
Four bit counter is capable of counting from 0 to 15. The clock inputs are connected in cascade.
The enable signal is directly connected to first flipflop. Flipflops are connected through the AND
gates. When enable =0 then the inputs of all the flipflpos are 0. When the enable input =1, it
operates. The count is incremented during the rising edge of the clock pulse.
TRUTH TABLE:
Clk
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Q3
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
Q2
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
Source Code:
4 BIT BINARY UPCOUNTER
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity upcount is
port(clk,rst,en : in std_logic;
q : out std_logic_vector(3 downto 0)) ;
end upcount;
Q1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
Q0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
RESULT:
Thus the functionality of 4 bit binary Up Counter was verified using VHDL.