Skip to content

Instantly share code, notes, and snippets.

View maluta's full-sized avatar

Tiago Maluta maluta

View GitHub Profile
struct Struct1 {
unsigned int a0;
unsigned int a1;
unsigned int a2;
unsigned int a3;
};
struct Struct2 {
/* nessa versão o avião nunca pega o pombo */
#include <stdio.h>
#include <stdlib.h>
#define dprintf if (debug) printf
const char debug = 0; /* or 0 if you want disable debug */
# -*- coding: utf-8 -*-
from pylab import *
N = 100
start = 0
end = 1
A = rand()
B = rand()
# -*- coding: utf-8 -*-
# Tiago Maluta
# License: GPLv3
import simplejson
import urllib
f = open("download.sh","w+")
f.write("#!/bin/sh\n")
/*
This was discussed in http://www.c-faq.com/struct/structhack.html
Despite its popularity, the technique is also somewhat notorious:
Dennis Ritchie has called it ``unwarranted chumminess with the C implementation,''
and an official interpretation has deemed that it is not strictly conforming with
the C Standard, although it does seem to work under all known implementations.
(Compilers which check array bounds carefully might issue warnings.)
entity exemplo is
port (
a,b,c,d : in bit;
f : out bit
);
end exemplo;
entity exemplo is
port (
a : in bit;
x : inout bit
);
end exemplo;
entity exemplo is
port (
a,b : in bit;
c : in bit_vector (2 downto 0);
d : buffer bit;
e : inout std_logic_vector (3 downto 0);
f : out bit
);
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Tiago Maluta
# GPLv3
import cgi
import hashlib
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
entity mux is
port (
din_1 : in bit_vector (7 downto 0);
din_2 : in bit_vector (7 downto 0);
din_3 : in bit_vector (7 downto 0);
din_4 : in bit_vector (7 downto 0);
dout : out bit_vector(7 downto 0);
sel : in bit_vector (1 downto 0)
);
end mux;