This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module top ( | |
| input wire [3:0] sw, // sw[3]=A, sw[2]=B, sw[1]=C, sw[0]=D | |
| output wire [7:0] seven, // seven[0..6] = segments a..g, seven[7] = DP | |
| output wire [3:0] segment // Digit select enable | |
| ); | |
| wire [6:0] seg_bus; | |
| // Instantiate BCD-to-7-Segment Decoder | |
| bcd_to_7seg_vec u_bcd ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module top ( | |
| input wire [3:0] btn, // Data inputs: btn[0]..btn[3] | |
| input wire [1:0] sw, // Select inputs: sw[0] = S0, sw[1] = S1 | |
| output wire [7:0] led // Active-high output LED: led[0] | |
| ); | |
| // Buttons with PULL_MODE=UP read 0 when pressed and 1 when unpressed. | |
| // Inverting 'btn' converts the active-low button press to logic 1, | |
| // so pressing the selected button turns the active-high LED ON (1 = ON). | |
| wire [3:0] data_in = ~btn; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module top ( | |
| input wire [3:0] sw, // sw[0]=A, sw[1]=B, sw[2]=C, sw[3]=D | |
| output wire [7:0] led, // led[0]=F, led[1]=G, led[7:2]=1 | |
| output wire [7:0] seven, // 7-segment segment signals (driven to 0) | |
| output wire [3:0] segment // 7-segment digit select signals (driven to 0) | |
| ); | |
| // Instantiate the gate-level circuit | |
| mano_circuit u_mano ( | |
| .A(sw[0]), // Pin 73 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module mano_circuit ( | |
| input wire [3:0] sw, // sw[0]=A, sw[1]=B, sw[2]=C, sw[3]=D | |
| output wire [1:0] led // led[0]=F, led[1]=G | |
| ); | |
| // Map inputs for schematic clarity | |
| wire A = sw[0]; | |
| wire B = sw[1]; | |
| wire C = sw[2]; | |
| wire D = sw[3]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ============================================================================== | |
| // Tang Nano 9K Physical Constraints File (tangnano9k.cst) | |
| // ============================================================================== | |
| // --- Clock Input --- | |
| IO_LOC "clk" 52; | |
| IO_PORT "clk" PULL_MODE=UP; | |
| // --- Push Buttons besides USB Port --- | |
| IO_LOC "key" 3; // button S2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================================== | |
| # Reusable Gowin FPGA Makefile Template (Tang Nano Series) | |
| # ============================================================================== | |
| # Project Configuration | |
| PROJECT ?= counter | |
| TOP_MODULE ?= $(PROJECT) | |
| VERILOG_SRCS ?= $(PROJECT).v | |
| CST_FILE ?= tangnano9k.cst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias vig='vi $HOME/scripts/bash/.git_aliases' | |
| # GIT aliases | |
| alias st='git status --short' | |
| alias rb='git rebase -p' | |
| alias rbi='git rebase -p --interactive' | |
| alias rbm='git rebase -p master' | |
| alias gcp='git cherry-pick' | |
| alias stash='git stash' | |
| alias pop='git stash pop' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # castanet.sh: Script to connect a chromecast to a WiFi network. | |
| # | |
| # Allows you to put your Chromecast on WiFi and do Chromecast initial setup | |
| # without using the Google Home app at all, just using a normal Linux computer. | |
| # | |
| # You do need your Chromecast to be on Ethernet, or (untested) to join its setup WiFi | |
| # network with your PC, and you also need to find out its IP yourself with e.g. | |
| # Wireshark. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //C++ copy files | |
| #include <fstream> | |
| std::ifstream src("from.ogv", std::ios::binary); | |
| std::ofstream dst("to.ogv", std::ios::binary | std::ios::trunc); | |
| dst << src.rdbuf(); | |
| /* | |
| the one-liner: | |
| std::ofstream(dest) << std::ifstream(src).rdbuf(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Misc MACs: | |
| Num MAC Vendor | |
| --- --- ------ | |
| 0000 - 00:00:00 - XEROX CORPORATION | |
| 0001 - 00:00:01 - XEROX CORPORATION | |
| 0002 - 00:00:02 - XEROX CORPORATION | |
| 0003 - 00:00:03 - XEROX CORPORATION | |
| 0004 - 00:00:04 - XEROX CORPORATION | |
| 0005 - 00:00:05 - XEROX CORPORATION | |
| 0006 - 00:00:06 - XEROX CORPORATION |
NewerOlder