L
lokesh kumar
Guest
Hi,
Can anyone help me to design a code to square binary number?
Suppose "A" is a 5 bit number (a4a3a2a1a0)
If we do A x A then the output result will be "0 a4 0 a3 0 a2 0 a1 0 a0 " ( a 10 bit number)
For example : Suppose A= 11111
Then A x A = 11111 x 11111 = 0101010101 ( Xor operation is done for the adding to get the final result).
Could anyone please help me out how to make a generalized code for squaring of a 5-bit number to get an output like this?
Many Thanks!
Can anyone help me to design a code to square binary number?
Suppose "A" is a 5 bit number (a4a3a2a1a0)
If we do A x A then the output result will be "0 a4 0 a3 0 a2 0 a1 0 a0 " ( a 10 bit number)
For example : Suppose A= 11111
Then A x A = 11111 x 11111 = 0101010101 ( Xor operation is done for the adding to get the final result).
Could anyone please help me out how to make a generalized code for squaring of a 5-bit number to get an output like this?
Many Thanks!