Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views6 pages

GROUP 6 - LaboratoryNo.3

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

Hardware Descriptive Language

TECHNOLOGICAL UNIVERSITY OF THE PHILIPPINES


Ayala Blvd. cor San Marcelino St. Ermina, Manila

Laboratory No.3
CPET7L – 2A
Thursday 7:00AM to 10:00PM

Submitted By:
Almarines, Jerico
Cochangco, Joshua
Dabon, Eugene
Ferrolino, Japhet
Mendoza, Aldrin Daniel G.

Submitted To:
Engr. AIMEE G. ACOBA
CPE Faculty
Hardware Descriptive Language

Type the question then screenshot the result of your program.

Task Assessment
An ABCD-to-seven-segment decoder is a combinational circuit that converts a decimal digit in
BCD to an appropriate code for the selection of segments in an indicator used to display the
decimal digit in a familiar form. The seven outputs of the decoder (a, b, c, d, e, f, and g) select
the corresponding segments in the display, as shown on Figure 1. The numeric display chosen
to represent the decimal digit is shown in Table No.1. Using a truth table and Karnaugh
maps, design the BCD-to-seven-segment using a minimum number of gates (except NOT
gate).

Verilog program :

module Seg (W,X,Y,Z,a,b,c,d,e,f,g);


input W,X,Y,Z;
output a,b,c,d,e,f,g;
assign a = ((~(W)&~(X)&~(Z))|((~(W)&Y))|(~(W)&X&Z)|(W&~(X)&~(Y)));
assign b = ((~(W)&~(Y)&~(Z))|(~(W)&Y&Z)|(~(W)&~(X))|(~(X)&~(Y)));
assign c = ((~(W)&~(X)&Z)|(~(W)&X&~(Z))|(~(W)&~(Y))|(~(X)&~(Y)));
assign d = ((~(X)&~(Y)&~(Z))|(~(W)&X&Z)|(~(W)&Y));
assign e = ((~(W)&~(X)&~(Z))|(W&~(X)&~(Y))|(~(W)&X&Y));
assign f = ((~(X)&~(Y)&~(Z))|(~(W)&X&~(Y))|(~(W)&X&~(Z))|(W&~(X)&~(Y)));
assign g = ((W&~(X)&~(Y))|(~(W)&Y)|(~(W)&X));
endmodule

module testbench;
reg W,X,Y,Z;
wire a,b,c,d,e,f,g;

initial begin
$display ("W X Y Z | a b c d e f g");
Hardware Descriptive Language

W = 1'b0;
X = 1'b0;
Y = 1'b0;
Z = 1'b0;
#15 $finish;
end
always #8 W=~W;
always #4 X=~X;
always #2 Y=~Y;
always #1 Z=~Z;

Seg u1 (W,X,Y,Z,a,b,c,d,e,f,g);
initial
$monitor ("%b %b %b %b | %b %b %b %b %b %b %b", W,X,Y,Z,a,b,c,d,e,f,g);
endmodule

Screenshot output
Hardware Descriptive Language

ABCD to 7 Segment Decoder Truth Table Simulation


Hardware Descriptive Language

Karnaugh-Map grouping and Boolean expressions of each variable


Hardware Descriptive Language

Handwritten Karnaugh Map computation of Boolean expressions in each variable from a to g.

You might also like