Reference Lab Manual: CSC302 - Digital Logic Design and Analysis
Reference Lab Manual: CSC302 - Digital Logic Design and Analysis
Reference Lab Manual: CSC302 - Digital Logic Design and Analysis
● Digital IC’s
● Digital trainer kits
● Xilinx simulation/synthesis software
Experiment No.1
Aim:
A) To study and verify the truth table of various logic gates using ICs
B) Realize Boolean expressions using gates.
Apparatus:
S.
COMPONENT SPECIFICATION QUANTITY
No
1. OR GATE IC 7432 1
7. TRAINER KIT - 1
CONNECTING
5. - -
WIRES
Theory:
A) To study and verify the truth table of various logic gates using ICs
Logic Gates are electronic circuits that operate on one or more input signals to produce an output signal. The
form the building blocks of all digital systems.OR, NOT and AND are basic gates. All the logic functions are
commercially available in integrated circuit (IC) form.
AND GATE (IC 7408):
The AND Gate performs logical multiplication known as AND operation. The output is high when all outputs
are high and low if any one of the inputs is low. IC 7408 is Quad 2-Input AND gate. Logical AND function is
given by:
Y = A AND B = A.B
NOT GATE (IC 7404):
The NOT Gate performs inverting or complementing operation. It is thus called as an inverter. The output is
high when the input is low and it is low when the input is high. IC 7404 has hex inverters. Logical NOT
function is given by:
Y = NOT A = A’
The OR GATE (IC 7432):
The OR Gate performs logical addition known as OR operation. The output is low when all inputs are low and
high when any one of the inputs is high. IC 7432 is Quad 2-Input OR gate.
Procedure:
After understanding the implementation of basic gates using IC’s, We can able to realize Boolean
expression with the help of basic gates. An example for the realization of Boolean expression is as
follow:
Procedure:
1) Make the connections basic gate IC on the breadboard as per the given boolean expression.
Conclusion :
A) Truth table, Symbols and pin diagram of Logic Gates:-
1) Inverter/ NOT Gate (IC 7404):
0 0 0 1 0 1 0
0 0 1 1 0 1 0
0 1 0 0 1 0 0
0 1 1 0 1 1 1
1 0 0 1 1 1 1
1 0 1 1 1 1 1
1 1 0 0 1 0 0
1 1 1 0 1 1 1
Experiment No. 2
Aim:
A) Realization of basic gates using universal gates
B) To realize Boolean expressions using universal gates.
Apparatus:
S. No COMPONENT SPECIFICATION QUANTITY
3. TRAINER KIT - 1
4. CONNECTING WIRES - -
Theory:
A) Realization of basic gates using universal gates
The NAND and NOR are called as universal gates because we can built any function using only
NAND gates or only NOR gates.
NAND GATE :
i) NAND AS NOT : The output expression of the NAND gate is Y = A.B The fig 1 shows the
implementation of the NOT gate using NAND gate. As both the inputs are connected together we can
write
A=B
Y = A.B
Y = A.A
Y = Ā this is the Boolean expression for the NOT gate.
ii) NAND AS AND : The output expression of the NAND gate is Y = A.B The fig 2 shows the
implementation of the AND gate using NAND gate. The Boolean expression for the AND gate is
Y = A.B
NOR GATE : All gates can be implemented using NOR similar to NAND gates.
Procedure:
1) Mount the required IC on the bread board and make the connections as per the diagram.
2) Give the + 5 Vcc supply to IC pin no. 14 and Gnd to IC pin no.7 with the help
of connecting wires.
3) With the connecting wires give the logical inputs to the required pins.
4) Connect the output pin across the logical terminal to check.
5) Vary the inputs and record the corresponding outputs in tabular form.
6) Compare the output with the corresponding truth table.
Conclusion :
B) 1) The truth table to implement the expression Z = A.B + C.D
2) The circuit diagram to implement the expression Z = A.B + C.D using NAND gate
3) The circuit diagram to implement the expression Z = A.B + C.D using NOR gate
Experiment No-3
Aim: To realize binary to gray code and gray code to binary converter.
Apparatus: Ic Trainer kit, IC7486,Single stand wires
Theory:
It is a logic circuit whose inputs are bit patterns representing the numbers in one and
whose outputs are corresponding representations in different codes.
E.g. A binary to gray code converter has 4 binary input lines B3, B2, B1, and B0. When input is
0010 for instance the output should be 0011.
To design code converter, we use Code Table to express each output as Boolean Algebraic
Function of all the inputs.
The logic expression entered for code conversion can be simplified using usual
techniques including unweighted code. Some cell numbering methods, which we used earlier,
can be used but cell number must correspond to input combinations as if they were an 8421 code.
Integrated circuits are available to convert data from one form to another. Binary or BCD
conversions are most often encountered in connections with computer applications. Numerical
data is transmitted in BCD form from the input devices. The data must be converted to Binary so
that arithmetic operations convert it to BCD for transmission to the output devices. Therefore,
conversions are often accomplished by using major components of computer itself rather than
special converter circuits. In some systems, conversions are accomplished by the system itself
through execution of specially designed.
1) Binary to gray code conversion is a very simple process. There are several steps to do
this types of conversions. Steps given below elaborate on the idea on this type of
conversion.
1. The M.S.B. of the gray code will be exactly equal to the first bit of the given binary
number.
2. Now the second bit of the code will be exclusive-or of the first and second bit of the
given binary number, i.e if both the bits are same the result will be 0 and if they are
different the result will be 1.
3. The third bit of gray code will be equal to the exclusive-or of the second and third bit
of the given binary number. Thus the Binary to gray code conversion goes on. One
example given below can make your idea clear on this type of conversion.
Thus the equivalent gray code is 01101.
Now concentrate on the example where the M.S.B. of the binary is 0 so for it will be 0 for the
most significant gray bit. Next, the XOR of the first and the second bit is done. The bits are
different so the resultant gray bit will be 1. Again move to the next step, XOR of second and
third bit is again 1 as they are different. Next, XOR of third and fourth bit is 0 as both the bits are
same. Lastly the XOR of fourth and fifth bit is 1 as they are different. That is how the result of
binary to gray code conversion of 01001 is done whose equivalent gray code is 01101.
The M.S.B of the binary will be 0 as the M.S.B of gray is 0. Now move to the next gray bit. As it
is 1 the previous binary bit will alter i.e it will be 1, thus the second binary bit will be 1. Next
look at the third bit of the gray code. It is again 1 thus the previous bit i.e the second binary bit
will again alter and the third bit of the binary number will be 0. Now, 4th bit of the given gray is
0 so the previous binary bit will be unchanged, i.e 4th binary bit will be 0. Now again the 5th
grey bit is 1 thus the previous binary bit will alter, it will be 1 from 0. Therefore the equivalent
Binary number in case of gray code to binary conversion will be (01001).
Procedure:
1 The circuit Diagram and the connections are as shown in the figure.
2. Use the IC 7486
3. Connect pin 14 to the VCC and Pin 7 to the Ground
4. In case of Binary to Gray conversion the inputs are B0 to B3. Are given at the respective
inputs pins and output G0to G3 are taken for all the 16 combination of the inputs.
5. .In case of Gray to Binary conversion the inputs are G0 to G3. Are given at the respective
inputs pins and output B0 to B3 are taken for all the 16 combination of the inputs.
Conclusion:
(To be write on blank side)
Truth Table-
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0100
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
K-MAPS:
K-MAP FOR G3:
Apparatus:
S. No COMPONENT SPECIFICATION QUANTITY
3 OR GATE IC 7432 1
5. TRAINER KIT - 1
6. CONNECTING WIRES - -
Theory:
1)Half-Adder
Half adder is a combinational arithmetic circuit that adds two numbers and produces a sum bit (S) and
carry bit (C) as the output. If A and B are the input bits, then sum bit (S) is the X-OR of A and B and the
carry bit (C) will be the AND of A and B. From this it is clear that a half adder circuit can be easily
constructed using one X-OR gate and one AND gate. Half adder is the simplest of all adder circuit, but it
has a major disadvantage. The half adder can add only two input bits (A and B) and has nothing to do
with the carry if there is any in the input. So if the input to a half adder have a carry, then it will be
neglected it and adds only the A and B bits. That means the binary addition process is not complete and
that’s why it is called a half adder.
From the truth table the expression for sum and carry bits of the output can be obtained
as, Sum, S = A xor B
Carry, C = A . B
2)Full-Adder
A full-adder is a logic circuit having 3 inputs A,B and C ( which is the carry from the previous stage) and
2 outputs (Sum and Carry), which will perform according to table 3. The full-adder can handle three
binary digits at a time and can therefore be used to add binary numbers in general. The simplest way to
construct a full adder is to connect twohalf- adder and an OR gate as shown in Fig. The full-adder
is then the fundamental logic circuit incorporated in digital computers to perform arithmetic
functions.
From the truth table the expression for sum and carry bits of the output can be obtained as,
CARRY = AB + BC +AC
Subtractor
The arithmetic operation, subtraction of two binary digits has four possible elementary operations,
namely,
0-0=0
0 - 1 = 1 with 1 borrow
1-0=1
1-1=0
In all operations, each subtrahend bit is subtracted from the minuend bit. In case of the second operation
the minuend bit is smaller than the subtrahend bit, hence 1 is borrowed.
3) Half subtractor:
A combinational circuit which performs the subtraction of two bits is called half sub tractor. The input
variables designate the minuend and the subtrahend bit, whereas the output variables produce the
difference and borrow bits.
From the truth table the expression for difference and borrow bits of the output can be obtained as,
Difference, DIFF = A XOR B
Borrow, BORR = A’ . B
4) Full subtractor:
The half subtractor can be used only for subtraction of the least significant bit of two n-bit binary nos.
since they can operate on only two bits. For higher columns a circuit known as full subtractor is
required which operates on three bits. The third bit is borrow bit from the minuend of the next column
of bits. Hence a full subtractor is a logic circuit with three inputs and two outputs.
DIFF = AB’C’ + A’B’C + A’BC’ + ABC = A XOR B XOR C
BORR = A’B + A’C + BC
Procedure:
1) Mount the required IC’s on the bread board and make the connections as per the diagram.
2) Give the + 5 Vcc supply to IC pin no. 14 and Gnd to IC pin no.7 with the help of
connecting wires.
3) With the connecting wires give the logical inputs to the required pins.
4) Connect the o/p pin across the logical o/p terminal.
5) Vary the inputs and record the corresponding outputs in tabular form.
6) Compare the output with the corresponding truth table.
.Conclusion:
1)Half adder
Truth table
A B SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
2) Full adder
INPUT OUTPUT
S.No
A B C SUM CARRY
1. 0 0 0 0 0
2. 0 0 1 1 0
3. 0 1 0 1 0
4. 0 1 1 0 1
5. 1 0 0 1 0
6. 1 0 1 0 1
7. 1 1 0 0 1
8. 1 1 1 1 1
Design using k-map
SUM
CARRY
CARRY = AB + BC +AC
3) Half subtractor
INPUT OUTPUT
S.No
A B DIFF BORR
1. 0 0 0 0
2. 0 1 1 1
3. 1 0 1 0
4. 1 1 0 0
DIFF = A XOR B
BORR = A’ . B
4) Full subtractor
Truth Table
INPUT OUTPUT
S.No
A B C DIFF BORR
1. 0 0 0 0 0
2. 0 0 1 1 1
3. 0 1 0 1 1
4. 0 1 1 0 1
5. 1 0 0 1 0
6. 1 0 1 0 0
7. 1 1 0 0 0
8. 1 1 1 1 1
Difference
3. TRAINER KIT - 1
4. CONNECTING WIRES - -
Theory:
A parity generator is a combinational logic circuit that generates the parity bit in the transmitter.
On the other hand, a circuit that detects the parity in the receiver is called parity detector. A
combined circuit or devices of parity generators and parity detectors are commonly used in
digital systems to detect the single bit errors in the transmitted data word.
The sum of the data bits and parity bits can be even or odd . In even parity, the added parity bit
will make the total number of 1s an even amount whereas in odd parity the added parity bit will
make the total number of 1s odd amount.
The basic principle involved in the implementation of parity circuits is that sum of odd number
of 1s is always 1 and sum of even number of 1s is always zero. Such error detecting and
correction can be implemented by using Ex-OR gates (since Ex-OR gate produce zero output
when there are even number of inputs).
1)Parity Generator
It is combinational circuit that accepts an n-1 bit stream data and generates the additional bit that
is to be transmitted with the bit stream. This additional or extra bit is termed as a parity bit.
In even parity bit scheme, the parity bit is ‘0’ if there are even number of 1s in the data stream
and the parity bit is ‘1’ if there are odd number of 1s in the data stream.
In odd parity bit scheme, the parity bit is ‘1’ if there are even number of 1s in the data stream and
the parity bit is ‘0’ if there are odd number of 1s in the data stream. Let us discuss both even and
odd parity generators.
Let us assume that a 3-bit message is to be transmitted with an even parity bit. Let the three
inputs A, B and C are applied to the circuits and output bit is the parity bit P. The total number of
1s must be even, to generate the even parity bit P.
The K-map simplification for 3-bit message even parity generator is shown
From the above Kmap, the simplified expression of the parity bit can be written as
Let us consider that the 3-bit data is to be transmitted with an odd parity bit. The three inputs are
A, B and C and P is the output parity bit. The total number of bits must be odd in order to
generate the odd parity bit.
The truth table of the odd parity generator can be simplified by using K-map as
The output parity bit expression for this generator circuit is obtained as
P = A ⊕ B Ex-NOR C
The above Boolean expression can be implemented by using one Ex-OR gate and one Ex-NOR
gate in order to design a 3-bit odd parity generator.
The logic circuit of this generator is shown in below figure , in which . two inputs are applied at
one Ex-OR gate, and this Ex-OR output and third input is applied to the Ex-NOR gate , to
produce the odd parity bit. It is also possible to design this circuit by using two Ex-OR gates and
one NOT gate.
2) Parity Detector
It is a logic circuit that checks for possible errors in the transmission. This circuit can be an even
parity checker or odd parity checker depending on the type of parity generated at the
transmission end. When this circuit is used as even parity checker, the number of input bits must
always be even.
When a parity error occurs, the ‘sum even’ output goes low and ‘sum odd’ output goes high. If
this logic circuit is used as an odd parity checker, the number of input bits should be odd, but if
an error occurs the ‘sum odd’ output goes low and ‘sum even’ output goes high.
Consider that three input message along with even parity bit is generated at the transmitting end.
These 4 bits are applied as input to the parity checker circuit which checks the possibility of error
on the data. Since the data is transmitted with even parity, four bits received at circuit must have
an even number of 1s.
If any error occurs, the received message consists of odd number of 1s. The output of the parity
checker is denoted by PEC (parity error Detect).
The above truth table can be simplified using K-map as shown below.
Consider that a three bit message along with odd parity bit is transmitted at the transmitting
end. Odd parity checker circuit receives these 4 bits and checks whether any error are present in
the data.
If the total number of 1s in the data is odd, then it indicates no error, whereas if the total number
of 1s is even then it indicates the error since the data is transmitted with odd parity at
transmitting end.
After simplification of Kmap, the final expression for the PEC is obtained as
Conclusion:
1) Even Parity Generator
The figure below shows the truth table of even parity generator in which 1 is placed as parity bit
in order to make all 1s as even when the number of 1s in the truth table is odd.
The K-map simplification for 3-bit message even parity generator is shown
The logic diagram of even parity generator with two Ex – OR gates is shown below.
2) Odd Parity Generator
In the given truth table below, 1 is placed in the parity bit in order to make the total number of
bits odd when the total number of 1s in the truth table is even.
The truth table of the odd parity generator can be simplified by using K-map as
The logic diagram of odd parity generator with two Ex – OR gates is shown below.
The above logic expression for the even parity checker can be implemented by using three Ex-
OR gates as shown in figure.
3) Odd Parity Detector
The below figure shows the truth table for odd parity generator
The expression for the PEC in the above truth table can be simplified by K-map as shown below.
The expression for the odd parity checker can be designed by using three Ex-NOR gates as
shown below.
Experiment No. 6
Aim: ToStudy multiplexer IC and Realization of full adder using multiplexer IC.
Apparatus:
1. Multiplexer IC 74151 1
4. TRAINER KIT - 1
5. CONNECTING WIRES - -
Theory:
A multiplexer (MUX) is a digital switch which connects data from one of n sources to the output. A
number of select inputs determine which data source is connected to the output. The block diagram of
MUX with n data sources of b bits wide and s bits wide select lines.
MUX acts like a digitally controlled multi-position switch where the binary code applied to the select
inputs controls the input source that will be switched on to the output as shown in the figure below. At
any given point of time only one input gets selected and is connected to output, based on the select input
signal.
First of all we check/implement Carry of Full Adder (having 3 inputs) using 8X1 Mux, for this take :
Then we check/implement Sum of Full Adder for 3 input variables, using 8X1 Mux for this, we take :
Procedure :-
1) Mount the required IC’s on the bread board and make the connections as per the diagram.
2) Give the + 5 Vcc supply and Gnd to IC pins with the help of connecting wires.
3) With the connecting wires give the input to the required pins.
4) Connect the o/p pin across the logical o/p terminals
5) Verify the truth table of full adder.
Conclusion:
.
Block diagram of 8:1 multiplexer
Function Table
1. Decoder IC 74138 1
2 OR GATE IC 7432 1
3. TRAINER KIT - 1
4. CONNECTING WIRES - -
Theory:
Decoder:-
A decoder is a device which does the reverse of an encoder, undoing the encoding so that the original
information can be retrieved. The same method used to encode is usually just reversed in order to decode.
In digital electronics, a decoder can take the form of a multiple-input, multiple-output logic circuit that
converts coded inputs into coded outputs, where the input and output codes are different. e.g. n-to-2n ,
binary coded decimal decoders. Enable inputs must be on for the decoder to function, otherwise its
outputs assume a single "disabled" output code word. Decoding is necessary in applications such as data
multiplexing, 7 segment display and memory address decoding.
A slightly more complex decoder would be the n-to-2n type binary decoders. These types of decoders are
combinational circuits that convert binary information from 'n' coded inputs to a maximum of 2n unique
outputs. We say a maximum of 2n outputs because in case the 'n' bit coded information has unused bit
combinations, the decoder may have less than 2n outputs. We can have 2-to-4 decoder, 3-to-8 decoder or
4- to-16 decoder. We can form a 3-to-8 decoder from two 2-to-4 decoders (with enable signals).
Similarly, we can also form a 4-to-16 decoder by combining two 3-to-8 decoders. In this type of circuit
design, the enable inputs of both 3-to-8 decoders originate from a 4th input, which acts as a selector
between the two 3-to-8 decoders. This allows the 4th input to enable either the top or bottom decoder,
which produces outputs of D(0) through D(7) for the first decoder, and D(8) through D(15) for the second
decoder.
A decoder that contains enable inputs is also known as a decoder-demultiplexer. Thus, we have a 4-to-
16decoder produced by adding a 4th input shared among both decoders, producing 16 outputs.
A full adder is a combinational circuit that forms the arithmetic sum of input; it consists of three inputs
and two outputs. IC 74138 is a 3:8 line decoder IC.
S= Σm (1,2,4,7)
C= Σm (3,5,6,7)
To get the Sum OR the min terms 1,2,4,7 and to get Carry the minterms 3,5,6,7 are ORed.
Procedure :-
1) Mount the required IC’s on the bread board and make the connections as per the diagram.
2) Give the + 5 Vcc supply and gnd to IC pins with the help of connecting wires.
3) With the connecting wires give the input to the required pins.
4) Connect the o/p pin across the logical o/p terminals
5) Verify the truth table of full adder.
Conclusion:
Pin diagram of 74138
3. TRAINER KIT - 1
4. CONNECTING WIRES - -
Theory:
Flip-flops are the basic single-bit memory elements used to build sequential circuit with one or two
inputs/outputs, designed using individual logic gates and feedback loops.
JK flip flop
The JKflip-flop augments the behavior of the SR flip-flop by interpreting the S = R = 1 condition as a
"flip" or toggle command. Specifically, the combination J = 1, K = 0 is a command to set the flip-flop;
the combination J = 0, K = 1 is a command to reset the flip-flop; and the combination J = K = 1 is a
command to toggle the flip-flop, i.e., change its output to the logical complement of its current value.
The 74F76 is a dual negative edge-triggered JK flip-flop featuring individual J, K, clock, preset, and
clear inputs; also true and complementary outputs. Preset (PRE) and clear (CLR) are asynchronous active
low inputs and operate independently of the clock input.
D flip flop
The Q output always takes on the state of the D input at the moment of a rising clock edge, and never at
any other time. It is called the Dflip-flop for this reason, since the output takes the value of the Dinput or
Datainput, and Delaysit by one clock count.
The characteristic equation of the D flip-flop is:
Q =D
next
The 74F74 is a dual positive edge-triggered D-type flip-flop featuring individual data, clock, preset, and
clear inputs; also true and complementary outputs. Preset (PRE) and clear (CLR) are asynchronous active
low inputs and operate independently of the clock input. When set and reset are inactive (high), data at the
D input is transferred to the Q and Q outputs on the low-to-high transition of the clock. Data must be
stable just one setup time prior to the low-to-high transition of the clock for predictable operation. Clock
triggering occurs at a voltage level and is not directly related to the transition time of the positive-going
pulse. Following the hold time interval, data at the D input may be changed without affecting the levels of
the output.
Procedure :-
1) Mount the required IC’s on the bread board and make the connections as per the diagram.
2) Give the + 5 Vcc and Gnd to IC with the help of connecting wires.
3) With the connecting wires give the logical inputs to the required pins.
4) Connect the o/p pin across the logical output terminals.(Q, Q ).
bar
Conclusion :
JK Flip-flop
Input Output
Description
J K Q Q
0 0 0 0 Memory
same as
for the 0 0 0 1 no change
SR Latch 0 1 1 0
Reset Q » 0
0 1 0 1
1 0 0 1
Set Q » 1
1 0 1 0
toggle 1 1 0 1
Toggle
action 1 1 1 0
Experiment No 9
Apparatus:
3. TRAINER KIT - 1
4. CONNECTING WIRES - -
Theory:
Asynchronous counter: The state change of one flip-flop triggers the next flip-flop in line.
The circuit below is a 3-bit up counter. J-K flip-flops connected in such a way to always be in the “toggle”
mode. The main clock is applied to the first flip- flop and Q output of first flip-flop will serve as clock to
next flip –flop. Same way the Q output of second flip flop serve as a clock to third flip flop. The output
for the counter is taken from output Q of each flip-flop.
Procedure :-
1) Mount the required IC’s on the bread board and make the connections as per the diagram.
2) Give the + 5 Vcc and Gnd to IC with the help of connecting wires.
3) With the connecting wires give the clock input and up/down input to the required pin.
5) Apply the clock and up/down input and verify the up and down counter operation.
Conclusion :
3 bit (MOD-8) UP COUNTER CIRCUIT DIAGRAM:
Timing diagram :
Experiment No. 10
3 OR Gate IC 7432 1
4. TRAINER KIT - 1
5. CONNECTING WIRES - -
Theory:
Shift registers are a type of sequential logic circuit, mainly for storage of digital data. They are a group of
flip-flops connected in a chain so that the output from one flip-flop becomes the input of the next flip-
flop. Most of the registers possess no characteristic internal sequence of states.
All flip-flop is driven by a common clock, and all are set or reset simultaneously.
The serial in/serial out shift register accepts data serially – that is, one bit at a time on a single line. It
produces the stored information on its output also in serial form.
A four-bit parallel in - serial out shift register is shown below. The circuit uses D flip-flops and NAND
gates for entering data (ie writing) to the register. D0, D1, D2 and D3 are the parallel inputs, where D0 is
the most significant bit and D3 is the least significant bit. To write data in, the mode control line is taken
to LOW and the data is clocked in. The data can be shifted when the mode control line is HIGH as
SHIFT is active high. The register performs right shift operation on the application of a clock pulse.
Procedure :-
4) Mount the required IC’s on the bread board and make the connections as per the diagram.
5) Give the + 5 Vcc and Gnd to IC with the help of connecting wires.
6) With the connecting wires give the clock input the required pin.
7) Connect the o/p pin across the logical o/p terminals
8) Apply the clock verify the shift register operation.
Conclusion :
1) SERIAL IN SERIAL OUT (SISO) (Right Shift)
Theory:
VHDL is a hardware description language. It stands for VHSIC Hardware Description Language. VHSIC itself
stands for Very High Speed Integrated Circuits. It describes the behaviour of an electronic circuit or system,
from which the physical circuit or system can be attained (implemented). VHDL is intended for circuit
synthesis as well as circuit simulation. VHDL is a standard, technology/ vendor independent language, and is
therefore portable and reusable. The two main immediate applications of VHDL are in the field of
Programmable Logic Devices and ASICs (Application Specific Integrated Circuits). Once the VHDL code has
been written, it can be used either to implement the circuit in a programmable device (from Altera, Xilinx,
Atmel etc.) or can be submitted to a foundry for fabrication of an ASIC chip. Contrary to regular computer
programs which are sequential, its statements are inherently concurrent (parallel). For that reason, VHDL is
usually referred to as a code rather than a program.
Code:
----------------------------------------------------------------------------------
library IEEE; ----- library declaration
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
begin
Y <= A and B;
end Behavioral;
2). OR Gate
Y=A+.B
INPUT OUTPUT
A B Y=A+B
0 0 0
0 1 1
1 0 1
1 1 1
Code:
----------------------------------------------------------------------------------
library IEEE; ----- library declaration
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
begin
Y <= A or B;
end Behavioral;
begin
Y <= not A;
end Behavioral;
Code:
----------------------------------------------------------------------------------
library IEEE; ----- library declaration
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
Code:
----------------------------------------------------------------------------------
library IEEE; ----- library declaration
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
Conclusion:
Conclusion:
Experiment No. 12
Aim:To realize 4 bit counter using VHDL
Theory
Counters
A counter is a device which stores the number of times a particular event or process has occurred, often in
relationship to a clock signal. There are two types of counters:
● up counters
● down counters
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all; -- library declaration
entity counter is
port(CLK, RST : in std_logic;
Q : out std_logic_vector(3 downto 0));
end counter; -- entity declaration
Conclusion:
4 bit counter