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
// Problem: https://hdlbits.01xz.net/wiki/Fsm_serialdp. | |
module top_module( | |
input clk, | |
input in, | |
input reset, // Synchronous reset | |
output [7:0] out_byte, | |
output done | |
); // | |
parameter START = 4'd0, BIT0 = 4'd1, BIT1 = 4'd2, BIT2 = 4'd3, BIT3 = 4'd4, | |
BIT4 = 4'd5, BIT5 = 4'd6, BIT6 = 4'd7, BIT7 = 4'd8, PARITY = 4'd9, |
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
// Problem: https://hdlbits.01xz.net/wiki/Fsm_serialdata | |
module top_module( | |
input clk, | |
input in, | |
input reset, // Synchronous reset | |
output [7:0] out_byte, | |
output done | |
); // | |
parameter START = 4'd0, BIT0 = 4'd1, BIT1 = 4'd2, BIT2 = 4'd3, BIT3 = 4'd4, | |
BIT4 = 4'd5, BIT5 = 4'd6, BIT6 = 4'd7, BIT7 = 4'd8, STOP = 4'd9, |
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 counter #(parameter BGN, parameter END, parameter LOAD=0) ( | |
input clk, | |
input reset, | |
input ena, | |
output c, | |
output [7:0] d | |
); | |
logic c0, c1; | |
assign c0 = (d[3:0] == 4'd9); | |
assign c = ena & (d == 8'(END)); // AND `ena` here to make sure `c` is set when previous digit is counting. |
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_module ( | |
input [7:0] a, | |
input [7:0] b, | |
output [7:0] s, | |
output overflow | |
); | |
logic c; | |
assign {c, s} = a + b; | |
assign overflow = ~(a[7] ^ b[7]) & (c ^ s[7]); | |
endmodule |
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
#!python | |
# coding: utf-8 | |
import os | |
import string | |
import pandas as pd | |
pd.set_option('future.no_silent_downcasting', True) | |
class Excel: | |
ENGINE = 'xlrd' # Specify the engine for reading .xls files |
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
REM To enable ICS for interface. Set the ICS from following GUI: | |
REM Settings -> Network & Internet -> Open Network & Internet settings -> Change adapter options | |
REM -> Properties -> Sharing | |
REM -> Allow other network users to connect through this computer’s Internet connection. | |
REM After setting above option correctly, run following commands in the terminal with Administrator Privilege. | |
sc config SharedAccess start=auto | |
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\SharedAccess /v EnableRebootPersistConnection /t REG_DWORD /d 1 |
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
/** | |
* @file circular_buffer.h The circular buffer. | |
*/ | |
#ifndef CIRCULAR_BUFFER_H | |
#define CIRCULAR_BUFFER_H | |
/** | |
* @brief The circular buffer class. | |
*/ |
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
#!python | |
from math import pi | |
# The first-order low-pass filter has following transfer function of s-domain | |
# H(s) = a / (s + a). | |
# Its pole is s = −a, and the pole in digital filter will be z = e^−aT | |
# Therefore the H(z) is (1 - e^-aT)*z / ( z - e^-aT ) | |
FREQ_SAMPLING = 50e3 | |
TIME_SAMPLING = 1 / FREQ_SAMPLING |
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
#!python | |
# coding: utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
dt = 0.1 # The time interval of sampling. | |
# Make input data with some white noise. | |
z = np.arange(1, 100, dt) |
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
#!python | |
# -*- coding: utf-8 -*- | |
import drawsvg as draw | |
# Reference: https://github.com/cduck/drawsvg/blob/master/docs/index.md | |
reg = { | |
'31': 'EN', |
NewerOlder