Skip to content

Instantly share code, notes, and snippets.

View APadierna's full-sized avatar
🛰️

Alvaro APadierna

🛰️
View GitHub Profile
library ieee;
use ieee.std_logic_1164.all;
entity BancoRegistros is
generic(
nbits : integer : = 16
);
port(
clk : in std_logic;
wr : in std_logic;
@APadierna
APadierna / find_duplicates.py
Created December 24, 2015 11:34
Script to crawl into a directory and dettect (by hash) duplicated files and (optionally) remove them
#!/usr/bin/env python
"""
Script to crawl into a directory and dettect (by hash) duplicated files and (optionally)
remove them
Kudos to http://stackoverflow.com/a/748908
"""
import argparse
@APadierna
APadierna / download_xkcd_strips.py
Last active November 10, 2015 20:58
Simple script which downloads all the XKCD strips listed in the XKCD archive (http://xkcd.com/archive/)
#!/usr/bin/env python
"""
Download all the comic strips listed in the XKCD archive page into the current
directory.
"""
from __future__ import print_function
import re
import sys
@APadierna
APadierna / dilbert.py
Last active November 14, 2021 14:58
Script to download The dilbert comic strips
#!/usr/bin/env python
"""
Simple script to download the Dilbert comic strips in a defined period of time
If no arguments are passed to the script, it will download all the Dilbert comic
strips in the current folder (It may take a while).
Acknowledgments
---------------
This script is strongly based in the work from:
@APadierna
APadierna / counter.vhd
Last active August 29, 2015 14:18
Simple configurable VHDL counter block
----------------------------------------------------------------------
--! @brief
--! Simple configurable counter
--!
--! @details
--! counter the number of 'clk' rising edges defined by 'g_eoc'.
--! Once the EOC value is reached, this is indicated by the
--! activation of the 'eoc' signal.
--! The counter is restarted with the 'start' activation.
--! The counter may be configured with the 'g_cyclic' signal to
@APadierna
APadierna / moving_avg.vhd
Last active January 1, 2016 09:19
A simple example of a moving average block (four last samples)
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.std_logic_unsigned.all;
entity moving_avg is
generic(
g_data_width : integer:= 16
);
port (
clk : in std_logic;
@APadierna
APadierna / XModemCrcCalculator.py
Last active April 16, 2016 22:16
CRC calculator using the XModem algorithm.
#!/usr/bin/python
"""
Given a file containing hexadecimal numbers (one number per line),
returns the XModem CRC of these numbers.
Note: This scrip uses the thist party library `crcmod`.
you may isntall it using `pip install crcmod`
More info available here:
https://pypi.python.org/pypi/crcmod
"""