Skip to content

Instantly share code, notes, and snippets.

@fbrosser
fbrosser / Stimulus4.v
Created November 20, 2012 06:31
Stimulus4.v
// TEST #1
// -0.34702802744 - 0.185232380239 = -0.0642808275323
// Expected Z = 10111101100000111010010110101011
#10 a = 32'b10111110101100011010110110101000; b = 32'b00111110001111011010110110001111; operation = 1'b1; $display("%b", result);
// TEST #2
// -0.631432573103 + -0.0408467302274 = 0.0257919559703
// Expected Z = 10111100110100110100100110100111
#10 a = 32'b10111111001000011010010110010001; b = 32'b10111101001001110100111011100111; operation = 1'b0; $display("%b", result);
@fbrosser
fbrosser / gist:4116403
Created November 20, 2012 06:32
Output3.v
10111110100010111011001111111011
00111111001110100101110010010100
10111111000110101001110010101110
00111110110101110010100010000011
00111110000011100001101001100111
00111111010111011111001001100101
10111111010000100101101000000111
10111110111101110100011011011011
10111111010110110111010000111100
10111111101100101111001001010100
@fbrosser
fbrosser / Output4.v
Created November 20, 2012 06:33
Output4.v
10111101100000111010010110101011
10111100110100110100100110100111
00111110111111011111000101101010
10111101010010111100101110100110
00111110110011100000011010011000
10111101101101000010000100011000
00111000011110001100100100001111
10111110010100001011001010100100
10111101100101111010011101010110
10111111001111111001101011001101
void game_functions::move_ghosts()
{
for(int i=0;i<num_of_ghosts;i++)
{
if(stuck>(30*i)+10)
{
if(ghosts[i].get_scared()==0) // Om spöket är vid sina sinnes fulla bruk
{
int pq = rand()%10+1;
@fbrosser
fbrosser / main.c
Created January 28, 2018 08:05
Piezo piano
int IMLength = 70;
String IMNotes[] = {"G4","G4", "G4", "D#4/Eb4", "A#4/Bb4", "G4", "D#4/Eb4","A#4/Bb4", "G4", "D5", "D5", "D5", "D#5/Eb5", "A#4/Bb4", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4", "G5","G4","G4","G5","F#5/Gb5", "F5","E5","D#5/Eb5","E5", "rest", "G4", "rest","C#5/Db5","C5","B4","A#4/Bb4","A4","A#4/Bb4", "rest", "D#4/Eb4", "rest", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4" ,"D#4/Eb4","A#4/Bb4", "G4"};
int IMBeats[] = {8, 8, 8, 6, 2, 8, 6, 2, 16, 8, 8, 8, 6, 2, 8, 6, 2, 16, 8, 6, 2, 8, 6, 2, 2, 2, 2, 6, 2, 2, 8, 6, 2, 2, 2, 2, 6, 2, 2, 9, 6, 2, 8, 6, 2, 16};
int IMTempo = 50;
int RTLength = 19;
String RTNotes[] = {"F4", "F4", "F4", "A#4/Bb4", "F5", "D#5/Eb5", "D5", "C5", "A#5/Bb5", "F5", "D#5/Eb5", "D5", "C5", "A#5/Bb5", "F5", "D#5/Eb5", "D5", "D#5/Eb5", "C5"};
int RTBeats[] = {21, 21, 21, 128, 128, 21, 21, 21, 128, 64, 21, 21, 21, 128, 64, 21, 21, 21, 128};
int RTTempo = 50;