Hello, I am having a problem where Xilinx ISE is trimming away a variable that I need, tempShifts. I can still implement the module but I am not sure what it is doing with my variable. This says to me that tempShifts isn't being trimmed... Explanations?
Also this module uses the shift and add 3 algorithm to convert binary to BCD format. Specifically this converts a 16 bit binary number into
5 BCD digits.module binaryBCD( input [15:0] binaryIn, //input 16bit number output reg [19:0] bcdOut //5 display BCD output );
reg [35:0] tempShifts; //temporary storage while computing
always @(binaryIn) begin tempShifts = 0; //the method used is shift and add 3 //this requires 16 total shifts, first three are done here tempShifts[18:3] = binaryIn;
repeat(13) begin //for the method if any BCD digit is over 4 add three then shift if (tempShifts[19:16] > 4) tempShifts[19:16] = tempShifts[19:16] + 3; if (tempShifts[23:20] > 4) tempShifts[23:20] = tempShifts[23:20]+ 3; if (tempShifts[27:24] > 4) tempShifts[27:24] = tempShifts[27:24] + 3; if (tempShifts[31:28] > 4) tempShifts[31:28] = tempShifts[31:28] + 3; if (tempShifts[35:32] > 4) tempShifts[35:32] = tempShifts[35:32] + 3;
tempShifts = tempShifts