Code: Select all
#include <xs1.h>
#include <stdio.h>
#include <print.h>
port temp = XS1_PORT_1A;
in buffered port:8 inP = XS1_PORT_1B;
clock clk25 = XS1_CLKBLK_1;
int x;
int main(void) {
configure_clock_rate(clk25, 100, 4);
configure_in_port(inP, clk25);
start_clock(clk25);
par{
{
temp <: 1;
temp <: 0;
temp <: 1;
temp <: 0;
temp <: 1;
temp <: 0;
temp <: 1;
temp <: 1;
}
{
for(int i=0 ; i<8 ; i++) {
inP :> x;
}
printf("%d",x);
}
}
return 0;
}