Am trying to make a decimal to bit conversion using behavioural voltage source. but one of the equation is returning value as ‘2’ instead of ‘0’ which is given below.
.param A=4
B_a_out0 a_out0 0 V=FLOOR(A/2)
B_a0 a0 0 V=A-2FLOOR(A/2)
B_a1 a1 0 V=V(a_out0)-(2FLOOR(V(a_out0)/2)) ← returns value 2 instead of 0
You can find symbols for 4-bit, 8-bit, and 12-bit DEC to Binary conversion in Digital Symbol Github Link, which are based on the B-source with a general formula. Below is an example of how they are used.
Thanks a lot @KSKelvin , it was something that I messed up. I restarted the whole and tested again and now its working(Meanwhile I upgraded to latest version and removed some unwanted code from the file which might be the source of issue)
I was starting to do a simple comparison between adders(RCA, CLA, CSA etc) and speed of processing and wanted to get bits first. the DEC2BINARY also seems to be an interesting solution.
Below is a snippet just for info about the current situation.