- VGA 640x480@60 text display, 8x16 CP437 font ROM from Linux console fonts - USB HID keyboard (PS/2 via onboard PIC24), scan code set 2 to ASCII with xterm sequences for cursor/editing keys - UART RX/TX with switch-selectable baud, local echo option - Terminal engine: control codes, deferred wrap, hardware scroll, VT100/ANSI subset (cursor moves, erase, reverse video, cursor hide) - Vivado build/program/flash scripts and xsim whole-design testbench Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1007 B
Verilog
30 lines
1007 B
Verilog
`timescale 1ns / 1ps
|
|
|
|
// Four-digit hex display, digit 3 (left) = value[15:12]. Segments active low.
|
|
module sevenseg (
|
|
input clk,
|
|
input [15:0] value,
|
|
output reg [6:0] seg,
|
|
output reg [3:0] an
|
|
);
|
|
reg [17:0] cnt;
|
|
always @(posedge clk) cnt <= cnt + 1'b1;
|
|
|
|
wire [1:0] d = cnt[17:16];
|
|
wire [3:0] x = value[d*4 +: 4];
|
|
|
|
always @(posedge clk) begin
|
|
an <= ~(4'b0001 << d);
|
|
case (x) // gfedcba
|
|
4'h0: seg <= 7'b1000000; 4'h1: seg <= 7'b1111001;
|
|
4'h2: seg <= 7'b0100100; 4'h3: seg <= 7'b0110000;
|
|
4'h4: seg <= 7'b0011001; 4'h5: seg <= 7'b0010010;
|
|
4'h6: seg <= 7'b0000010; 4'h7: seg <= 7'b1111000;
|
|
4'h8: seg <= 7'b0000000; 4'h9: seg <= 7'b0010000;
|
|
4'hA: seg <= 7'b0001000; 4'hB: seg <= 7'b0000011;
|
|
4'hC: seg <= 7'b1000110; 4'hD: seg <= 7'b0100001;
|
|
4'hE: seg <= 7'b0000110; 4'hF: seg <= 7'b0001110;
|
|
endcase
|
|
end
|
|
endmodule
|