Skip to content

Instantly share code, notes, and snippets.

///////////////////////////////////////////////////////////////////////
/// 640x480 Connect 4 Board Display
/// ECE5760 Final Project
/// Cornell University Fall 2020
/// Rohan Agarwal (ra462), Megan Backus (mb2532), Andrew Tsai (aht53)
/// Professor Hunter Adams, Professor Bruce Land
/// DE1 computer
/// compile with:
/// gcc connectFourVGA.c -o connect_four -lm -lpthread
///////////////////////////////////////////////////////////////////////
//Defensive AI module to be used during first four moves
module connectFourAI_defensive(
input [83:0] gameState,
output [3:0] aiMove,
output [4:0] maxConnectOut,
input clk, reset
);
wire [13:0] row0;
wire [13:0] row1;
wire [13:0] row2;
@mb2532
mb2532 / fullAI.v
Last active December 21, 2020 07:23
//Top Level AI Compute Module:
//gamestate bits: 00 = empty, 01 = AI move, 10 = user move
module connectFourAI(
input [83:0] gameState,
output [3:0] aiMove,
output [4:0] maxConnectOut,
input clk, reset
);
wire [3:0] move [7:0];
module DE1_SoC_Computer (
////////////////////////////////////
// FPGA Pins
////////////////////////////////////
// Clock pins
CLOCK_50,
CLOCK2_50,
/*
* File: Hexapod Robot
* Authors: Joseph Primmer, Kenny Mao,
* Megan Baukus, Bruce Land et. al.
* Target PIC: PIC32MX250F128D
*/
#include "config_1_2_3.h"
// need for rand function
#include <stdlib.h>