Initial commit
This commit is contained in:
37
Exp4/Exp4.srcs/sources_1/new/SegDisplayCtrl.v
Normal file
37
Exp4/Exp4.srcs/sources_1/new/SegDisplayCtrl.v
Normal file
@@ -0,0 +1,37 @@
|
||||
`timescale 1ns / 1ps
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Company:
|
||||
// Engineer:
|
||||
//
|
||||
// Create Date: 2024/10/31 11:26:14
|
||||
// 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 [4:0] type,
|
||||
output reg [6:0] seg
|
||||
);
|
||||
always @(*) begin
|
||||
case (type)
|
||||
5'b10000: seg = 7'b1110111; // a
|
||||
5'b01000: seg = 7'b0011111; // b
|
||||
5'b00100: seg = 7'b1001110; // c
|
||||
5'b00010: seg = 7'b0111101; // d
|
||||
5'b00001: seg = 7'b1001111; // e
|
||||
default: seg = 7'b0000000;
|
||||
endcase
|
||||
end
|
||||
endmodule
|
||||
Reference in New Issue
Block a user