VHDL 1
VHDL 1
URUKSHETR UNVERSID
Kiviat (1967) was among the first to describe the modeling process and the
proficiencies needed. A user with in-depth knowledge of almost any
general purpose programming language can provide most of these
proficiencies. However, the burdenof achieving a final simulation is
formidable as the programmer needs to provide software to accomplish all
the needed components including random number generation, random
variate generation, status updating and time advance, statistical collection
and display, etc. To accomplish all this for a single model is generally
prohibitive and there are simulation languages and simulation libraries to
ease the burden of creating simulations.
WHAT IS MODELSIM SE-64 10.5?
This tutorial is intended for users with no previous experjonte with ModelSIM SE
64
10.5 simulator. It introduces you with the basic flow how to set up ModelSIM SE
64
10.5 simulator, compile your designs and the simulation basics with ModelSIM SE
-64
10.5 SE. The example used in this tutorial is a small designwritten ja VHDL
and onlythe most basic commands will be covered in this tutorial. This
tutorial was made by using version 6.1b of ModelSIM SE-64 10.5 SE on
Linux.
EXPERIMENT: -1
Inputs Outputs
A B SUM CARRY
1 1
-s
B
c
Program to implement a half adder:
module halfadder(sum,cout,a, b);
input a b;
output sum,cout;
Xor x1(sum, a,b);
and at(cout,a,b);
endmodule
Output Window:
Wave -Defait
hadder e 0Data
haddert o Dat
Wadder No Data
haddere oData
800 ns
EXPERIMENT: -2
SUM
Full Adder
B
C in C_out
Truth Table:
INPUT OUTPUT
SUM Carry
A B Cin
Out
0 0
1 1 0
1 1
1 1 1
1 1 0
1
1
1
elel
1
1
1
1
0 1
1
1
Program to implement full adder:
module full adder (sum, cout, A, B, Cin);
input A,B,Cin;
output sum,
cout;wire wl,
w2, w3;
Xor x1 (sum,A, B), x2(sum,w,Cin);
and at(w2,w1,Cin),
a2(w3,A,B);or
o1(Cout,w2,w3);
endmodule
Output Window:
We-Defut
tadoeA
der5
ado CI
fedóer w2
800ps
Viave fade
EXPERIMENT: 3
I3
I2 4x1 ’Y
Multiplexer
Io
11
S1 So
Circuit Diagram:
S1
So
Io
o1(Y,w1,w2,w3, w4);
endmodule
Output:
Wave-Defaut
4 ma42
tiow 600
Theory:
A De-multiplexer is a combinational circuit that has only 1 input line and 2 output lines.
Simply, the multiplexer is a single input and multi-output combinational circuit. The
information is received fromthe single input lines and directed to the output line. On the
basis of the values of the selection lines, the input will be connected to one of these
outputs. De-multiplexer is opposite to the multiplexer.
Unlike encoder and decoder, there are n selection lines and 2 outputs. So, there is a
total of 2'possible combinations of inputs. De-multiplexer is also treated as De-mux.
Circuit Diagram:
electraniclinic.com
DO
E D1
1 to 4
Demultiplexer D2
Input
D3
A B-0
Truth Table:
E A B DO D1 D2 D3
X 1 1 1 1
1 1 1
1 1 1 1
1 1 1 1
1 1 1 1 1
Program For De
multiplexer: module
demux_df1(at,a2,a3,a4,a,f);
output[3:0]a1,a2,a3, a4;
input[3:0]a;
input[1:0]f;,
parameter
d=4'hz;
assign
at=(f==2bO0)?a:d;
assign
a2=(f==2'b01)?a:d;
assign
a3=(f==2b10)?a:d;
assign
a4=(f==2'b11)?a:d;
endmodule
Output window: