07-20-2022 09:45 AM
hello everyone ...
i converted decimal numbers which are from 0 to 200 into the binary string of 8 bits. now i want to divide it in two equal part first 4 bits and other 4 bits. the Vi is attached.
Solved! Go to Solution.
07-20-2022 10:02 AM - edited 07-20-2022 10:14 AM
Please attach your VI instead of a blurry picture.
So you have an U8, i.e. 8 bits and want two 4bit numbers (nibbles). You don't need anything pink for that, just some quick masking and shifting is sufficient.
What exactly do you want ant the end? (I would stick with numerics. Strings are useless for e.g. math)
07-20-2022 10:08 AM - edited 07-20-2022 10:08 AM
Looks like you are all but there. What exactly were you having problems with?
You can eliminate most of your code (the FOR loop and most of the supporting code) by changing the string format to %08b.

07-20-2022 10:13 AM - edited 07-20-2022 10:15 AM
@User002 wrote:
the Vi is attached.
No, that's an image of the VI...
And you can embed images in a post, saving us a download, open and delete.
Try:
EDIT: that crossed a few messages. At least my rant is constructive 😁.
07-21-2022 02:33 AM - edited 07-21-2022 02:34 AM
07-21-2022 03:47 AM
wiebe@CARYA wrote:EDIT: that crossed a few messages. At least my rant is constructive 😁.
Not implying the other rants where not constructive, just that my rant was constructive compared to my answer. I wasn't dissing rants. 🙄
07-21-2022 03:52 AM
07-21-2022 10:58 AM - edited 07-21-2022 10:59 AM
@GerdW wrote:
Hi jeet,
one more try:
Cute! Not sure what the compiler does with all this, but my gut feeling is that this requires quite a few more clock cycles compared to my solution. 😄
07-21-2022 11:02 AM
@altenbach wrote:
Cute! Not sure what the compiler does with all this, but my gut feeling is that this requires quite a few more clock cycles compared to my solution. 😄
Sure.
I also wouldn't use Q&R on an FPGA…
07-21-2022 11:03 AM
@altenbach wrote:
@GerdW wrote:
Hi jeet,
one more try:
Cute! Not sure what the compiler does with all this, but my gut feeling is that this requires quite a few more clock cycles compared to my solution. 😄
But it does (at least somewhat) fit onto a postage stamp, so there's that...