Initial commit
This commit is contained in:
44
Exp2/Exp2.srcs/sources_1/new/SegDisplayCtrl.v
Normal file
44
Exp2/Exp2.srcs/sources_1/new/SegDisplayCtrl.v
Normal file
@@ -0,0 +1,44 @@
|
||||
`timescale 1ns / 1ps
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Company:
|
||||
// Engineer:
|
||||
//
|
||||
// Create Date: 2024/10/18 21:48:13
|
||||
// Design Name:
|
||||
// Module Name: SegDisplayCtrl
|
||||
// Project Name:
|
||||
// Target Devices:
|
||||
// Tool Versions:
|
||||
// Description:
|
||||
//
|
||||
// Dependencies:
|
||||
//
|
||||
// Revision:
|
||||
// Revision 0.01 - File Created
|
||||
// Additional Comments:
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
module SegDisplayCtrl(
|
||||
input wire [2:0] count,
|
||||
input wire pass,
|
||||
output reg [6:0] seg1,
|
||||
output reg [6:0] seg2
|
||||
);
|
||||
always @(*) begin
|
||||
case (count)
|
||||
3'b000: seg1 = 7'b1111110; // 0
|
||||
3'b001: seg1 = 7'b0110000; // 1
|
||||
3'b010: seg1 = 7'b1101101; // 2
|
||||
3'b011: seg1 = 7'b1111001; // 3
|
||||
3'b100: seg1 = 7'b0110011; // 4
|
||||
3'b101: seg1 = 7'b1011011; // 5
|
||||
default: seg1 = 7'b0000000;
|
||||
endcase
|
||||
if (pass)
|
||||
seg2 = 7'b1100111; // P
|
||||
else
|
||||
seg2 = 7'b1000111; // F
|
||||
end
|
||||
endmodule
|
||||
Reference in New Issue
Block a user