[1] 2x4 Decoder 의 [3:0] 출력 : 4 개의 7-Segment LED (o_digitSel)
[2] BCD to FND Decoder 의 [7:0] 출력 : 각 7-Segment LED 의 Digit Number (o_fndFont)
`timescale 1ns/1ps
module FndController (
input [1:0] i_sw_decoder,
input [3:0] i_sw_bcd,
output [3:0] o_digitSel,
output [7:0] o_fndFont
);
decoder_2x4 U_decoder_2x4 (
.i_x(i_sw_decoder),
.o_y(o_digitSel)
);
BCDtoFND_Decoder U_BCDtoFND_Decoder (
.i_bcd(i_sw_bcd),
.o_fnd(o_fndFont)
);
endmodule
module decoder_2x4(
input [1:0] i_x,
output [3:0] o_y
);
reg [3:0] o_y;
always@(i_x) begin
case(i_x)
2'b00 : o_y = 4'b0001;
2'b01 : o_y = 4'b0010;
2'b10 : o_y = 4'b0100;
2'b11 : o_y = 4'b1000;
default : o_y = 4'b0000;
endcase
end
endmodule
module BCDtoFND_Decoder(
input [3:0] i_bcd,
output reg [7:0] o_fnd
);
always @(i_bcd) begin
case (i_bcd)
4'd0: o_fnd = 8'hc0; // 8'b11000000; // 0
4'd1: o_fnd = 8'hf9;
4'd2: o_fnd = 8'ha4;
4'd3: o_fnd = 8'hb0;
4'd4: o_fnd = 8'h99;
4'd5: o_fnd = 8'h92;
4'd6: o_fnd = 8'h82;
4'd7: o_fnd = 8'hf8;
4'd8: o_fnd = 8'h80;
4'd9: o_fnd = 8'h90;
default: o_fnd = 8'hff;
endcase
end
endmodule
'[Harman] 반도체 설계 > Vivado' 카테고리의 다른 글
[Vivado] 06. Calculator 8bit, FSM StopWatch 0.1s UpCount (0) | 2023.08.05 |
---|---|
[Vivado] 05. Finite State Machine LED (0) | 2023.08.05 |
[Vivado] 04. FndController, Adder 8bit (0) | 2023.08.05 |
[Vivado] 03. Adder 8bit (0) | 2023.08.05 |
[Vivado] 02. FndController, Counter, DigitSplitter, clkDivider (0) | 2023.08.05 |