Forum Discussion
Altera_Forum
Honored Contributor
13 years agoHello,
I have experimented with the altera examples of CRC and was successful in bringing up the custom instruction on the DE1 board. Now I have questions on the way in which I should implement the custom instruction for arbitrary precision integer addition (say 128 bit) What I plan is to do a 32 bit + 32 bit addition (since the dataa and datab signals are 32 bit, I dont intend to change the base unit size, let it be 32 bits) for a clock cycle and do the same for 4 clock cycles, so that 32 * 4 = 128 bits in total. Hence I can try to implement a multicycle custom instruction which runs for four clock cycles and after that, returns the 'result' signal. Here, I would have to save the 'carry out' bit and the 'result' signals for each and every stage. I think since the 'result' port is an output port, that data can be saved somehow. However, the 'carry out' bit has to propagate to the next stage of adder as the 'carry in' bit. I was wondering how to do this? Do I have to use External Interface Custom Instructions ? I read that a multicycle Custom Instructions Allow the Addition of an External Interface. Figure 1.9 in the NIOS II custom instruction user guide. I sentence which captivated me was "Custom instruction logic can perform various tasks such as storing intermediate results or reading memory to control the custom instruction operation." Please give me some pointers here, that would be a great help. Thank You, Akhil