DRILL1
DRILL1
DRILL1
DISCUSSION
A hardware description language (HDL) is a computerbased language that describes the hardware of digital systems
in a textual form. It resembles an ordinary computer
programming language, such as C, but is specifically oriented to
describing hardware structures and behaviour of logic circuits.
HDLs are used in several major steps in the design flow of
an integrated circuit:
design entry,
functional simulation or verification,
logic synthesis,
timing verification,
fault simulation.
Companies that design integrated circuits use proprietary
and public HDLs. In the public domain, there are two standard
HDLs that are supported by the IEEE: VHDL and Verilog.
VHDL
stands for VHSIC (very high speed integrated circuit) HDL
a Department of Defense mandated language
Verilog
began as a proprietary of companies and universities
known as Open Verilog International (OVI) as a step leading
to its adoption as an IEEE standard.
It was initially approved as a standard HDL in 1995; revised
and enhanced versions of the language were approved in
2001 and 2005.
Throughout this course, the Verilog HDL descriptions will be
listed to introduce a design methodology based on the concept
of computer-aided modelling of digital systems.
Module Declaration
A, B, C;
X;
wire1, wire2, wire3;
NOT(wire2, A);
EOR2(wire1, B, C);
AND2(wire3, wire1, A);
NOR2(X, wire3, wire2);
endmodule
B. Test Bench
Edit the saved file Drill1_1 by placing the following code below
the previous code.
//Test bench for the Verilog model of Fig 1.1
5
module testbench1_1;
reg
A, B, C;
wire
Z;
circuit1_1 tb1(A, B, C, Z);
initial
begin
A=1b0; B=1b0; C=1b0;
$display(Simulating output for circuit1_1);
$monitor($time,,,A=%b
B=%b
C=%b
%b,A,B,C,Z);
#2 A=1b0; B=1b0; C=1b1;
#1 A=1b0; B=1b1; C=1b0;
#1 A=1b0; B=1b1; C=1b1;
#1 A=1b1; B=1b0; C=1b0;
#1 A=1b1; B=1b0; C=1b1;
#1 A=1b1; B=1b1; C=1b0;
#1 A=1b1; B=1b1; C=1b1;
#2 $finish;
end
endmodule
Z=
reg
a, b,borrowIn;
wire
diff, borrowOut;
full_subtract
fs(diff, borrowOut, a, b, borrowIn);
initial begin
a=1b1; b=1b1; borrowIn=1b0;
end
initial begin
#10 a=1b1;
#10 a=1b0; b=1b1;
#10 a=1b1; b=1b0;
#10 borrowIn=1b1;
end
initial begin
$display(
a
b
borrowIn
difference borrowOut
time);
$monitor( %b
%b
%b
%b
%b
%b , a, b,
borrowIn, diff, borrowOut, $time);
#10 $finish;
end
endmodule
III. Programming Exercise
1. Copy the code below, and then create a test bench for it to
determine what combinational circuit is being simulated.
Save as exercise1_1.vl file.
module exercise1_1(W, X, Y, Z);
output
[0:3] W;
input
X, Y;
input
wire
X1, Y1, Z1;
Z;