Sevensegment
Sevensegment
Sevensegment
bcd,
seg
);
always @(bcd)
begin
0 : seg = 7'b1000000;
1 : seg = 7'b1111001;
2 : seg = 7'b0100100;
3 : seg = 7'b0110000;
4 : seg = 7'b0011001;
5 : seg = 7'b0010010;
6 : seg = 7'b0000010;
7 : seg = 7'b1111000;
8 : seg = 7'b0000000;
9 : seg = 7'b0010000;
//switch off 7 segment character when the bcd digit is not a decimal number.
endcase
end
endmodule
module tb_segment7;
integer i;
segment7 uut (
.bcd(bcd),
.seg(seg)
);
//Apply inputs
initial begin
begin
bcd = i;
end
end
endmodule
module sevensegment_top(an,sw,seg);
input [3:0]sw;
output [6:0]seg;
segment7 s1(sw,seg);
endmodule
## This file is a general .xdc for the Nexys4 rev B board
## To use it in a project:
## - rename the used ports (in each line, after get_ports) according to the top level signal names in
the project
## Clock signal
## Switches
## LEDs
##Buttons
##Pmod Header JA
##Pmod Header JB
##Pmod Header JC
##Pmod Header JD
##VGA Connector
##Micro SD Connector
##Accelerometer
##Omnidirectional Microphone
##USB-RS232 Interface
##Cellular RAM