06-29-2012 07:18 AM
hi.
This is really easy. I need to input a 3 bit number into a vi. For example, I want to input the number 3, and I need the program to write it as 003. or 78, and have the program show it throu an indicator as 078. how exactly cand we do that?
06-29-2012 07:26 AM
Use a string control instead of a number control, then convert it.
06-29-2012 07:26 AM
First, you should show what you have tried up till now.
Second, how does '78' connect to '003'?
Third: getting from 3 => 003, you can select the properties dialog (context menu), switch to "Display Format", select "Minimum Field Width" and set this to three. Choose to prepend '0' (Pad with zeros on left)
hope this helps,
Norbert
06-29-2012 07:27 AM
Hi Anarki,
3 bit numbers usually are in the range of 0 to 7 (included). What kind of "3 bit number" is 78?
When you're talking about digits instead you can
- change the formatting of numeric displays to show 3 digits with leading zeros
- format your numbers into strings using a format string like "%03d"...
06-29-2012 07:33 AM
ok
what i mean by 3 bit number is a number made up of 3 figures. for example 999 is a 3 bit number. 1000 is a 4 bit number. sorry if i am not expressing myself correctly
06-29-2012 07:37 AM
The term is, as Gerd already said: DIGIT(s) 🙂
Norbert
06-29-2012 08:24 AM
@Norbert_B wrote:
The term is, as Gerd already said: DIGIT(s) 🙂
Norbert
A KL-10
may have been one of the last machines designed by EE's without a lot of input from the software developers. It had the most robust instruction set I have ever used. It had machine code instructions that could solve hyperbolic functions in a sinlge instruction. It served as the hardware where VAXes where emulated in software prior to VMS becoming a reality. Vaxes where predicessors to Pentiums and VMS preceed Window NT (VMS ---> V+1 =W, M+1=N, S+1=T WNT).
The backplane of that machine looked like this
thos blue wires were the clock signals and required adjustments occationally to keep them all in sync.
Since memory was still tiny little ferite beads back then it was very expensive so the KL-10 hardware implemented variable lenght data fields so you could actually pack 12, 3-bit numbers into a single 36 bit memory location.
I know this does not answer the orignal question but it was too geeky for me to resist.
Ben
06-29-2012 08:28 AM
right, so I've done it. however it doesn't help me. I need to take every digit out of the number and apply a mathematical function to it. for example, if the number is 078 i need something like 0*5+7*9+8*3. or for 003 i need 0*5+0*9+3*3.
I've - changed the formatting to show 3 digits with leading zeros, but the program still recognises them as one number. what is to be done?
06-29-2012 08:30 AM - edited 06-29-2012 08:31 AM
06-29-2012 08:42 AM
the math above is just an example. its much more complicated, but still, just math:). the program itself is alot more complicated, this was the part I didn't get though so.. I just asked:d