Java code


#1

What I’m trying to do is get a connection between the XEM3001v2 and a java calculator gui.

//plus is an integer set to zero,but changes to one when plus button
//has been pressed. When one, vhdl code does addition.
SetWireInValue((short)0x00,plus);
xem.UpdateWireIns();

//when the minus button has been pressed
xem.SetWireInValue((short)0x01,minus);
xem.UpdateWireIns();

//clear button has been pressed
if (clear buton pressed){
//from what I understand, this clears the
//data and addresses pointers
xem.ActivateTriggerIn((short)0x40,0);
}

/*
After a few numbers have been pressed “9”, “5” and then “+” or “-”
num1=95, then more numbers are pressesd followed by “+”,"-" or “=” gives num2=(the value pressed), I want to send the integer (8 bit number only)
*/
xem.SetWireInValue((short)0x02,num1);
xem.UpdateWireIns();
xem.SetWireInValue((short)0x03,num2);
xem.UpdateWireIns();
xem.SetWireInValue((short)0x04,num3);
xem.UpdateWireIns();

//when equals pressed
UpdateWireOuts();
result=GetWireOutValue(0x20);
//then display result on screen

Some pars of this code don’t compile. Could you comment on where I have gone wrong.

Thanks